NetworkBehaviour: removed GetCmdHashHandlerName which was used by NetworkIdentity.HandleRemoteCall. This function made not much sense because if the function with that hash couldn't be invoked then the function's name won't be found to display for the error message anyway.

This commit is contained in:
vis2k 2018-12-30 20:23:06 +01:00
parent 4ae6d21418
commit bd0558924e
2 changed files with 2 additions and 14 deletions

View File

@ -259,16 +259,6 @@ internal bool InvokeHandlerDelegate(int cmdHash, UNetInvokeType invokeType, Netw
return false; return false;
} }
internal static string GetCmdHashHandlerName(int cmdHash)
{
Invoker invoker;
if (s_CmdHandlerDelegates.TryGetValue(cmdHash, out invoker))
{
return invoker.invokeType + ":" + invoker.invokeFunction.GetMethodName();
}
return cmdHash.ToString();
}
// ----------------------------- Helpers -------------------------------- // ----------------------------- Helpers --------------------------------
[EditorBrowsable(EditorBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)]

View File

@ -560,8 +560,7 @@ internal void HandleRemoteCall(int componentIndex, int functionHash, UNetInvokeT
{ {
if (gameObject == null) if (gameObject == null)
{ {
string functionName = NetworkBehaviour.GetCmdHashHandlerName(functionHash); Debug.LogWarning(invokeType + " [" + functionHash + "] received for deleted object [netId=" + netId + "]");
Debug.LogWarning(invokeType + " [" + functionName + "] received for deleted object [netId=" + netId + "]");
return; return;
} }
@ -571,8 +570,7 @@ internal void HandleRemoteCall(int componentIndex, int functionHash, UNetInvokeT
NetworkBehaviour invokeComponent = m_NetworkBehaviours[componentIndex]; NetworkBehaviour invokeComponent = m_NetworkBehaviours[componentIndex];
if (!invokeComponent.InvokeHandlerDelegate(functionHash, invokeType, reader)) if (!invokeComponent.InvokeHandlerDelegate(functionHash, invokeType, reader))
{ {
string functionName = NetworkBehaviour.GetCmdHashHandlerName(functionHash); Debug.LogError("Found no receiver for incoming " + invokeType + " [" + functionHash + "] on " + gameObject + ", the server and client should have the same NetworkBehaviour instances [netId=" + netId + "].");
Debug.LogError("Found no receiver for incoming [" + functionName + "] on " + gameObject + ", the server and client should have the same NetworkBehaviour instances [netId=" + netId + "].");
} }
} }
else else