diff --git a/Assets/Mirror/Runtime/Transport/Telepathy/Server.cs b/Assets/Mirror/Runtime/Transport/Telepathy/Server.cs index 181209422..085215ac1 100644 --- a/Assets/Mirror/Runtime/Transport/Telepathy/Server.cs +++ b/Assets/Mirror/Runtime/Transport/Telepathy/Server.cs @@ -226,7 +226,7 @@ public void Stop() TcpClient client = kvp.Value.client; // close the stream if not closed yet. it may have been closed // by a disconnect already, so use try/catch - try { client.GetStream().Close(); } catch {} + try { client.GetStream().Close(); } catch { } client.Close(); } diff --git a/Assets/Mirror/Tests/Common/MemoryTransport.cs b/Assets/Mirror/Tests/Common/MemoryTransport.cs index d1d9fc422..d59dc9575 100644 --- a/Assets/Mirror/Tests/Common/MemoryTransport.cs +++ b/Assets/Mirror/Tests/Common/MemoryTransport.cs @@ -30,7 +30,7 @@ public Message(int connectionId, EventType eventType, byte[] data) public override bool Available() => true; public override int GetMaxPacketSize(int channelId) => int.MaxValue; - public override void Shutdown() {} + public override void Shutdown() { } public override bool ClientConnected() => clientConnected; public override void ClientConnect(string address) { diff --git a/Assets/Mirror/Tests/Editor/NetworkBehaviourTests.cs b/Assets/Mirror/Tests/Editor/NetworkBehaviourTests.cs index ca34e9972..e24f33794 100644 --- a/Assets/Mirror/Tests/Editor/NetworkBehaviourTests.cs +++ b/Assets/Mirror/Tests/Editor/NetworkBehaviourTests.cs @@ -112,8 +112,8 @@ public void CallSendEventInternal() // we need to inherit from networkbehaviour to test protected functions public class NetworkBehaviourDelegateComponent : NetworkBehaviour { - public static void Delegate(NetworkBehaviour comp, NetworkReader reader) {} - public static void Delegate2(NetworkBehaviour comp, NetworkReader reader) {} + public static void Delegate(NetworkBehaviour comp, NetworkReader reader) { } + public static void Delegate2(NetworkBehaviour comp, NetworkReader reader) { } } // we need to inherit from networkbehaviour to test protected functions @@ -324,10 +324,10 @@ public void SendCommandInternal() // we need to start a server and connect a client in order to be // able to send commands // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); NetworkServer.Listen(1); Assert.That(NetworkServer.active, Is.True); @@ -336,12 +336,14 @@ public void SendCommandInternal() Assert.That(comp.called, Is.EqualTo(0)); // create a connection from client to server and from server to client - ULocalConnectionToClient connection = new ULocalConnectionToClient { + ULocalConnectionToClient connection = new ULocalConnectionToClient + { isReady = true, // commands require authentication isAuthenticated = true }; - connection.connectionToServer = new ULocalConnectionToServer { + connection.connectionToServer = new ULocalConnectionToServer + { isReady = true, // commands require authentication isAuthenticated = true @@ -456,10 +458,10 @@ public void SendRPCInternal() // we need to start a server and connect a client in order to be // able to send commands // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); NetworkServer.Listen(1); Assert.That(NetworkServer.active, Is.True); @@ -541,10 +543,10 @@ public void SendTargetRPCInternal() // we need to start a server and connect a client in order to be // able to send commands // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); NetworkServer.Listen(1); Assert.That(NetworkServer.active, Is.True); @@ -655,10 +657,10 @@ public void SendEventInternal() // we need to start a server and connect a client in order to be // able to send events // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); NetworkServer.Listen(1); Assert.That(NetworkServer.active, Is.True); @@ -1464,7 +1466,7 @@ public void GetSyncVarNetworkIdentityOnClientNull() [Test] public void ClearAllDirtyBitsClearsSyncVarDirtyBits() { - // set syncinterval so dirtybit works fine + // set syncinterval so dirtybit works fine emptyBehaviour.syncInterval = 0; Assert.That(emptyBehaviour.IsDirty(), Is.False); diff --git a/Assets/Mirror/Tests/Editor/NetworkClientTests.cs b/Assets/Mirror/Tests/Editor/NetworkClientTests.cs index a06deec7b..38df86b25 100644 --- a/Assets/Mirror/Tests/Editor/NetworkClientTests.cs +++ b/Assets/Mirror/Tests/Editor/NetworkClientTests.cs @@ -6,7 +6,7 @@ using NUnit.Framework; using UnityEngine; -namespace Mirror.Tests +namespace Mirror.Tests { public class NetworkClientTests { @@ -21,13 +21,13 @@ public void SetUp() Transport.activeTransport = transportGO.AddComponent(); // we need a server to connect to - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); NetworkServer.Listen(10); // setup client handlers too - NetworkClient.RegisterHandler(msg => {}, false); + NetworkClient.RegisterHandler(msg => { }, false); } [TearDown] diff --git a/Assets/Mirror/Tests/Editor/NetworkManagerTest.cs b/Assets/Mirror/Tests/Editor/NetworkManagerTest.cs index b898b2a3b..ffe4175f3 100644 --- a/Assets/Mirror/Tests/Editor/NetworkManagerTest.cs +++ b/Assets/Mirror/Tests/Editor/NetworkManagerTest.cs @@ -46,13 +46,13 @@ public void VariableTest() [Test] public void StartServerTest() { - Assert.That(NetworkServer.active , Is.False); + Assert.That(NetworkServer.active, Is.False); manager.StartServer(); - Assert.That(manager.isNetworkActive , Is.True); + Assert.That(manager.isNetworkActive, Is.True); Assert.That(manager.mode == NetworkManagerMode.ServerOnly); - Assert.That(NetworkServer.active , Is.True); + Assert.That(NetworkServer.active, Is.True); } [Test] @@ -61,7 +61,7 @@ public void StopServerTest() manager.StartServer(); manager.StopServer(); - Assert.That(manager.isNetworkActive , Is.False); + Assert.That(manager.isNetworkActive, Is.False); Assert.That(manager.mode == NetworkManagerMode.Offline); } @@ -70,7 +70,7 @@ public void StartClientTest() { manager.StartClient(); - Assert.That(manager.isNetworkActive , Is.True); + Assert.That(manager.isNetworkActive, Is.True); Assert.That(manager.mode == NetworkManagerMode.ClientOnly); manager.StopClient(); @@ -82,7 +82,7 @@ public void StopClientTest() manager.StartClient(); manager.StopClient(); - Assert.That(manager.isNetworkActive , Is.False); + Assert.That(manager.isNetworkActive, Is.False); Assert.That(manager.mode == NetworkManagerMode.Offline); } @@ -92,19 +92,19 @@ public void ShutdownTest() manager.StartClient(); NetworkManager.Shutdown(); - Assert.That(NetworkManager.startPositions.Count , Is.Zero); - Assert.That(NetworkManager.startPositionIndex , Is.Zero); - Assert.That(NetworkManager.startPositionIndex , Is.Zero); - Assert.That(NetworkManager.singleton , Is.Null); + Assert.That(NetworkManager.startPositions.Count, Is.Zero); + Assert.That(NetworkManager.startPositionIndex, Is.Zero); + Assert.That(NetworkManager.startPositionIndex, Is.Zero); + Assert.That(NetworkManager.singleton, Is.Null); } [Test] public void RegisterStartPositionTest() { - Assert.That(NetworkManager.startPositions.Count , Is.Zero); + Assert.That(NetworkManager.startPositions.Count, Is.Zero); NetworkManager.RegisterStartPosition(gameObject.transform); - Assert.That(NetworkManager.startPositions.Count , Is.EqualTo(1)); + Assert.That(NetworkManager.startPositions.Count, Is.EqualTo(1)); Assert.That(NetworkManager.startPositions, Has.Member(gameObject.transform)); NetworkManager.UnRegisterStartPosition(gameObject.transform); @@ -113,23 +113,23 @@ public void RegisterStartPositionTest() [Test] public void UnRegisterStartPositionTest() { - Assert.That(NetworkManager.startPositions.Count , Is.Zero); + Assert.That(NetworkManager.startPositions.Count, Is.Zero); NetworkManager.RegisterStartPosition(gameObject.transform); - Assert.That(NetworkManager.startPositions.Count , Is.EqualTo(1)); + Assert.That(NetworkManager.startPositions.Count, Is.EqualTo(1)); Assert.That(NetworkManager.startPositions, Has.Member(gameObject.transform)); NetworkManager.UnRegisterStartPosition(gameObject.transform); - Assert.That(NetworkManager.startPositions.Count , Is.Zero); + Assert.That(NetworkManager.startPositions.Count, Is.Zero); } [Test] public void GetStartPositionTest() { - Assert.That(NetworkManager.startPositions.Count , Is.Zero); + Assert.That(NetworkManager.startPositions.Count, Is.Zero); NetworkManager.RegisterStartPosition(gameObject.transform); - Assert.That(NetworkManager.startPositions.Count , Is.EqualTo(1)); + Assert.That(NetworkManager.startPositions.Count, Is.EqualTo(1)); Assert.That(NetworkManager.startPositions, Has.Member(gameObject.transform)); Assert.That(manager.GetStartPosition(), Is.SameAs(gameObject.transform)); diff --git a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs index a8386da16..2f9abbb7e 100644 --- a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs +++ b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs @@ -89,9 +89,9 @@ public void IsActiveTest() public void MaxConnectionsTest() { // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // listen with maxconnections=1 NetworkServer.Listen(1); @@ -115,8 +115,8 @@ public void ConnectMessageHandlerTest() // message handlers bool connectCalled = false; NetworkServer.RegisterHandler((conn, msg) => { connectCalled = true; }, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // listen NetworkServer.Listen(1); @@ -135,9 +135,9 @@ public void DisconnectMessageHandlerTest() { // message handlers bool disconnectCalled = false; - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); NetworkServer.RegisterHandler((conn, msg) => { disconnectCalled = true; }, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // listen NetworkServer.Listen(1); @@ -159,9 +159,9 @@ public void DisconnectMessageHandlerTest() public void ConnectionsDictTest() { // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // listen NetworkServer.Listen(2); @@ -198,9 +198,9 @@ public void OnConnectedOnlyAllowsGreaterZeroConnectionIdsTest() // <0 is never used // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // listen NetworkServer.Listen(2); @@ -225,9 +225,9 @@ public void OnConnectedOnlyAllowsGreaterZeroConnectionIdsTest() public void ConnectDuplicateConnectionIdsTest() { // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // listen NetworkServer.Listen(2); @@ -312,9 +312,9 @@ public void LocalClientActiveTest() public void AddConnectionTest() { // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // listen NetworkServer.Listen(1); @@ -356,9 +356,9 @@ public void AddConnectionTest() public void RemoveConnectionTest() { // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // listen NetworkServer.Listen(1); @@ -385,9 +385,9 @@ public void RemoveConnectionTest() public void DisconnectAllConnectionsTest() { // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // listen NetworkServer.Listen(1); @@ -410,9 +410,9 @@ public void DisconnectAllConnectionsTest() public void DisconnectAllTest() { // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // listen NetworkServer.Listen(1); @@ -441,15 +441,16 @@ public void DisconnectAllTest() public void OnDataReceivedTest() { // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // add one custom message handler bool wasReceived = false; NetworkConnection connectionReceived = null; TestMessage messageReceived = new TestMessage(); - NetworkServer.RegisterHandler((conn, msg) => { + NetworkServer.RegisterHandler((conn, msg) => + { wasReceived = true; connectionReceived = conn; messageReceived = msg; @@ -465,7 +466,7 @@ public void OnDataReceivedTest() Assert.That(NetworkServer.connections.Count, Is.EqualTo(1)); // serialize a test message into an arraysegment - TestMessage testMessage = new TestMessage{IntValue = 13, DoubleValue = 14, StringValue = "15"}; + TestMessage testMessage = new TestMessage { IntValue = 13, DoubleValue = 14, StringValue = "15" }; NetworkWriter writer = new NetworkWriter(); MessagePacker.Pack(testMessage, writer); ArraySegment segment = writer.ToArraySegment(); @@ -489,15 +490,16 @@ public void OnDataReceivedTest() public void OnDataReceivedInvalidConnectionIdTest() { // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // add one custom message handler bool wasReceived = false; NetworkConnection connectionReceived = null; TestMessage messageReceived = new TestMessage(); - NetworkServer.RegisterHandler((conn, msg) => { + NetworkServer.RegisterHandler((conn, msg) => + { wasReceived = true; connectionReceived = conn; messageReceived = msg; @@ -508,7 +510,7 @@ public void OnDataReceivedInvalidConnectionIdTest() Assert.That(NetworkServer.connections.Count, Is.EqualTo(0)); // serialize a test message into an arraysegment - TestMessage testMessage = new TestMessage{IntValue = 13, DoubleValue = 14, StringValue = "15"}; + TestMessage testMessage = new TestMessage { IntValue = 13, DoubleValue = 14, StringValue = "15" }; NetworkWriter writer = new NetworkWriter(); MessagePacker.Pack(testMessage, writer); ArraySegment segment = writer.ToArraySegment(); @@ -632,7 +634,8 @@ public void CommandMessageCallsCommandTest() NetworkIdentity.spawned[identity.netId] = identity; // serialize a removeplayer message into an arraysegment - CommandMessage message = new CommandMessage { + CommandMessage message = new CommandMessage + { componentIndex = 0, functionHash = NetworkBehaviour.GetMethodHash(typeof(CommandTestNetworkBehaviour), nameof(CommandTestNetworkBehaviour.CommandGenerated)), netId = identity.netId, @@ -734,9 +737,9 @@ public void ActivateHostSceneCallsOnStartClient() public void SendToAllTest() { // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // listen NetworkServer.Listen(1); @@ -747,14 +750,14 @@ public void SendToAllTest() connection.connectionToServer = new ULocalConnectionToServer(); // set a client handler int called = 0; - connection.connectionToServer.SetHandlers(new Dictionary() + connection.connectionToServer.SetHandlers(new Dictionary() { { MessagePacker.GetId(), ((conn, reader, channelId) => ++called) } }); NetworkServer.AddConnection(connection); // create a message - TestMessage message = new TestMessage{ IntValue = 1, DoubleValue = 2, StringValue = "3" }; + TestMessage message = new TestMessage { IntValue = 1, DoubleValue = 2, StringValue = "3" }; // send it to all bool result = NetworkServer.SendToAll(message); @@ -774,9 +777,9 @@ public void SendToAllTest() public void RegisterUnregisterClearHandlerTest() { // message handlers that are needed for the test - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // RegisterHandler(conn, msg) variant @@ -822,7 +825,7 @@ public void RegisterUnregisterClearHandlerTest() // unregister second handler via ClearHandlers to test that one too. send, should fail NetworkServer.ClearHandlers(); // (only add this one to avoid disconnect error) - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); writer = new NetworkWriter(); MessagePacker.Pack(new TestMessage(), writer); // log error messages are expected @@ -840,9 +843,9 @@ public void RegisterUnregisterClearHandlerTest() public void SendToClientOfPlayer() { // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // listen NetworkServer.Listen(1); @@ -853,14 +856,14 @@ public void SendToClientOfPlayer() connection.connectionToServer = new ULocalConnectionToServer(); // set a client handler int called = 0; - connection.connectionToServer.SetHandlers(new Dictionary() + connection.connectionToServer.SetHandlers(new Dictionary() { { MessagePacker.GetId(), ((conn, reader, channelId) => ++called) } }); NetworkServer.AddConnection(connection); // create a message - TestMessage message = new TestMessage{ IntValue = 1, DoubleValue = 2, StringValue = "3" }; + TestMessage message = new TestMessage { IntValue = 1, DoubleValue = 2, StringValue = "3" }; // create a gameobject and networkidentity NetworkIdentity identity = new GameObject().AddComponent(); @@ -914,9 +917,9 @@ public void GetNetworkIdentity() public void ShowForConnection() { // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // listen NetworkServer.Listen(1); @@ -929,7 +932,7 @@ public void ShowForConnection() connection.connectionToServer = new ULocalConnectionToServer(); // set a client handler int called = 0; - connection.connectionToServer.SetHandlers(new Dictionary() + connection.connectionToServer.SetHandlers(new Dictionary() { { MessagePacker.GetId(), ((conn, reader, channelId) => ++called) } }); @@ -966,9 +969,9 @@ public void ShowForConnection() public void HideForConnection() { // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // listen NetworkServer.Listen(1); @@ -981,7 +984,7 @@ public void HideForConnection() connection.connectionToServer = new ULocalConnectionToServer(); // set a client handler int called = 0; - connection.connectionToServer.SetHandlers(new Dictionary() + connection.connectionToServer.SetHandlers(new Dictionary() { { MessagePacker.GetId(), ((conn, reader, channelId) => ++called) } }); @@ -1102,9 +1105,9 @@ public void UnSpawn() public void ShutdownCleanupTest() { // message handlers - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); - NetworkServer.RegisterHandler((conn, msg) => {}, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); + NetworkServer.RegisterHandler((conn, msg) => { }, false); // listen NetworkServer.Listen(1);