more sorting

This commit is contained in:
vis2k 2021-03-07 15:24:11 +08:00
parent e4729c2608
commit 330036f1a9

View File

@ -596,26 +596,6 @@ public static bool AddPlayerForConnection(NetworkConnection conn, GameObject pla
return AddPlayerForConnection(conn, player);
}
/// <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.
public static bool ReplacePlayerForConnection(NetworkConnection conn, GameObject player, Guid assetId, bool keepAuthority = false)
{
if (GetNetworkIdentity(player, out NetworkIdentity identity))
{
identity.assetId = assetId;
}
return InternalReplacePlayerForConnection(conn, player, keepAuthority);
}
internal static bool InternalReplacePlayerForConnection(NetworkConnection conn, GameObject player, bool keepAuthority)
{
NetworkIdentity identity = player.GetComponent<NetworkIdentity>();
@ -665,6 +645,26 @@ 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.
public static bool ReplacePlayerForConnection(NetworkConnection conn, GameObject player, Guid assetId, bool keepAuthority = false)
{
if (GetNetworkIdentity(player, out NetworkIdentity identity))
{
identity.assetId = assetId;
}
return InternalReplacePlayerForConnection(conn, player, keepAuthority);
}
// ready ///////////////////////////////////////////////////////////////
/// <summary>Flags client connection as ready (=joined world).</summary>
// When a client has signaled that it is ready, this method tells the