This commit is contained in:
vis2k 2021-03-07 14:51:10 +08:00
parent 306620d0d0
commit 0f8b06b12b

View File

@ -976,11 +976,10 @@ public static void SetAllClientsNotReady()
} }
} }
/// <summary> /// <summary>Marks the client of the connection to be not-ready.</summary>
/// Sets the client of the connection to be not-ready. // Clients that are not ready do not receive spawned objects or state
/// <para>Clients that are not ready do not receive spawned objects or state synchronization updates. They client can be made ready again by calling SetClientReady().</para> // synchronization updates. They client can be made ready again by
/// </summary> // calling SetClientReady().
/// <param name="conn">The connection of the client to make not ready.</param>
public static void SetClientNotReady(NetworkConnection conn) public static void SetClientNotReady(NetworkConnection conn)
{ {
if (conn.isReady) if (conn.isReady)
@ -993,22 +992,15 @@ public static void SetClientNotReady(NetworkConnection conn)
} }
} }
/// <summary> // default ready handler.
/// default ready handler.
/// </summary>
/// <param name="conn"></param>
/// <param name="msg"></param>
static void OnClientReadyMessage(NetworkConnection conn, ReadyMessage msg) static void OnClientReadyMessage(NetworkConnection conn, ReadyMessage msg)
{ {
// Debug.Log("Default handler for ready message from " + conn); // Debug.Log("Default handler for ready message from " + conn);
SetClientReady(conn); SetClientReady(conn);
} }
/// <summary> /// <summary>Removes the player object from the connection</summary>
/// Removes the player object from the connection // destroyServerObject: Indicates whether the server object should be destroyed
/// </summary>
/// <param name="conn">The connection of the client to remove from</param>
/// <param name="destroyServerObject">Indicates whether the server object should be destroyed</param>
public static void RemovePlayerForConnection(NetworkConnection conn, bool destroyServerObject) public static void RemovePlayerForConnection(NetworkConnection conn, bool destroyServerObject)
{ {
if (conn.identity != null) if (conn.identity != null)
@ -1020,10 +1012,7 @@ public static void RemovePlayerForConnection(NetworkConnection conn, bool destro
conn.identity = null; conn.identity = null;
} }
else //else Debug.Log($"Connection {conn} has no identity");
{
// Debug.Log($"Connection {conn} has no identity");
}
} }
/// <summary> /// <summary>