NetworkBehaviour: removed unnecessary GetInvokerForHashCommand/ClientRpc/SyncEvent wrapper functions

This commit is contained in:
vis2k 2018-12-30 18:20:43 +01:00
parent 4c2fdc51bf
commit d1b0d78bde
2 changed files with 4 additions and 20 deletions

View File

@ -259,7 +259,7 @@ static bool GetInvokerForHash(int cmdHash, UNetInvokeType invokeType, out Invoke
return false;
}
static bool GetInvokerFunctionForHash(int cmdHash, UNetInvokeType invokeType, out CmdDelegate invokeFunction)
internal static bool GetInvokerFunctionForHash(int cmdHash, UNetInvokeType invokeType, out CmdDelegate invokeFunction)
{
Invoker invoker;
if (GetInvokerForHash(cmdHash, invokeType, out invoker))
@ -271,22 +271,6 @@ static bool GetInvokerFunctionForHash(int cmdHash, UNetInvokeType invokeType, ou
return false;
}
// wrapper fucntions for each type of network operation
internal static bool GetInvokerForHashCommand(int cmdHash, out CmdDelegate invokeFunction)
{
return GetInvokerFunctionForHash(cmdHash, UNetInvokeType.Command, out invokeFunction);
}
internal static bool GetInvokerForHashClientRpc(int cmdHash, out CmdDelegate invokeFunction)
{
return GetInvokerFunctionForHash(cmdHash, UNetInvokeType.ClientRpc, out invokeFunction);
}
internal static bool GetInvokerForHashSyncEvent(int cmdHash, out CmdDelegate invokeFunction)
{
return GetInvokerFunctionForHash(cmdHash, UNetInvokeType.SyncEvent, out invokeFunction);
}
// InvokeCmd/Rpc/SyncEventDelegate can all use the same function here
internal bool InvokeHandlerDelegateOfType(int cmdHash, UNetInvokeType invokeType, NetworkReader reader)
{

View File

@ -570,7 +570,7 @@ internal void HandleSyncEvent(int componentIndex, int cmdHash, NetworkReader rea
// find the matching SyncEvent function and networkBehaviour class
NetworkBehaviour.CmdDelegate invokeFunction;
bool invokeFound = NetworkBehaviour.GetInvokerForHashSyncEvent(cmdHash, out invokeFunction);
bool invokeFound = NetworkBehaviour.GetInvokerFunctionForHash(cmdHash, UNetInvokeType.SyncEvent, out invokeFunction);
if (!invokeFound)
{
// We don't get a valid lookup of the command name when it doesn't exist...
@ -605,7 +605,7 @@ internal void HandleCommand(int componentIndex, int cmdHash, NetworkReader reade
// find the matching Command function and networkBehaviour class
NetworkBehaviour.CmdDelegate invokeFunction;
bool invokeFound = NetworkBehaviour.GetInvokerForHashCommand(cmdHash, out invokeFunction);
bool invokeFound = NetworkBehaviour.GetInvokerFunctionForHash(cmdHash, UNetInvokeType.Command, out invokeFunction);
if (!invokeFound)
{
// We don't get a valid lookup of the command name when it doesn't exist...
@ -640,7 +640,7 @@ internal void HandleRPC(int componentIndex, int cmdHash, NetworkReader reader)
// find the matching ClientRpc function and networkBehaviour class
NetworkBehaviour.CmdDelegate invokeFunction;
bool invokeFound = NetworkBehaviour.GetInvokerForHashClientRpc(cmdHash, out invokeFunction);
bool invokeFound = NetworkBehaviour.GetInvokerFunctionForHash(cmdHash, UNetInvokeType.ClientRpc, out invokeFunction);
if (!invokeFound)
{
// We don't get a valid lookup of the command name when it doesn't exist...