You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix
Just return from OnClientDisconnectFromServer when the server is shutting down as there is no point in doing ownership cleanup or client disconnected notification messages at that point.
* Fix
Approaching this fix a different way since we still should send out client disconnect notifications and such.
* fix
Server or host was not sending disconnect when it shutdown.
* update
When a client disconnects itself or is disconnected by the server, it now returns its client identifier.
Server or host shutdown sequence now includes a "soft shutdown" where the server-host will send out disconnection messages to all clients with the reason for the client being disconnected.
* update
the test project exit button script is now a bit more intelligent with how it handles exiting and now logs the reason for disconnection.
* fix - testproject
fixing exceptions when certain missing properties are not set (primarily buttons or toggles)
* test
updating tests for changes.
* fix
Don't allow a host or server to disconnect its local client.
* update
Adding changelog entries
* style
removing unused namespace.
* fix
Fixes issue with NetworkVariable and NetworkList throwing exceptions upon shutdown.
* Test
Validates that setting NetworkVariables or NetworkList values during OnNetworkDespawn does not throw an exception.
* update
adding change log entry
* style
fixing warning message about setting network variable/list values during a shutdown.
* test
Removing unrequired null check
* style
remove the cr/lf after some else if statments
* Minor formatting changes.
* update
Adjusting warning message language.
Adjusting when the send queue is processed.
* update
reverting back moving the MessageManager?.ProcessSendQueues(); within Shutdown and removing the migration of that out of OnClientDisconnectFromServer.
---------
Co-authored-by: Kitty Draper <[email protected]>
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/CHANGELOG.md
+9-1
Original file line number
Diff line number
Diff line change
@@ -21,14 +21,22 @@ Additional documentation and release notes are available at [Multiplayer Documen
21
21
22
22
### Fixed
23
23
24
+
- Fixed issue where a client disconnected by a server-host would not receive a local notification. (#2789)
25
+
- 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. (#2789)
26
+
- Fixed issue where a host could disconnect its local client but remain running as a server. (#2789)
27
+
- Fixed issue where `OnClientDisconnectedCallback` was not being invoked under certain conditions. (#2789)
28
+
- Fixed issue where `OnClientDisconnectedCallback` was always returning 0 as the client identifier. (#2789)
29
+
- Fixed issue where if a host or server shutdown while a client owned NetworkObjects (other than the player) it would throw an exception. (#2789)
30
+
- Fixed issue where setting values on a `NetworkVariable` or `NetworkList` within `OnNetworkDespawn` during a shutdown sequence would throw an exception. (#2789)
24
31
- Fixed issue where a teleport state could potentially be overridden by a previous unreliable delta state. (#2777)
25
32
- Fixed issue where `NetworkTransform` was using the `NetworkManager.ServerTime.Tick` as opposed to `NetworkManager.NetworkTickSystem.ServerTime.Tick` during the authoritative side's tick update where it performed a delta state check. (#2777)
26
33
- Fixed issue where a parented in-scene placed NetworkObject would be destroyed upon a client or server exiting a network session but not unloading the original scene in which the NetworkObject was placed. (#2737)
27
34
- Fixed issue where during client synchronization and scene loading, when client synchronization or the scene loading mode are set to `LoadSceneMode.Single`, a `CreateObjectMessage` could be received, processed, and the resultant spawned `NetworkObject` could be instantiated in the client's currently active scene that could, towards the end of the client synchronization or loading process, be unloaded and cause the newly created `NetworkObject` to be destroyed (and throw and exception). (#2735)
28
35
- Fixed issue where a `NetworkTransform` instance with interpolation enabled would result in wide visual motion gaps (stuttering) under above normal latency conditions and a 1-5% or higher packet are drop rate. (#2713)
29
36
30
37
### Changed
31
-
38
+
- 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. (#2789)
39
+
- 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. (#2789)
32
40
- Changed `NetworkTransform.SetState` (and related methods) now are cumulative during a fractional tick period and sent on the next pending tick. (#2777)
33
41
-`NetworkManager.ConnectedClientsIds` is now accessible on the client side and will contain the list of all clients in the session, including the host client if the server is operating in host mode (#2762)
34
42
- Changed `NetworkSceneManager` to return a `SceneEventProgress` status and not throw exceptions for methods invoked when scene management is disabled and when a client attempts to access a `NetworkSceneManager` method by a client. (#2735)
// When this happens, the client will not have an entry within the m_TransportIdToClientIdMap or m_ClientIdToTransportIdMap lookup tables so we exit early and just return 0 to be used for the disconnect event.
// Process the incoming message queue so that we get everything from the server disconnecting us or, if we are the server, so we got everything from that client.
else// As long as we are not in the middle of a shutdown
506
+
if(!NetworkManager.ShutdownInProgress)
500
507
{
501
-
// We must pass true here and not process any sends messages as we are no longer connected and thus there is no one to send any messages to and this will cause an exception within UnityTransport as the client ID is no longer valid.
508
+
// We must pass true here and not process any sends messages as we are no longer connected.
509
+
// Otherwise, attempting to process messages here can cause an exception within UnityTransport
// make sure all messages are flushed before disconnecting
1140
+
MessageManager?.ProcessSendQueues();
1141
+
1128
1142
// Client only, send disconnect and if transport throws and exception, log the exception and continue the shutdown sequence (or forever be shutting down)
// Ensures that the NetworkManager is cleaned up before OnDestroy is run on NetworkObjects and NetworkBehaviours when unloading a scene with a NetworkManager
0 commit comments