Skip to content

fix: NetworksSenemanager order of operations and scene migration preprocess #2532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

NoelStephensUnity
Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity commented Apr 26, 2023

This resolves two issues:
Moving the client-side logic to first mirror the server's current active scene prior to spawning and synchronizing NetworkObjects during the initial client synchronization.

Pre-processing NetworkObject scene migration table to assure all NetworkObjects are still spawned, removing those that are no longer spawned (i.e. despawned in the same frame), and if no NetworkObjects remain for each scene handle entry not sending a scene migration notification.

Changelog

  • Changed: connecting clients being synchronized now switch to the server's active scene before spawning and synchronizing NetworkObjects.
  • Fixed: issue where a server would include scene migrated and then de-spawned NetworkObjects to a client that was being synchronized.

Testing and Documentation

  • Includes integration test update to NetworkObjectSceneMigrationTests.MigrateIntoNewSceneTest.
  • No documentation changes or additions were necessary.

NoelStephensUnity and others added 8 commits April 26, 2023 17:57
Change the order of operations where clients match the server's currently active scene and then spawn and synchronize NetworkObjects locally on the server.

Preprocess the scenes containing NetworkObjects to send scene migration notifications for in the event the NetworkObjects were despawned in the same frame.
Change the logic to detect if setting the synchronization mode is occurring when clients are already connected so that it is checking against whether it is a host vs server.
fixing white space issues.
Added test to verify that late joining clients synchronize properly when a NetworkObject is migrated into a new scene and then despawn and destroyed during a late joining client's initial synchronization.
Updating changelog
@NoelStephensUnity NoelStephensUnity marked this pull request as ready for review May 10, 2023 16:14
@NoelStephensUnity NoelStephensUnity requested a review from a team as a code owner May 10, 2023 16:14
@NoelStephensUnity NoelStephensUnity merged commit cd50a00 into develop May 18, 2023
@NoelStephensUnity NoelStephensUnity deleted the fix/networkscenemanager-additive-mode-order-of-operations branch May 18, 2023 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants