From 382b6c67f4cfcf7f941e220d9aaf7bd1789975e3 Mon Sep 17 00:00:00 2001 From: vis2k Date: Sun, 7 Mar 2021 13:06:26 +0800 Subject: [PATCH] cleanup --- Assets/Mirror/Runtime/NetworkServer.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Assets/Mirror/Runtime/NetworkServer.cs b/Assets/Mirror/Runtime/NetworkServer.cs index cab93bac3..7395dc884 100644 --- a/Assets/Mirror/Runtime/NetworkServer.cs +++ b/Assets/Mirror/Runtime/NetworkServer.cs @@ -320,10 +320,7 @@ public static void SendToReady(NetworkIdentity identity, T message, int chann SendToReady(identity, message, true, channelId); } - /// - /// Disconnect all currently connected clients, including the local connection. - /// This can only be called on the server. Clients will receive the Disconnect message. - /// + /// Disconnect all connections, including the local connection. public static void DisconnectAll() { DisconnectAllConnections(); @@ -331,10 +328,7 @@ public static void DisconnectAll() active = false; } - /// - /// Disconnect all currently connected clients except the local connection. - /// This can only be called on the server. Clients will receive the Disconnect message. - /// + /// Disconnect all currently connected clients except the local connection. public static void DisconnectAllConnections() { // disconnect and remove all connections. @@ -348,7 +342,7 @@ public static void DisconnectAllConnections() // until then, let's copy .Values to avoid InvalidOperatinException. // note that this is only called when stopping the server, so the // copy is no performance problem. - foreach (NetworkConnection conn in connections.Values.ToList()) + foreach (NetworkConnectionToClient conn in connections.Values.ToList()) { conn.Disconnect(); // call OnDisconnected unless local player in host mode