more sorting

This commit is contained in:
vis2k 2021-03-07 15:23:22 +08:00
parent 5a23cd056e
commit e4729c2608

View File

@ -220,6 +220,15 @@ internal static void RemoveLocalConnection()
RemoveConnection(0); RemoveConnection(0);
} }
/// <summary>True if we have no external connections (host is allowed)</summary>
public static bool NoExternalConnections()
{
return connections.Count == 0 ||
(connections.Count == 1 && localConnection != null);
}
[Obsolete("NoConnections was renamed to NoExternalConnections because that's what it checks for.")]
public static bool NoConnections() => NoExternalConnections();
// send //////////////////////////////////////////////////////////////// // send ////////////////////////////////////////////////////////////////
/// <summary>Send a message to all clients, even those that haven't joined the world yet (non ready)</summary> /// <summary>Send a message to all clients, even those that haven't joined the world yet (non ready)</summary>
public static void SendToAll<T>(T message, int channelId = Channels.DefaultReliable, bool sendToReadyOnly = false) public static void SendToAll<T>(T message, int channelId = Channels.DefaultReliable, bool sendToReadyOnly = false)
@ -524,15 +533,6 @@ public static void DisconnectAllConnections()
connections.Clear(); connections.Clear();
} }
/// <summary>True if we have no external connections (host is allowed)</summary>
public static bool NoExternalConnections()
{
return connections.Count == 0 ||
(connections.Count == 1 && localConnection != null);
}
[Obsolete("NoConnections was renamed to NoExternalConnections because that's what it checks for.")]
public static bool NoConnections() => NoExternalConnections();
// add/remove/replace player /////////////////////////////////////////// // add/remove/replace player ///////////////////////////////////////////
/// <summary>Called by server after AddPlayer message to add the player for the connection.</summary> /// <summary>Called by server after AddPlayer message to add the player for the connection.</summary>
// When a player is added for a connection, the client for that // When a player is added for a connection, the client for that