From 21084560219e35bcb6f8c895f30d427b3e58c7f1 Mon Sep 17 00:00:00 2001 From: uwee Date: Fri, 8 May 2020 21:41:57 -0400 Subject: [PATCH] Fix comments (#1860) * fix ref to NetMan in Authenticator * does not return * added basic description of return conditions * comment is 2 years old from HLAPI 2017.4 and no longer relevant * remove empty whitespace * Update Assets/Mirror/Runtime/NetworkConnection.cs * Update Assets/Mirror/Runtime/NetworkServer.cs * Update Assets/Mirror/Runtime/NetworkAuthenticator.cs * Update Assets/Mirror/Runtime/NetworkServer.cs * Update Assets/Mirror/Runtime/NetworkServer.cs Co-authored-by: MrGadget --- Assets/Mirror/Runtime/NetworkAuthenticator.cs | 2 +- Assets/Mirror/Runtime/NetworkConnection.cs | 2 +- Assets/Mirror/Runtime/NetworkManager.cs | 1 - Assets/Mirror/Runtime/NetworkServer.cs | 12 ++++-------- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Assets/Mirror/Runtime/NetworkAuthenticator.cs b/Assets/Mirror/Runtime/NetworkAuthenticator.cs index e944dde8d..f35d7feda 100644 --- a/Assets/Mirror/Runtime/NetworkAuthenticator.cs +++ b/Assets/Mirror/Runtime/NetworkAuthenticator.cs @@ -76,7 +76,7 @@ internal void OnClientAuthenticateInternal(NetworkConnection conn) void OnValidate() { #if UNITY_EDITOR - // automatically assign NetworkManager field if we add this to NetworkManager + // automatically assign authenticator field if we add this to NetworkManager NetworkManager manager = GetComponent(); if (manager != null && manager.authenticator == null) { diff --git a/Assets/Mirror/Runtime/NetworkConnection.cs b/Assets/Mirror/Runtime/NetworkConnection.cs index 0f4f36084..daf0fb462 100644 --- a/Assets/Mirror/Runtime/NetworkConnection.cs +++ b/Assets/Mirror/Runtime/NetworkConnection.cs @@ -230,7 +230,7 @@ internal bool InvokeHandler(int msgType, NetworkReader reader, int channelId) /// /// The message type to unregister. /// The message object to process. - /// + /// Returns true if the handler was successfully invoked public bool InvokeHandler(T msg, int channelId) where T : IMessageBase { // get writer from pool diff --git a/Assets/Mirror/Runtime/NetworkManager.cs b/Assets/Mirror/Runtime/NetworkManager.cs index fd4f9ca88..2a9001a73 100644 --- a/Assets/Mirror/Runtime/NetworkManager.cs +++ b/Assets/Mirror/Runtime/NetworkManager.cs @@ -334,7 +334,6 @@ void SetupServer() /// /// This starts a new server. /// - /// public void StartServer() { mode = NetworkManagerMode.ServerOnly; diff --git a/Assets/Mirror/Runtime/NetworkServer.cs b/Assets/Mirror/Runtime/NetworkServer.cs index 808409f75..5a446d12b 100644 --- a/Assets/Mirror/Runtime/NetworkServer.cs +++ b/Assets/Mirror/Runtime/NetworkServer.cs @@ -146,7 +146,6 @@ internal static void RegisterMessageHandlers() /// Start the server, setting the maximum number of connections. /// /// Maximum number of allowed connections - /// public static void Listen(int maxConns) { Initialize(); @@ -657,7 +656,7 @@ public static void SendToClientOfPlayer(NetworkIdentity identity, T msg, int /// Player object spawned for the player. /// /// Does the previous player remain attached to this connection? - /// + /// True if connection was successfully replaced for player. public static bool ReplacePlayerForConnection(NetworkConnection conn, GameObject player, Guid assetId, bool keepAuthority = false) { if (GetNetworkIdentity(player, out NetworkIdentity identity)) @@ -674,7 +673,7 @@ public static bool ReplacePlayerForConnection(NetworkConnection conn, GameObject /// Connection which is adding the player. /// Player object spawned for the player. /// Does the previous player remain attached to this connection? - /// + /// True if connection was successfully replaced for player. public static bool ReplacePlayerForConnection(NetworkConnection conn, GameObject player, bool keepAuthority = false) { return InternalReplacePlayerForConnection(conn, player, keepAuthority); @@ -687,7 +686,7 @@ public static bool ReplacePlayerForConnection(NetworkConnection conn, GameObject /// Connection which is adding the player. /// Player object spawned for the player. /// - /// + /// True if connection was sucessfully added for a connection. public static bool AddPlayerForConnection(NetworkConnection conn, GameObject player, Guid assetId) { if (GetNetworkIdentity(player, out NetworkIdentity identity)) @@ -740,7 +739,7 @@ static void SpawnObserversForConnection(NetworkConnection conn) /// /// Connection which is adding the player. /// Player object spawned for the player. - /// + /// True if connection was successfully added for a connection. public static bool AddPlayerForConnection(NetworkConnection conn, GameObject player) { NetworkIdentity identity = player.GetComponent(); @@ -819,8 +818,6 @@ internal static bool InternalReplacePlayerForConnection(NetworkConnection conn, // Set the connection on the NetworkIdentity on the server, NetworkIdentity.SetLocalPlayer is not called on the server (it is on clients) identity.SetClientOwner(conn); - //NOTE: DONT set connection ready. - // special case, we are in host mode, set hasAuthority to true so that all overrides see it if (conn is ULocalConnectionToClient) { @@ -1043,7 +1040,6 @@ internal static void SendSpawnMessage(NetworkIdentity identity, NetworkConnectio payload = payload, }; - conn.Send(msg); } }