xulipa
xulipa2mo ago

Offline mode

When trying to use the offline mode example on the docs website I get the following error: 'Room.ConnectOptions' does not contain a definition for 'offlineMode'
6 Replies
kapa.ai
kapa.ai2mo ago
Hi @xulipa. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The error you're encountering suggests that the offlineMode property is not recognized within the ConnectOptions struct for the Room class. This could be due to a version mismatch or an incorrect usage of the API. According to the Normcore documentation (https://normcore.io/documentation/room/offline-mode), the offlineMode property is indeed part of the ConnectOptions struct and can be used when calling the Connect() method on the Realtime or Room classes. Here's an example of how it's used:
class OfflineModeExample {
[SerializeField]
private Realtime _realtime;

private void Start() {
// Notify us when Realtime successfully connects to the room
_realtime.didConnectToRoom += DidConnectToRoom;

// Connect to "My Room" in offline mode
_realtime.Connect("My Room", new Room.ConnectOptions {
offlineMode = true
});
}

private void DidConnectToRoom(Realtime realtime) {
if (realtime.room.offlineMode) {
Debug.Log($"Connected to room in offline mode!");
}
}
}
class OfflineModeExample {
[SerializeField]
private Realtime _realtime;

private void Start() {
// Notify us when Realtime successfully connects to the room
_realtime.didConnectToRoom += DidConnectToRoom;

// Connect to "My Room" in offline mode
_realtime.Connect("My Room", new Room.ConnectOptions {
offlineMode = true
});
}

private void DidConnectToRoom(Realtime realtime) {
if (realtime.room.offlineMode) {
Debug.Log($"Connected to room in offline mode!");
}
}
}
If you're still encountering the error, it's possible that you're using an older version of Normcore that doesn't support the offlineMode property. In this case, you should consider updating to the latest version of Normcore. If you're already using the latest version, then it might be a good idea to reach out to NormalVR's support for further assistance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2mo ago
<@725231244169707600> kapa.ai is still learning and improving, please let us know how it did by reacting below
xulipa
xulipa2mo ago
@Normcore Assistant I'm using Normcore 2.9.5
kapa.ai
kapa.ai2mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- I'm sorry for the confusion, but based on the provided knowledge sources, there's no specific information about the offlineMode property in Normcore version 2.9.5. The knowledge sources do not provide a version history or specific details about this property in different versions of Normcore. If you're having trouble with the offlineMode property, it might be best to reach out to the Normcore community or support for more specific guidance. You can ask questions on their Discord (https://normcore.io/discord) or the forum (https://forum.normcore.io/). They might be able to provide more specific help based on the version you're using. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2mo ago
<@725231244169707600> kapa.ai is still learning and improving, please let us know how it did by reacting below
xulipa
xulipa2mo ago
Ohh needs to be 2.10