NetworkServer.InternalReplacePlayerForConnection moved into ReplacePlayerForConnection

This commit is contained in:
vis2k 2021-03-07 15:25:50 +08:00
parent 330036f1a9
commit 207501de4e

View File

@ -596,7 +596,10 @@ public static bool AddPlayerForConnection(NetworkConnection conn, GameObject pla
return AddPlayerForConnection(conn, player);
}
internal static bool InternalReplacePlayerForConnection(NetworkConnection conn, GameObject player, bool keepAuthority)
/// <summary>Replaces connection's player object. The old object is not destroyed.</summary>
// This does NOT change the ready state of the connection, so it can
// safely be used while changing scenes.
public static bool ReplacePlayerForConnection(NetworkConnection conn, GameObject player, bool keepAuthority = false)
{
NetworkIdentity identity = player.GetComponent<NetworkIdentity>();
if (identity == null)
@ -645,14 +648,6 @@ internal static bool InternalReplacePlayerForConnection(NetworkConnection conn,
return true;
}
/// <summary>Replaces connection's player object. The old object is not destroyed.</summary>
// This does NOT change the ready state of the connection, so it can
// safely be used while changing scenes.
public static bool ReplacePlayerForConnection(NetworkConnection conn, GameObject player, bool keepAuthority = false)
{
return InternalReplacePlayerForConnection(conn, player, keepAuthority);
}
/// <summary>Replaces connection's player object. The old object is not destroyed.</summary>
// This does NOT change the ready state of the connection, so it can
// safely be used while changing scenes.
@ -662,7 +657,7 @@ public static bool ReplacePlayerForConnection(NetworkConnection conn, GameObject
{
identity.assetId = assetId;
}
return InternalReplacePlayerForConnection(conn, player, keepAuthority);
return ReplacePlayerForConnection(conn, player, keepAuthority);
}
// ready ///////////////////////////////////////////////////////////////