diff --git a/Assets/Mirror/Runtime/NetworkServer.cs b/Assets/Mirror/Runtime/NetworkServer.cs index 33d0b6deb..ce26dde6a 100644 --- a/Assets/Mirror/Runtime/NetworkServer.cs +++ b/Assets/Mirror/Runtime/NetworkServer.cs @@ -220,6 +220,15 @@ internal static void RemoveLocalConnection() RemoveConnection(0); } + /// True if we have no external connections (host is allowed) + 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 a message to all clients, even those that haven't joined the world yet (non ready) public static void SendToAll(T message, int channelId = Channels.DefaultReliable, bool sendToReadyOnly = false) @@ -524,15 +533,6 @@ public static void DisconnectAllConnections() connections.Clear(); } - /// True if we have no external connections (host is allowed) - 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 /////////////////////////////////////////// /// Called by server after AddPlayer message to add the player for the connection. // When a player is added for a connection, the client for that