mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
refactor: remove pointless if
This commit is contained in:
parent
b202473bcf
commit
e8679a0562
@ -242,20 +242,18 @@ public virtual void TransportReceive(byte[] buffer)
|
||||
{
|
||||
// unpack message
|
||||
NetworkReader reader = new NetworkReader(buffer);
|
||||
if (MessagePacker.UnpackMessage(reader, out int msgType))
|
||||
{
|
||||
if (logNetworkMessages)
|
||||
{
|
||||
Debug.Log("ConnectionRecv con:" + connectionId + " msgType:" + msgType + " content:" + BitConverter.ToString(buffer));
|
||||
}
|
||||
MessagePacker.UnpackMessage(reader, out int msgType);
|
||||
|
||||
// try to invoke the handler for that message
|
||||
if (InvokeHandler(msgType, reader))
|
||||
{
|
||||
lastMessageTime = Time.time;
|
||||
}
|
||||
if (logNetworkMessages)
|
||||
{
|
||||
Debug.Log("ConnectionRecv con:" + connectionId + " msgType:" + msgType + " content:" + BitConverter.ToString(buffer));
|
||||
}
|
||||
|
||||
// try to invoke the handler for that message
|
||||
if (InvokeHandler(msgType, reader))
|
||||
{
|
||||
lastMessageTime = Time.time;
|
||||
}
|
||||
else Debug.LogError("HandleBytes UnpackMessage failed for: " + BitConverter.ToString(buffer));
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user