DisconnectAllConnections was renamed to DisconnectAllExternalConnections because that's what it does.

This commit is contained in:
vis2k 2021-03-07 15:29:20 +08:00
parent 207501de4e
commit f54f9c3599
2 changed files with 6 additions and 3 deletions

View File

@ -504,13 +504,13 @@ internal static bool GetNetworkIdentity(GameObject go, out NetworkIdentity ident
/// <summary>Disconnect all connections, including the local connection.</summary> /// <summary>Disconnect all connections, including the local connection.</summary>
public static void DisconnectAll() public static void DisconnectAll()
{ {
DisconnectAllConnections(); DisconnectAllExternalConnections();
localConnection = null; localConnection = null;
active = false; active = false;
} }
/// <summary>Disconnect all currently connected clients except the local connection.</summary> /// <summary>Disconnect all currently connected clients except the local connection.</summary>
public static void DisconnectAllConnections() public static void DisconnectAllExternalConnections()
{ {
// disconnect and remove all connections. // disconnect and remove all connections.
// we can not use foreach here because if // we can not use foreach here because if
@ -533,6 +533,9 @@ public static void DisconnectAllConnections()
connections.Clear(); connections.Clear();
} }
[Obsolete("DisconnectAllConnections was renamed to DisconnectAllExternalConnections because that's what it does.")]
public static void DisconnectAllConnections() => DisconnectAllExternalConnections();
// 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

View File

@ -364,7 +364,7 @@ public void DisconnectAllConnectionsTest()
Assert.That(NetworkServer.connections.Count, Is.EqualTo(1)); Assert.That(NetworkServer.connections.Count, Is.EqualTo(1));
// disconnect all connections // disconnect all connections
NetworkServer.DisconnectAllConnections(); NetworkServer.DisconnectAllExternalConnections();
Assert.That(NetworkServer.connections.Count, Is.EqualTo(0)); Assert.That(NetworkServer.connections.Count, Is.EqualTo(0));
} }