diff --git a/Assets/Mirror/Runtime/NetworkConnection.cs b/Assets/Mirror/Runtime/NetworkConnection.cs index 14604e52b..fbd46cee4 100644 --- a/Assets/Mirror/Runtime/NetworkConnection.cs +++ b/Assets/Mirror/Runtime/NetworkConnection.cs @@ -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) {