-
Notifications
You must be signed in to change notification settings - Fork 450
fix: OnNetworkDespawn not called during shutdown (#1390) #1460
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
Merged
andrews-unity
merged 14 commits into
release/1.0.0
from
backport/1.0.0-fix-OnNetworkDespawn-Not-Called-During-Shutdown
Nov 25, 2021
Merged
fix: OnNetworkDespawn not called during shutdown (#1390) #1460
andrews-unity
merged 14 commits into
release/1.0.0
from
backport/1.0.0-fix-OnNetworkDespawn-Not-Called-During-Shutdown
Nov 25, 2021
Conversation
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
* fix Renaming and refactoring DestroyNonSceneObjects to be DespawnNetworkObjects as this is really what it is doing. The destroy portion is either up to the handler, if an in-scene NetworkObject it lets the unloading of the scene destroy it, and the rest are always destroyed. * fix updates to the changes in NetworkSpawnManager * fix Adding a "ShutdownInProgress" flag to be able to easily check if we are shutting down. Adding a check for the NetworkManager.LocalClient since we are despawning in the shutdown method. Ignoring the de-parenting of NetworkObjects when shutting down (this will have to be discussed a bit). * fix Test fix: I think this was just an unexposed bug in the NetworkRigidBody2D test, but will verify this before making this final. Fixed some additional minor issues like checking for IsSpawned as opposed to NetworkManager.IsListening and IsSpawned as opposed to NetworkObject.IsSpawned. * fix Avoiding spam when despawning and shutting down. Renaming DespawnNetworkObjects to DespawnAndDestroyNetworkObjects. If a NetworkObject is not spawned it gets destroyed. * test fix Fixing issue with editor tests and the NetworkManager.Singleton instance. * fix Adjusting the logic a bit on getting the NetworkObject associated with a NetworkBehaviour. * revert and fix After discussing this with Luke, it turned out there was a bug in the NetworkRigidBody2D where it was resetting the isKinematic to true. This reverts the changes made to the NetworkRigidbody2DDynamicTest and fixes the bug with NetworkRigidBody2D. * test Tests that validate OnNetworkDespawn is invoked during shutdown. This tests server, host, and client relative instances. * update changelog update the changelog with the fixed information * fix fixing issue with test and recent changes for when the internal shutdown method is invoked. * refactor ShutdownInProgress now returns m_ShuttingDown. Setting m_ShuttingDown to false at the end of ShutdownInternal in case the NetworkManager is going to be re-used. * style line endings * Revert "style" This reverts commit e2ca11a. * fix fixing timing related issue for NetworkObjectOnNetworkDespawnTests.
0xFA11
approved these changes
Nov 24, 2021
…-Not-Called-During-Shutdown
…ed-During-Shutdown
…ed-During-Shutdown
…ed-During-Shutdown
…ed-During-Shutdown
…ed-During-Shutdown
…ed-During-Shutdown
…ed-During-Shutdown
…ed-During-Shutdown
…ed-During-Shutdown
…ed-During-Shutdown
…ed-During-Shutdown
…n-Not-Called-During-Shutdown'
mollstam
pushed a commit
to Keepsake-Games/com.unity.netcode.gameobjects
that referenced
this pull request
Feb 13, 2023
…1390) (Unity-Technologies#1460) * fix Renaming and refactoring DestroyNonSceneObjects to be DespawnNetworkObjects as this is really what it is doing. The destroy portion is either up to the handler, if an in-scene NetworkObject it lets the unloading of the scene destroy it, and the rest are always destroyed. * fix updates to the changes in NetworkSpawnManager * fix Adding a "ShutdownInProgress" flag to be able to easily check if we are shutting down. Adding a check for the NetworkManager.LocalClient since we are despawning in the shutdown method. Ignoring the de-parenting of NetworkObjects when shutting down (this will have to be discussed a bit). * fix Test fix: I think this was just an unexposed bug in the NetworkRigidBody2D test, but will verify this before making this final. Fixed some additional minor issues like checking for IsSpawned as opposed to NetworkManager.IsListening and IsSpawned as opposed to NetworkObject.IsSpawned. * fix Avoiding spam when despawning and shutting down. Renaming DespawnNetworkObjects to DespawnAndDestroyNetworkObjects. If a NetworkObject is not spawned it gets destroyed. * test fix Fixing issue with editor tests and the NetworkManager.Singleton instance. * fix Adjusting the logic a bit on getting the NetworkObject associated with a NetworkBehaviour. * revert and fix After discussing this with Luke, it turned out there was a bug in the NetworkRigidBody2D where it was resetting the isKinematic to true. This reverts the changes made to the NetworkRigidbody2DDynamicTest and fixes the bug with NetworkRigidBody2D. * test Tests that validate OnNetworkDespawn is invoked during shutdown. This tests server, host, and client relative instances. * update changelog update the changelog with the fixed information * fix fixing issue with test and recent changes for when the internal shutdown method is invoked. * refactor ShutdownInProgress now returns m_ShuttingDown. Setting m_ShuttingDown to false at the end of ShutdownInternal in case the NetworkManager is going to be re-used. * style line endings * Revert "style" This reverts commit e2ca11a. * fix fixing timing related issue for NetworkObjectOnNetworkDespawnTests. Co-authored-by: Noel Stephens <noel.stephens@unity3d.com> Co-authored-by: Unity Netcode CI <74025435+netcode-ci-service@users.noreply.github.com>
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.
Original PR: #1390