diff --git a/Mirror/Runtime/NetworkBehaviour.cs b/Mirror/Runtime/NetworkBehaviour.cs index 69fad6237..91e58d47c 100644 --- a/Mirror/Runtime/NetworkBehaviour.cs +++ b/Mirror/Runtime/NetworkBehaviour.cs @@ -104,7 +104,7 @@ protected void SendCommandInternal(string cmdName, NetworkWriter writer, int cha [EditorBrowsable(EditorBrowsableState.Never)] public virtual bool InvokeCommand(int cmdHash, NetworkReader reader) { - return InvokeCommandDelegate(cmdHash, reader); + return InvokeHandlerDelegateOfType(cmdHash, UNetInvokeType.Command, reader); } // ----------------------------- Client RPCs -------------------------------- @@ -150,9 +150,9 @@ protected void SendTargetRPCInternal(NetworkConnection conn, string rpcName, Net } [EditorBrowsable(EditorBrowsableState.Never)] - public virtual bool InvokeRPC(int cmdHash, NetworkReader reader) + public virtual bool InvokeRPC(int rpcHash, NetworkReader reader) { - return InvokeRpcDelegate(cmdHash, reader); + return InvokeHandlerDelegateOfType(rpcHash, UNetInvokeType.ClientRpc, reader); } // ----------------------------- Sync Events -------------------------------- @@ -177,9 +177,9 @@ protected void SendEventInternal(string eventName, NetworkWriter writer, int cha } [EditorBrowsable(EditorBrowsableState.Never)] - public virtual bool InvokeSyncEvent(int cmdHash, NetworkReader reader) + public virtual bool InvokeSyncEvent(int eventHash, NetworkReader reader) { - return InvokeSyncEventDelegate(cmdHash, reader); + return InvokeHandlerDelegateOfType(eventHash, UNetInvokeType.SyncEvent, reader); } // ----------------------------- Code Gen Path Helpers -------------------------------- @@ -271,21 +271,6 @@ internal bool InvokeHandlerDelegateOfType(int cmdHash, UNetInvokeType invokeType return false; } - internal bool InvokeCommandDelegate(int cmdHash, NetworkReader reader) - { - return InvokeHandlerDelegateOfType(cmdHash, UNetInvokeType.Command, reader); - } - - internal bool InvokeRpcDelegate(int cmdHash, NetworkReader reader) - { - return InvokeHandlerDelegateOfType(cmdHash, UNetInvokeType.ClientRpc, reader); - } - - internal bool InvokeSyncEventDelegate(int cmdHash, NetworkReader reader) - { - return InvokeHandlerDelegateOfType(cmdHash, UNetInvokeType.SyncEvent, reader); - } - internal static string GetCmdHashHandlerName(int cmdHash) { if (!s_CmdHandlerDelegates.ContainsKey(cmdHash))