NetworkConnection.InvokeHandler error messages are now shown if handler not found for msgType instead of failing silently

This commit is contained in:
vis2k 2018-07-19 20:28:29 +02:00
parent c01b48f582
commit 0e4f905a72

View File

@ -120,14 +120,10 @@ public bool InvokeHandler(short msgType, NetworkReader reader, int channelId)
m_MessageInfo.channelId = channelId;
NetworkMessageDelegate msgDelegate = m_MessageHandlersDict[msgType];
if (msgDelegate == null)
{
if (LogFilter.logError) { Debug.LogError("NetworkConnection InvokeHandler no handler for " + msgType); }
return false;
}
msgDelegate(m_MessageInfo);
return true;
}
if (LogFilter.logError) { Debug.LogError("NetworkConnection InvokeHandler no handler for " + msgType); }
return false;
}
@ -139,6 +135,7 @@ public bool InvokeHandler(NetworkMessage netMsg)
msgDelegate(netMsg);
return true;
}
if (LogFilter.logError) { Debug.LogError("NetworkConnection InvokeHandler no handler for " + netMsg.msgType); }
return false;
}