From 42badafe24acc15394ee29e5be071df546695af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Bessette?= Date: Wed, 25 Jun 2025 13:52:29 -0400 Subject: [PATCH] Fix exception in UnityTransport when DisconnectLocalClient was called The exception was the following: ArgumentOutOfRangeException thrown by HandleTransportDataEvent called by ReceiveMessages called by ProcessEvent called by ShutdownInternals called by DisconnectLocalClient() Since the exception arose when trying to handle data events while m_State is Disconnected, I removed the m_State = Disconnected from the DisconnectLocalClient() method. ShutdownInternals already sets the m_State variable to Disconnected after it's down handling events. --- Assets/FishNet/Plugins/FishyUnityTransport/UnityTransport.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Assets/FishNet/Plugins/FishyUnityTransport/UnityTransport.cs b/Assets/FishNet/Plugins/FishyUnityTransport/UnityTransport.cs index aa49b24..93a4c51 100755 --- a/Assets/FishNet/Plugins/FishyUnityTransport/UnityTransport.cs +++ b/Assets/FishNet/Plugins/FishyUnityTransport/UnityTransport.cs @@ -999,8 +999,6 @@ private void DisconnectLocalClient() if (m_Driver.Disconnect(ParseClientId(m_ServerClientId)) == 0) { - m_State = State.Disconnected; - m_ReliableReceiveQueues.Remove(m_ServerClientId); ClearSendQueuesForClientId(m_ServerClientId); @@ -2081,4 +2079,4 @@ private void ClientHostSendToServer(int channelId, ArraySegment payload) #endregion } -} \ No newline at end of file +}