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
|
// unpack message
|
||||||
NetworkReader reader = new NetworkReader(buffer);
|
NetworkReader reader = new NetworkReader(buffer);
|
||||||
if (MessagePacker.UnpackMessage(reader, out int msgType))
|
MessagePacker.UnpackMessage(reader, out int msgType);
|
||||||
{
|
|
||||||
if (logNetworkMessages)
|
|
||||||
{
|
|
||||||
Debug.Log("ConnectionRecv con:" + connectionId + " msgType:" + msgType + " content:" + BitConverter.ToString(buffer));
|
|
||||||
}
|
|
||||||
|
|
||||||
// try to invoke the handler for that message
|
if (logNetworkMessages)
|
||||||
if (InvokeHandler(msgType, reader))
|
{
|
||||||
{
|
Debug.Log("ConnectionRecv con:" + connectionId + " msgType:" + msgType + " content:" + BitConverter.ToString(buffer));
|
||||||
lastMessageTime = Time.time;
|
}
|
||||||
}
|
|
||||||
|
// 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)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user