Removed one liner braces from transport files. (#544)

This commit is contained in:
rodolphito 2019-03-10 01:18:11 -08:00 committed by vis2k
parent 73edf5e732
commit 4aa1a4b169
2 changed files with 14 additions and 14 deletions

View File

@ -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()

View File

@ -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()