From 4aa1a4b1692eada6a8196f790c1b55a7dd8e5e69 Mon Sep 17 00:00:00 2001 From: rodolphito Date: Sun, 10 Mar 2019 01:18:11 -0800 Subject: [PATCH] Removed one liner braces from transport files. (#544) --- .../Runtime/Transport/TelepathyTransport.cs | 20 +++++++++---------- .../Transport/Websocket/WebsocketTransport.cs | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Assets/Mirror/Runtime/Transport/TelepathyTransport.cs b/Assets/Mirror/Runtime/Transport/TelepathyTransport.cs index f873765cc..a945430bd 100644 --- a/Assets/Mirror/Runtime/Transport/TelepathyTransport.cs +++ b/Assets/Mirror/Runtime/Transport/TelepathyTransport.cs @@ -33,9 +33,9 @@ void Awake() } // client - public override bool ClientConnected() { return client.Connected; } - public override void ClientConnect(string address) { client.Connect(address, port); } - public override bool ClientSend(int channelId, byte[] data) { return client.Send(data); } + public override bool ClientConnected() => client.Connected; + public override void ClientConnect(string address) => client.Connect(address, port); + public override bool ClientSend(int channelId, byte[] data) => client.Send(data); bool ProcessClientMessage() { @@ -62,7 +62,7 @@ bool ProcessClientMessage() } return false; } - public override void ClientDisconnect() { client.Disconnect(); } + public override void ClientDisconnect() => client.Disconnect(); // IMPORTANT: set script execution order to >1000 to call Transport's // LateUpdate after all others. Fixes race condition where @@ -79,9 +79,9 @@ public void LateUpdate() } // server - public override bool ServerActive() { return server.Active; } - public override void ServerStart() { server.Start(port); } - public override bool ServerSend(int connectionId, int channelId, byte[] data) { return server.Send(connectionId, data); } + public override bool ServerActive() => server.Active; + public override void ServerStart() => server.Start(port); + public override bool ServerSend(int connectionId, int channelId, byte[] data) => server.Send(connectionId, data); public bool ProcessServerMessage() { if (server.GetNextMessage(out Telepathy.Message message)) @@ -106,9 +106,9 @@ public bool ProcessServerMessage() } return false; } - public override bool ServerDisconnect(int connectionId) { return server.Disconnect(connectionId); } - public override string ServerGetClientAddress(int connectionId) { return server.GetClientAddress(connectionId); } - public override void ServerStop() { server.Stop(); } + public override bool ServerDisconnect(int connectionId) => server.Disconnect(connectionId); + public override string ServerGetClientAddress(int connectionId) => server.GetClientAddress(connectionId); + public override void ServerStop() => server.Stop(); // common public override void Shutdown() diff --git a/Assets/Mirror/Runtime/Transport/Websocket/WebsocketTransport.cs b/Assets/Mirror/Runtime/Transport/Websocket/WebsocketTransport.cs index 51a6428a6..de007f82a 100644 --- a/Assets/Mirror/Runtime/Transport/Websocket/WebsocketTransport.cs +++ b/Assets/Mirror/Runtime/Transport/Websocket/WebsocketTransport.cs @@ -53,7 +53,7 @@ public override bool Available() } // client - public override bool ClientConnected() { return client.IsConnected; } + public override bool ClientConnected() => client.IsConnected; public override void ClientConnect(string host) { @@ -69,10 +69,10 @@ public override void ClientConnect(string host) public override bool ClientSend(int channelId, byte[] data) { client.Send(data); return true; } - public override void ClientDisconnect() { client.Disconnect(); } + public override void ClientDisconnect() => client.Disconnect(); // server - public override bool ServerActive() { return server.Active; } + public override bool ServerActive() => server.Active; public override void ServerStart() { @@ -106,7 +106,7 @@ public override string ServerGetClientAddress(int connectionId) { return server.GetClientAddress(connectionId); } - public override void ServerStop() { server.Stop(); } + public override void ServerStop() => server.Stop(); // common public override void Shutdown()