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 <chris@clevertech.net>
This commit is contained in:
uwee 2020-05-08 21:41:57 -04:00 committed by GitHub
parent ad782a59a7
commit 2108456021
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 11 deletions

View File

@ -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<NetworkManager>();
if (manager != null && manager.authenticator == null)
{

View File

@ -230,7 +230,7 @@ internal bool InvokeHandler(int msgType, NetworkReader reader, int channelId)
/// </summary>
/// <typeparam name="T">The message type to unregister.</typeparam>
/// <param name="msg">The message object to process.</param>
/// <returns></returns>
/// <returns>Returns true if the handler was successfully invoked</returns>
public bool InvokeHandler<T>(T msg, int channelId) where T : IMessageBase
{
// get writer from pool

View File

@ -334,7 +334,6 @@ void SetupServer()
/// <summary>
/// This starts a new server.
/// </summary>
/// <returns></returns>
public void StartServer()
{
mode = NetworkManagerMode.ServerOnly;

View File

@ -146,7 +146,6 @@ internal static void RegisterMessageHandlers()
/// Start the server, setting the maximum number of connections.
/// </summary>
/// <param name="maxConns">Maximum number of allowed connections</param>
/// <returns></returns>
public static void Listen(int maxConns)
{
Initialize();
@ -657,7 +656,7 @@ public static void SendToClientOfPlayer<T>(NetworkIdentity identity, T msg, int
/// <param name="player">Player object spawned for the player.</param>
/// <param name="assetId"></param>
/// <param name="keepAuthority">Does the previous player remain attached to this connection?</param>
/// <returns></returns>
/// <returns>True if connection was successfully replaced for player.</returns>
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
/// <param name="conn">Connection which is adding the player.</param>
/// <param name="player">Player object spawned for the player.</param>
/// <param name="keepAuthority">Does the previous player remain attached to this connection?</param>
/// <returns></returns>
/// <returns>True if connection was successfully replaced for player.</returns>
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
/// <param name="conn">Connection which is adding the player.</param>
/// <param name="player">Player object spawned for the player.</param>
/// <param name="assetId"></param>
/// <returns></returns>
/// <returns>True if connection was sucessfully added for a connection.</returns>
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)
/// </summary>
/// <param name="conn">Connection which is adding the player.</param>
/// <param name="player">Player object spawned for the player.</param>
/// <returns></returns>
/// <returns>True if connection was successfully added for a connection.</returns>
public static bool AddPlayerForConnection(NetworkConnection conn, GameObject player)
{
NetworkIdentity identity = player.GetComponent<NetworkIdentity>();
@ -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);
}
}