From bf6957c15034bbd10908f7957dc4612f3e637f1a Mon Sep 17 00:00:00 2001 From: vis2k Date: Tue, 15 Jun 2021 16:44:31 +0800 Subject: [PATCH] NetworkServerTest: RemoveLocalConnection reuses CreateLocalConnectionPair --- Assets/Mirror/Tests/Editor/NetworkServerTest.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs index df575271a..20007c646 100644 --- a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs +++ b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs @@ -241,11 +241,8 @@ public void RemoveLocalConnection() NetworkServer.Listen(1); // set local connection - // local connection needs a server connection because - // RemoveLocalConnection calls localConnection.Disconnect - LocalConnectionToClient localConnection = new LocalConnectionToClient(); - localConnection.connectionToServer = new LocalConnectionToServer(); - NetworkServer.SetLocalConnection(localConnection); + CreateLocalConnectionPair(out LocalConnectionToClient connectionToClient, out _); + NetworkServer.SetLocalConnection(connectionToClient); // remove local connection NetworkServer.RemoveLocalConnection();