Skip to content

refactor: Remove exceptions from Network Spawn Manager#3932

Merged
noellie-velez merged 7 commits intorefactor/remove-exceptions-network-spawn-managerfrom
develop-2.0.0
Apr 7, 2026
Merged

refactor: Remove exceptions from Network Spawn Manager#3932
noellie-velez merged 7 commits intorefactor/remove-exceptions-network-spawn-managerfrom
develop-2.0.0

Conversation

@noellie-velez
Copy link
Copy Markdown
Collaborator

Purpose of this PR

Remove exceptions from Network Spawn Manager

Jira ticket

MTT-14791

Changelog

  • Changed: Replaced Exceptions and Debug.Log by NetworkLog logs

Documentation

  • No documentation changes or additions were necessary.

Testing & QA (How your changes can be verified during release Playtest)

Functional Testing

Manual testing :

  • Manual testing done

Automated tests:

  • Covered by existing automated tests
  • Covered by new automated tests

Does 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

noellie-velez and others added 7 commits March 26, 2026 13:07
* Converted `private m_LocalNetworkManage` r to `internal LocalNetworkManager` to use a cached Network Manager field instead of a property (optimization pass)

* Update changelog
* Use NetworkManager field instead of property when available

* Update changelog
* CI update

* Disabled ConnectSingleClient_Hostname for Android
)

* fix

Fixing exception that could be thrown in NetworkLog if there is no NetworkManager instance.
Adding additional check in NetworkObject.OnNetworkBehaviourDestroyed to assure nothing is ever logged about destroying a NetworkBehaviour when shutting down and the NetworkObject is still considered spawned.

* test

The test that validates the NetworkLog fix.

* update

Adding change log entry for this fix.
* Updates on internal CreateAndSpawnPlayer:
- Move out the `if DA` check from the function
- Early return 
- Add a LogWarning if no playerPrefab was fetched

---------

Co-authored-by: Emma <emma.mcmillan@unity3d.com>
* Use cached NetworkManager instead of a field to avoid lazy instantiation overhead and associated performance cost
* Remove un-needed extra local networkManager var layer to use global cached one
* Update changelog

---------

Co-authored-by: Unity Netcode CI <74025435+netcode-ci-service@users.noreply.github.com>
* Use cached `NetworkManager` instead of a field to avoid lazy instantiation overhead and improve performance
* Convert `RegisterForTickUpdate` to non-static since static context was unnecessary and prevented use of cached `NetworkManager`
* Cache `tickRate` to reduce repeated lookups
* Remove redundant local `NetworkManager` variable in `RegisterForTickUpdate` for consistency
* Add `networkObject.name` to `NetcodeTransformMessage`
* Update changelog

---------

Co-authored-by: Emma <emma.mcmillan@unity3d.com>
Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
@noellie-velez noellie-velez merged commit 0103c74 into refactor/remove-exceptions-network-spawn-manager Apr 7, 2026
215 of 241 checks passed
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.

3 participants