refactor: Remove exceptions from Network Spawn Manager#3933
Draft
noellie-velez wants to merge 5 commits intodevelop-2.0.0from
Draft
refactor: Remove exceptions from Network Spawn Manager#3933noellie-velez wants to merge 5 commits intodevelop-2.0.0from
noellie-velez wants to merge 5 commits intodevelop-2.0.0from
Conversation
noellie-velez
commented
Apr 7, 2026
noellie-velez
commented
Apr 7, 2026
noellie-velez
commented
Apr 7, 2026
noellie-velez
commented
Apr 7, 2026
com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs
Outdated
Show resolved
Hide resolved
noellie-velez
commented
Apr 7, 2026
com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs
Outdated
Show resolved
Hide resolved
noellie-velez
commented
Apr 7, 2026
noellie-velez
commented
Apr 7, 2026
| if (NetworkManager.LogLevel <= LogLevel.Developer) | ||
| { | ||
| NetworkLog.LogInfo(builder.ToString()); | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
Revert this, keep the Debug.Log
noellie-velez
commented
Apr 7, 2026
| { | ||
| Debug.LogWarning( | ||
| "Object was shown and hidden from the same client in the same Network frame. As a result, the client will _not_ receive a NetworkSpawn"); | ||
| if (NetworkManager.LogLevel <= LogLevel.Developer) |
Collaborator
Author
There was a problem hiding this comment.
If logged already set the log level to normal
noellie-velez
commented
Apr 7, 2026
| if (NetworkManager.ShutdownInProgress) | ||
| { | ||
| Debug.LogWarning(InstantiateAndSpawnErrors[InstantiateAndSpawnErrorTypes.InvokedWhenShuttingDown]); | ||
| if (NetworkManager.LogLevel <= LogLevel.Developer) |
noellie-velez
commented
Apr 7, 2026
Comment on lines
+2092
to
+2095
| if (NetworkManager.LogLevel <= LogLevel.Developer) | ||
| { | ||
| NetworkLog.LogInfo($"[{objPerClient} of {totalObjectsToDistribute}][Client-{ownerList.Key}] Count: {ownerList.Value.Count} | ObjPerClient: {objPerClient} | maxD: {maxDistributeCount} | Offset: {offsetCount}"); | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
And everything that is in the EnableDistributeLogging check
noellie-velez
commented
Apr 7, 2026
| if (!child.IsOwnershipDistributable || !child.IsOwnershipTransferable) | ||
| { | ||
| NetworkLog.LogWarning($"Sibling {child.name} of root parent {ownerList.Value[i].name} is neither transferable or distributable! Object distribution skipped and could lead to a potentially un-owned or owner-mismatched {nameof(NetworkObject)}!"); | ||
| if (NetworkManager.LogLevel <= LogLevel.Developer) |
noellie-velez
commented
Apr 7, 2026
Comment on lines
+2129
to
+2132
| if (NetworkManager.LogLevel <= LogLevel.Developer) | ||
| { | ||
| NetworkLog.LogInfo($"[Client-{ownerList.Key}][NetworkObjectId-{ownerList.Value[i].NetworkObjectId} Distributed to Client-{clientId}"); | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
Revert - see the format
noellie-velez
commented
Apr 7, 2026
Comment on lines
+2343
to
+2355
| if (NetworkManager.LogLevel <= LogLevel.Error) | ||
| { | ||
| NetworkLog.LogError($"[Internal Error] {nameof(SynchronizeObjectsToNewlyJoinedClient)} should only be invoked when using a distributed authority network topology!"); | ||
| } | ||
| return; | ||
| } | ||
|
|
||
| if (NetworkManager.NetworkConfig.EnableSceneManagement) | ||
| { | ||
| Debug.LogError($"[Internal Error] {nameof(SynchronizeObjectsToNewlyJoinedClient)} should only be invoked when scene management is disabled!"); | ||
| if (NetworkManager.LogLevel <= LogLevel.Error) | ||
| { | ||
| NetworkLog.LogError($"[Internal Error] {nameof(SynchronizeObjectsToNewlyJoinedClient)} should only be invoked when scene management is disabled!"); | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
Revert because internal
noellie-velez
commented
Apr 7, 2026
Comment on lines
2295
to
+2308
| { | ||
| Debug.LogError($"[Internal Error] {nameof(ShowHiddenObjectsToNewlyJoinedClient)} should only be invoked when using a distributed authority network topology!"); | ||
| if (NetworkManager.LogLevel <= LogLevel.Error) | ||
| { | ||
| NetworkLog.LogError($"[Internal Error] {nameof(ShowHiddenObjectsToNewlyJoinedClient)} should only be invoked when using a distributed authority network topology!"); | ||
| } | ||
| return; | ||
| } | ||
|
|
||
| if (NetworkManager.LocalClient.IsSessionOwner) | ||
| { | ||
| Debug.LogError($"[Internal Error] {nameof(ShowHiddenObjectsToNewlyJoinedClient)} should only be invoked on a non-session owner client!"); | ||
| if (NetworkManager.LogLevel <= LogLevel.Error) | ||
| { | ||
| NetworkLog.LogError($"[Internal Error] {nameof(ShowHiddenObjectsToNewlyJoinedClient)} should only be invoked on a non-session owner client!"); | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
Revert because internal errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of this PR
Remove exceptions from Network Spawn Manager
Jira ticket
MTT-14791
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.
Backports