-
Notifications
You must be signed in to change notification settings - Fork 450
fix: inscene networkobjects get destroyed upon client networkmanager shutting down without connecting #1809
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
Discovered that I needed to create a bit more of a unique test for this fix. Reverting all changes to NetworkManagerTests and created new SceneObjectsNotDestroyedOnShutdownTest.
…-destroyed-upon-networkmanager-shuttingdown-without-connecting
…-destroyed-upon-networkmanager-shuttingdown-without-connecting
…-destroyed-upon-networkmanager-shuttingdown-without-connecting
a5b759a
to
65d47a2
Compare
…d-upon-networkmanager-shuttingdown-without-connecting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there might be a cleaner way than to rely on "IsSceneObject"'s nullness.
@@ -740,7 +740,7 @@ internal void DespawnAndDestroyNetworkObjects() | |||
|
|||
OnDespawnObject(networkObjects[i], shouldDestroy); | |||
} | |||
else | |||
else if (networkObjects[i].IsSceneObject != null && !networkObjects[i].IsSceneObject.Value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth a comment for clarity of
"IsSceneObject will be null if I've never connected, or will be true (and stay true) if I've connected and am (and always will be) a scene object."
Hi, I've encountered the same issue using NGO 1.8.1 with a nearly blank project. I notice that there was a change related to this section 6 months ago in commit 7ab9947. Could you please check it out? |
Any NetworkObjects living in a scene (or even DDOL) will get destroyed if during a client connection attempt, it fails or it gets cancelled.
NCCBUG-119
Changelog
com.unity.netcode.gameobjects
Testing and Documentation