From ebcaf9a256d49ab9e148345eb05b1c3cc5856917 Mon Sep 17 00:00:00 2001 From: vis2k Date: Sun, 7 Mar 2021 14:39:50 +0800 Subject: [PATCH] cleanup --- Assets/Mirror/Runtime/NetworkServer.cs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Assets/Mirror/Runtime/NetworkServer.cs b/Assets/Mirror/Runtime/NetworkServer.cs index 6b7432c9d..37e04d8d9 100644 --- a/Assets/Mirror/Runtime/NetworkServer.cs +++ b/Assets/Mirror/Runtime/NetworkServer.cs @@ -681,10 +681,7 @@ public static void UnregisterHandler() } /// Clears all registered message handlers. - public static void ClearHandlers() - { - handlers.Clear(); - } + public static void ClearHandlers() => handlers.Clear(); /// Send this message to the player only [Obsolete("Use identity.connectionToClient.Send() instead! Previously Mirror needed this function internally, but not anymore.")] @@ -721,14 +718,13 @@ public static bool ReplacePlayerForConnection(NetworkConnection conn, GameObject return InternalReplacePlayerForConnection(conn, player, keepAuthority); } - /// - /// When an AddPlayer message handler has received a request from a player, the server calls this to associate the player object with the connection. - /// When a player is added for a connection, the client for that connection is made ready automatically. The player object is automatically spawned, so you do not need to call NetworkServer.Spawn for that object. This function is used for "adding" a player, not for "replacing" the player on a connection. If there is already a player on this playerControllerId for this connection, this will fail. - /// - /// Connection which is adding the player. - /// Player object spawned for the player. - /// - /// True if connection was successfully added for a connection. + /// Called by server after AddPlayer message to add the player for the connection. + // When a player is added for a connection, the client for that + // connection is made ready automatically. The player object is + // automatically spawned, so you do not need to call NetworkServer.Spawn + // for that object. This function is used for "adding" a player, not for + // "replacing" the player on a connection. If there is already a player + // on this playerControllerId for this connection, this will fail. public static bool AddPlayerForConnection(NetworkConnection conn, GameObject player, Guid assetId) { if (GetNetworkIdentity(player, out NetworkIdentity identity))