From d7ee25e58952480d496971efe777ec04b382cb6d Mon Sep 17 00:00:00 2001 From: vis2k Date: Sat, 13 Mar 2021 13:44:34 +0800 Subject: [PATCH] NetworkClient.HandleClientDisconnect: remove unnecessary connection parameter. it wasn't even used. --- Assets/Mirror/Runtime/LocalConnections.cs | 2 +- Assets/Mirror/Runtime/NetworkClient.cs | 8 +++++--- Assets/Mirror/Runtime/NetworkConnectionToServer.cs | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Assets/Mirror/Runtime/LocalConnections.cs b/Assets/Mirror/Runtime/LocalConnections.cs index 086d79654..4b63a48f6 100644 --- a/Assets/Mirror/Runtime/LocalConnections.cs +++ b/Assets/Mirror/Runtime/LocalConnections.cs @@ -109,7 +109,7 @@ internal void DisconnectInternal() // set not ready and handle clientscene disconnect in any case // (might be client or host mode here) isReady = false; - NetworkClient.HandleClientDisconnect(this); + NetworkClient.HandleClientDisconnect(); } /// Disconnects this connection. diff --git a/Assets/Mirror/Runtime/NetworkClient.cs b/Assets/Mirror/Runtime/NetworkClient.cs index 90d470393..41713493f 100644 --- a/Assets/Mirror/Runtime/NetworkClient.cs +++ b/Assets/Mirror/Runtime/NetworkClient.cs @@ -203,7 +203,7 @@ public static void ConnectLocalServer() public static void Disconnect() { connectState = ConnectState.Disconnected; - HandleClientDisconnect(connection); + HandleClientDisconnect(); // local or remote connection? if (isLocalClient) @@ -277,7 +277,7 @@ static void OnDisconnected() { connectState = ConnectState.Disconnected; - HandleClientDisconnect(connection); + HandleClientDisconnect(); if (connection != null) OnDisconnectedEvent?.Invoke(connection); } @@ -792,7 +792,9 @@ public static bool Ready() [Obsolete("NetworkClient.Ready doesn't need a NetworkConnection parameter anymore. It always uses NetworkClient.connection anyway.")] public static bool Ready(NetworkConnection conn) => Ready(); - internal static void HandleClientDisconnect(NetworkConnection conn) + // TODO just set ready=false directly. the name doesn't imply what this + // function does. + internal static void HandleClientDisconnect() { ready = false; } diff --git a/Assets/Mirror/Runtime/NetworkConnectionToServer.cs b/Assets/Mirror/Runtime/NetworkConnectionToServer.cs index 2bbf09a3c..4ec842167 100644 --- a/Assets/Mirror/Runtime/NetworkConnectionToServer.cs +++ b/Assets/Mirror/Runtime/NetworkConnectionToServer.cs @@ -23,7 +23,7 @@ public override void Disconnect() // set not ready and handle clientscene disconnect in any case // (might be client or host mode here) isReady = false; - NetworkClient.HandleClientDisconnect(this); + NetworkClient.HandleClientDisconnect(); Transport.activeTransport.ClientDisconnect(); } }