Repository navigation
Conversation
| // Should be incredibly rare | ||
| // If a promoted session owner's scene handle conflicts with an already registered server scene handle, | ||
| // ensure the already registered (and synchronized with other clients) scene handle wins. | ||
| if (ClientSceneHandleToServerSceneHandle.ContainsKey(loadedScene.handle)) |
There was a problem hiding this comment.
After promotion, CMB late joining still throws with server-to-client mapping 7 -> 3 and an unregistered, non-active local scene 7. Scene handles are only locally unique. ClientSceneHandleToServerSceneHandle lacks 7, so this check passes. UpdateServerClientSceneHandle(7, 7, ...) returns false because ServerSceneHandleToClientSceneHandle already contains 7. Initialization ignores that result. If validation accepts the scene, AddSceneToClientSynchronization indexes the missing reverse-map entry and throws. Preserve existing mappings. Assign the new scene a collision-free canonical handle. Check that registration succeeds.
🤖 Helpful? 👍/👎
There was a problem hiding this comment.
I tested this, it's working fine. I think this is a theoretical case rather than a real thing
| AssertOnTimeout("Session owner promotion failed!"); | ||
|
|
||
| // Connect a late-joining client to verify the new session owner handles the previously unregistered scene. | ||
| yield return CreateAndStartNewClient(); |
There was a problem hiding this comment.
This test can pass if a future change removes promotion-time scene registration and the late joiner never synchronizes EmptyScene. AddActiveSceneToClientSynchronization now warns and returns when the active scene has no mapping. EmptyScene contains no NetworkObject, and CreateAndStartNewClient checks connection and player clones rather than scene synchronization. Assert that the promoted owner registers the scene after promotion. Assert that the late joiner has a synchronized EmptyScene mapped to the promoted owner's canonical handle.
🤖 Helpful? 👍/👎
There was a problem hiding this comment.
This is a regression test for a bug where subsequent joins fail. I don't really care if the scene fails to synchronize, only that subsequent joiners can successfully join.
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## develop-3.x.x #4214 +/- ##
==============================================
Coverage 76.05% 76.05%
==============================================
Files 159 159
Lines 27344 27341 -3
==============================================
- Hits 20797 20795 -2
+ Misses 6547 6546 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes
|
There was a problem hiding this comment.
💡 Harness Review
The change centralizes loaded-scene registration on session owner promotion and adjusts active-scene synchronization for CMB. I examined startup and promotion ordering, scene tracking, service synchronization, and the regression test; no additional actionable issues emerged beyond those previously reported.
Reviewed commit 84d252d
🤖 Helpful? 👍/👎
Purpose of this PR
Currently, when a client starts the session as a DA session owner their NetworkSceneManger initializes all the existing loaded scenes so they can correctly synchronize incoming clients.
This PR ensures that clients promoted to session owner mid-session also initialize their existing loading scenes.
This fixes an error where an active scene that was loaded before the game started would break synchronization on late-joining clients after a new session owner was promoted.
Jira ticket
UUM-154485
Changelog
Documentation
Testing & QA (How your changes can be verified during release Playtest)
Functional Testing
Manual testing :
Manual testing doneAutomated tests:
Covered by existing automated testsCovered by new automated testsDoes the change require QA team to:
Review automated tests?Execute manual tests?Provide feedback about the PR?If any boxes above are checked the QA team will be automatically added as a PR reviewer.
Up-port
n/a
Backports
Was reported on 2.0.0 so probably needs a backport.