refactor: remove pointless if

This commit is contained in:
Paul Pacheco 2019-04-06 06:51:37 -05:00
parent b202473bcf
commit e8679a0562

View File

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