mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkServerTest: reuse CreateLocalConnectionPair
This commit is contained in:
parent
68c72a7d54
commit
bf7250c096
@ -762,9 +762,8 @@ public void HideForConnection()
|
||||
Assert.That(NetworkServer.connections.Count, Is.EqualTo(0));
|
||||
|
||||
// setup connections
|
||||
LocalConnectionToClient connectionToClient = new LocalConnectionToClient();
|
||||
LocalConnectionToServer connectionToServer = new LocalConnectionToServer();
|
||||
connectionToClient.connectionToServer = new LocalConnectionToServer();
|
||||
CreateLocalConnectionPair(out LocalConnectionToClient connectionToClient,
|
||||
out LocalConnectionToServer connectionToServer);
|
||||
|
||||
// setup NetworkServer/Client connections so messages are handled
|
||||
NetworkClient.connection = connectionToServer;
|
||||
@ -772,7 +771,6 @@ public void HideForConnection()
|
||||
|
||||
// required for ShowForConnection
|
||||
connectionToClient.isReady = true;
|
||||
connectionToClient.connectionToServer = new LocalConnectionToServer();
|
||||
|
||||
// set a client handler
|
||||
int called = 0;
|
||||
@ -946,10 +944,7 @@ public void NoExternalConnectionsTest_WithConnections()
|
||||
[Test]
|
||||
public void NoExternalConnectionsTest_WithHostOnly()
|
||||
{
|
||||
LocalConnectionToServer connectionToServer = new LocalConnectionToServer();
|
||||
LocalConnectionToClient connectionToClient = new LocalConnectionToClient();
|
||||
connectionToServer.connectionToClient = connectionToClient;
|
||||
connectionToClient.connectionToServer = connectionToServer;
|
||||
CreateLocalConnectionPair(out LocalConnectionToClient connectionToClient, out _);
|
||||
|
||||
NetworkServer.SetLocalConnection(connectionToClient);
|
||||
NetworkServer.connections.Add(0, connectionToClient);
|
||||
|
Loading…
Reference in New Issue
Block a user