mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Simplify conditionals
This commit is contained in:
parent
9a542e98cc
commit
e2577ef785
@ -52,7 +52,7 @@ public void ClientDisconnect()
|
||||
// server
|
||||
public bool ServerActive()
|
||||
{
|
||||
return server != null ? server.ServerActive() : false;
|
||||
return server != null && server.ServerActive();
|
||||
}
|
||||
|
||||
public void ServerStart(string address, int port, int maxConnections)
|
||||
@ -83,7 +83,7 @@ public void ServerStartWebsockets(string address, int port, int maxConnections)
|
||||
|
||||
public bool ServerSend(int connectionId, byte[] data)
|
||||
{
|
||||
return server != null ? server.ServerSend(connectionId, data) : false;
|
||||
return server != null && server.ServerSend(connectionId, data);
|
||||
}
|
||||
|
||||
public bool ServerGetNextMessage(out int connectionId, out TransportEvent transportEvent, out byte[] data)
|
||||
@ -91,18 +91,18 @@ public bool ServerGetNextMessage(out int connectionId, out TransportEvent transp
|
||||
connectionId = -1;
|
||||
transportEvent = TransportEvent.Disconnected;
|
||||
data = null;
|
||||
return server != null ? server.ServerGetNextMessage(out connectionId, out transportEvent, out data) : false;
|
||||
return server != null && server.ServerGetNextMessage(out connectionId, out transportEvent, out data);
|
||||
}
|
||||
|
||||
public bool ServerDisconnect(int connectionId)
|
||||
{
|
||||
return server != null ? server.ServerDisconnect(connectionId) : false;
|
||||
return server != null && server.ServerDisconnect(connectionId);
|
||||
}
|
||||
|
||||
public bool GetConnectionInfo(int connectionId, out string address)
|
||||
{
|
||||
address = null;
|
||||
return server != null ? server.GetConnectionInfo(connectionId, out address) : false;
|
||||
return server != null && server.GetConnectionInfo(connectionId, out address);
|
||||
}
|
||||
|
||||
public void ServerStop()
|
||||
|
Loading…
Reference in New Issue
Block a user