Skip to content

fix: OnNetworkDespawn is not called on server side when a client disconnects [MTT-5120] #2323

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

NoelStephensUnity
Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity commented Nov 22, 2022

This resolves the issue when a client player disconnects from a server and, on the server-side. if any NetworkBehaviour components preceded the NetworkObject component then those NetworkBehaviour components' OnNetworkDespawn method would not be invoked.

MTT-5120

Changelog

  • Fixed: Server side issue where, depending upon component ordering, some NetworkBehaviour components might not have their OnNetworkDespawn method invoked if the client side disconnected.

Testing and Documentation

  • Includes integration test: NetworkBehaviourGenericTests.OnNetworkDespawnInvokedWhenClientDisconnects
  • No documentation changes or additions were necessary.

This prevents the issue (when just destroying the GameObject) where any NetworkBehaviour component(s) destroyed before the NetworkObject would not have OnNetworkDespawn invoked.
adding comment
[MTT-5120]
Updating the changelog file.
[MTT-5120]
Adding the test to validate this fix.
@NoelStephensUnity NoelStephensUnity marked this pull request as ready for review November 23, 2022 18:17
@NoelStephensUnity NoelStephensUnity requested a review from a team as a code owner November 23, 2022 18:17
@NoelStephensUnity NoelStephensUnity enabled auto-merge (squash) December 2, 2022 17:57
@NoelStephensUnity NoelStephensUnity merged commit 101bf34 into develop Dec 2, 2022
@NoelStephensUnity NoelStephensUnity deleted the fix/onnetworkdespawn-not-invoked-component-order-issue-GH-2315 branch December 2, 2022 18:54
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.

2 participants