mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Display message name in ConnectionRecv log (#141)
This commit is contained in:
parent
413d7cf474
commit
8ce2489df0
@ -205,7 +205,19 @@ protected void HandleBytes(byte[] buffer)
|
||||
byte[] content;
|
||||
if (Protocol.UnpackMessage(buffer, out msgType, out content))
|
||||
{
|
||||
if (logNetworkMessages) { Debug.Log("ConnectionRecv con:" + connectionId + " msgType:" + msgType + " content:" + BitConverter.ToString(content)); }
|
||||
if (logNetworkMessages)
|
||||
{
|
||||
if (Enum.IsDefined(typeof(MsgType), msgType))
|
||||
{
|
||||
// one of Mirror mesage types, display the message name
|
||||
Debug.Log("ConnectionRecv con:" + connectionId + " msgType:" + (MsgType)msgType + " content:" + BitConverter.ToString(content));
|
||||
}
|
||||
else
|
||||
{
|
||||
// user defined message, display the number
|
||||
Debug.Log("ConnectionRecv con:" + connectionId + " msgType:" + msgType + " content:" + BitConverter.ToString(content));
|
||||
}
|
||||
}
|
||||
|
||||
NetworkMessageDelegate msgDelegate;
|
||||
if (m_MessageHandlers.TryGetValue((short)msgType, out msgDelegate))
|
||||
|
Loading…
Reference in New Issue
Block a user