Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.
MIT License
2.09k
stars
430
forks
source link
fix: shutdown and shutdown notification issues [MTT-7791] [MTT-7540] #2789
Fixed: Issue where a client disconnected by a server-host would not receive a local notification.
Fixed: Issue where a server-host could shutdown during a relay connection but periodically the transport disconnect message sent to any connected clients could be dropped.
Fixed: Issue where a host could disconnect its local client but remain running as a server.
Fixed: Issue where OnClientDisconnectedCallback was not being invoked under certain conditions.
Fixed: Issue where OnClientDisconnectedCallback was always returning 0 as the client identifier.
Fixed: Issue where if a host or server shutdown while a client owned NetworkObjects (other than the player) it would throw an exception.
Fixed: Issue where setting values on a NetworkVariable or NetworkList within OnNetworkDespawn during a shutdown sequence would throw an exception.
Changed: The server or host shutdown so it will now perform a "soft shutdown" when NetworkManager.Shutdown is invoked. This will send a disconnect notification to all connected clients and the server-host will wait for all connected clients to disconnect or timeout after a 5 second period before completing the shutdown process.
Changed: OnClientDisconnectedCallback will now return the assigned client identifier on the local client side if the client was approved and assigned one prior to being disconnected.
This PR includes several fixes to the NetworkManager shutdown sequence where:
MTT-7791 MTT-7540
fix: #2759 fix: #2705 fix: #2699 fix: #2389 fix: #2064 fix: #1880
Changelog
OnClientDisconnectedCallback
was not being invoked under certain conditions.OnClientDisconnectedCallback
was always returning 0 as the client identifier.NetworkVariable
orNetworkList
withinOnNetworkDespawn
during a shutdown sequence would throw an exception.NetworkManager.Shutdown
is invoked. This will send a disconnect notification to all connected clients and the server-host will wait for all connected clients to disconnect or timeout after a 5 second period before completing the shutdown process.OnClientDisconnectedCallback
will now return the assigned client identifier on the local client side if the client was approved and assigned one prior to being disconnected.Testing and Documentation