chore: multi-scene worlds offline adapter#7206
Conversation
|
Windows and Mac build successful in Unity Cloud! You can find a link to the downloadable artifact below. Artifact size check
Comparing against: v0.126.0-alpha |
There was a problem hiding this comment.
Tested on Windows and Mac ✅
Test scenarios covered:
- Single player multi-scene world: no peers visible in other scenes ✓
- Chat doesn't connect on single player mode. Sometimes the other player appears on nearby list but I can't interact in nearby chat with him/her ✓
- After leaving a single player multi-scene world, peers visible correctly in other worlds and Genesis ✓
- Toggled world to multiplayer via Creator Hub, re-entered and peers are visible correctly ✓
- Repeated the single player → multiplayer toggle several times with consistent results ✓
Note: Hit an issue mid-testing where after changing the multiplayer setting in Creator Hub, the world became inaccessible in Explorer. Traced it back to a permissions feature in Creator Hub that wasn't yet migrated to the Explorer build. Once the permissions were removed, the issue didn't reproduce. Not blocking for this PR.
Windows:
7206-mac.mp4
Mac:
7206-windows.mp4
✅Smoke test performed:
- ✔️ Backpack and wearables in world
- ✔️ Emotes in world and in backpack
- ✔️ Teleport with map/coordinates/Jump In
- ✔️ Chat and multiplayer
- ✔️ Skybox
Code Review
SummaryThe core bug fix in Two issues found that require fixes: Issue 1 — Orphaned background loop on realm navigation from offline worldLocation: Problem: public static UniTask StopIfNotAsync(this IConnectiveRoom room) =>
room.CurrentState() is IConnectiveRoom.State.Running or IConnectiveRoom.State.Starting
? room.StopAsync()
: UniTask.CompletedTask;When navigating from an offline world to another realm:
Fix: protected void SetNoConnectionRequired()
{
attemptToConnectState.Set(AttemptToConnectState.NO_CONNECTION_REQUIRED);
// Don't set roomState to Stopped here — the loop is still running.
// StopAsync/StopIfNotAsync should stop the loop via CancellationToken.
}This would require Issue 2 —
|
Explorer/Assets/DCL/Multiplayer/Connections/Rooms/Connective/ConnectiveRoom.cs
Show resolved
Hide resolved
Explorer/Assets/DCL/Multiplayer/Connections/GateKeeper/Rooms/GateKeeperSceneRoom.cs
Show resolved
Hide resolved
…ateKeeperSceneRoom.cs Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Signed-off-by: Juan Ignacio Molteni <juanignaciomolteni@gmail.com>
Signed-off-by: Juan Ignacio Molteni <juanignaciomolteni@gmail.com>
|
@claude re-review |
There was a problem hiding this comment.
Both previously raised issues have been addressed:
Issue 1 (orphaned loop): Resolved. SetNoConnectionRequired() now only sets attemptToConnectState — it does not touch roomState. When offline, roomState stays at Starting (since TryConnectToRoomAsync never runs), so StopIfNotAsync correctly calls StopAsync() on realm navigation. No loop orphaning.
Issue 2 (redundant writes on every heartbeat): Resolved. The guard if (AttemptToConnectState is not AttemptToConnectState.NO_CONNECTION_REQUIRED) prevents repeated calls to SetNoConnectionRequired() after the first offline tick.
The ScenesAreFixed → SingleScene semantic fix is also correct: ScenesAreFixed is true for all world types (single and multi-scene alike), making the old code fail to isolate multi-scene single-player worlds. SingleScene properly distinguishes them.
There was a problem hiding this comment.
Both previously raised issues have been addressed.
Issue 1 (orphaned loop): Resolved. SetNoConnectionRequired() now only sets attemptToConnectState — it does not touch roomState. When offline, roomState stays at Starting (since TryConnectToRoomAsync never runs), so StopIfNotAsync correctly calls StopAsync() on realm navigation. No loop orphaning.
Issue 2 (redundant writes on every heartbeat): Resolved. The guard if (AttemptToConnectState is not AttemptToConnectState.NO_CONNECTION_REQUIRED) prevents repeated calls to SetNoConnectionRequired() after the first offline tick.
The ScenesAreFixed to SingleScene semantic fix is also correct: ScenesAreFixed is true for all world types (single and multi-scene alike), making the old code fail to isolate multi-scene single-player worlds. SingleScene properly distinguishes them.
Pull Request Description
What does this PR change?
GateKeeperSceneRoomlisten to the Realm adapter. If its offline, replicate the behaviourIsConnectedmethod inGateKeeperSceneRoom. Before this PR, it was return true in a world regardless if it was connected or not; probably sending messages to an unfullfilled conection toa. Livekit room and failling silentlyTest Instructions
Test Steps
Code Review Reference
Please review our Code Review Standards before submitting.