Skip to content

fix: search NetSyncManager in all loaded scenes#363

Merged
from2001 merged 2 commits intodevelopfrom
fix/search-netsync-manager-in-all-loaded-scenes
Mar 8, 2026
Merged

fix: search NetSyncManager in all loaded scenes#363
from2001 merged 2 commits intodevelopfrom
fix/search-netsync-manager-in-all-loaded-scenes

Conversation

@hacha
Copy link
Collaborator

@hacha hacha commented Mar 7, 2026

Summary

  • GetDefaultServerDiscoveryPort() previously only searched the active scene. Now it falls back to searching other loaded scenes if NetSyncManager is not found in the active scene.
  • The active scene is still searched first to maintain existing priority behavior.

Test plan

  • Load multiple scenes with NetSyncManager only in a non-active scene, run the server start menu, and verify the correct port is retrieved
  • Verify existing behavior is unchanged when NetSyncManager is in the active scene

🤖 Generated with Claude Code

When multiple scenes are loaded, GetDefaultServerDiscoveryPort() now
searches all loaded scenes for NetSyncManager if it's not found in
the active scene.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the editor-side server startup flow to correctly derive the default server discovery port even when NetSyncManager exists in a non-active (but loaded) Unity scene, while preserving the active-scene-first priority.

Changes:

  • Extend GetDefaultServerDiscoveryPort() to search all loaded scenes if the active scene doesn’t contain a NetSyncManager.
  • Keep the active scene as the highest-priority search target.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI commented Mar 8, 2026

@from2001 I've opened a new pull request, #364, to work on those changes. Once the pull request is ready, I'll request review from you.

…#364)

* Initial plan

* refactor: simplify GetDefaultServerDiscoveryPort scene search loop

Co-authored-by: from2001 <387880+from2001@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: from2001 <387880+from2001@users.noreply.github.com>
@from2001 from2001 merged commit dbd4e3a into develop Mar 8, 2026
@from2001 from2001 deleted the fix/search-netsync-manager-in-all-loaded-scenes branch March 8, 2026 13:23
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.

4 participants