Skip to content

fix: distributed authority client synchronization issues #3350

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 Mar 16, 2025

This PR resolves two client synchronization related issues:

  • When using a distributed authority network topology the session owner can max-out the reliable in-flight messages allowed and start dropping packets when many clients attempt to connect simultaneously.
  • When scene management was disabled, any client attempting to spawn objects during the initial synchronization would not be allowed to due to the NetworkManager.IsConnectedClient not being set until after the client had finished synchronizing (i.e. all objects synchronized had run through the spawn process).

fix: #3280
close: #3280

Changelog

  • Fixed: Issue when using a distributed authority network topology and many clients attempt to connect simultaneously the session owner could max-out the maximum in-flight reliable messages allowed, start dropping packets, and some of the connecting clients would fail to fully synchronize.
  • Fixed: Issue when using a distributed authority network topology and scene management was disabled clients would not be able to spawn any new network prefab instances until synchronization was complete.

Testing and Documentation

  • No test has been added for session owner reaching maximum in-flight reliable messages (requires manual CCU stress test).
  • Includes the SpawnDuringSynchronizationTests integration test.
  • No documentation changes or additions were necessary.

fixing the issue when scene management is disabled a client cannot spawn objects during the synchronization process.
First pass POC of deferring synchronization when more than one client is wanting to be synchronized in a very small period of time.
Updating the fix with some additional checks to make sure the next client is still connected before attempting to synchronize.
When building the NetworkObject distribution table, don't add a NetworkObject to the table if the target client is not an observer.
Fixing the gammar of a comment
Adding a test to validate spawning a NetworkObject during OnNetworkSpawn, OnNetworkPostSpawn, and OnNetworkSessionSynchronized when using a distributed authority network topology.
Adding change log entries.
@NoelStephensUnity NoelStephensUnity marked this pull request as ready for review March 17, 2025 01:06
@NoelStephensUnity NoelStephensUnity requested a review from a team as a code owner March 17, 2025 01:06
Copy link
Collaborator

@EmandM EmandM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nitpicks on the comments, but this looks good!

@NoelStephensUnity NoelStephensUnity enabled auto-merge (squash) March 24, 2025 23:35
@NoelStephensUnity NoelStephensUnity merged commit d80340d into develop-2.0.0 Mar 25, 2025
27 checks passed
@NoelStephensUnity NoelStephensUnity deleted the fix/distributed-authority-client-synchronization-updates branch March 25, 2025 00:41
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