mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkBehaviour: removed unnecessary GetInvokerForHashCommand/ClientRpc/SyncEvent wrapper functions
This commit is contained in:
parent
4c2fdc51bf
commit
d1b0d78bde
@ -259,7 +259,7 @@ static bool GetInvokerForHash(int cmdHash, UNetInvokeType invokeType, out Invoke
|
|||||||
return false;
|
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;
|
Invoker invoker;
|
||||||
if (GetInvokerForHash(cmdHash, invokeType, out invoker))
|
if (GetInvokerForHash(cmdHash, invokeType, out invoker))
|
||||||
@ -271,22 +271,6 @@ static bool GetInvokerFunctionForHash(int cmdHash, UNetInvokeType invokeType, ou
|
|||||||
return false;
|
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
|
// InvokeCmd/Rpc/SyncEventDelegate can all use the same function here
|
||||||
internal bool InvokeHandlerDelegateOfType(int cmdHash, UNetInvokeType invokeType, NetworkReader reader)
|
internal bool InvokeHandlerDelegateOfType(int cmdHash, UNetInvokeType invokeType, NetworkReader reader)
|
||||||
{
|
{
|
||||||
|
@ -570,7 +570,7 @@ internal void HandleSyncEvent(int componentIndex, int cmdHash, NetworkReader rea
|
|||||||
|
|
||||||
// find the matching SyncEvent function and networkBehaviour class
|
// find the matching SyncEvent function and networkBehaviour class
|
||||||
NetworkBehaviour.CmdDelegate invokeFunction;
|
NetworkBehaviour.CmdDelegate invokeFunction;
|
||||||
bool invokeFound = NetworkBehaviour.GetInvokerForHashSyncEvent(cmdHash, out invokeFunction);
|
bool invokeFound = NetworkBehaviour.GetInvokerFunctionForHash(cmdHash, UNetInvokeType.SyncEvent, out invokeFunction);
|
||||||
if (!invokeFound)
|
if (!invokeFound)
|
||||||
{
|
{
|
||||||
// We don't get a valid lookup of the command name when it doesn't exist...
|
// 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
|
// find the matching Command function and networkBehaviour class
|
||||||
NetworkBehaviour.CmdDelegate invokeFunction;
|
NetworkBehaviour.CmdDelegate invokeFunction;
|
||||||
bool invokeFound = NetworkBehaviour.GetInvokerForHashCommand(cmdHash, out invokeFunction);
|
bool invokeFound = NetworkBehaviour.GetInvokerFunctionForHash(cmdHash, UNetInvokeType.Command, out invokeFunction);
|
||||||
if (!invokeFound)
|
if (!invokeFound)
|
||||||
{
|
{
|
||||||
// We don't get a valid lookup of the command name when it doesn't exist...
|
// 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
|
// find the matching ClientRpc function and networkBehaviour class
|
||||||
NetworkBehaviour.CmdDelegate invokeFunction;
|
NetworkBehaviour.CmdDelegate invokeFunction;
|
||||||
bool invokeFound = NetworkBehaviour.GetInvokerForHashClientRpc(cmdHash, out invokeFunction);
|
bool invokeFound = NetworkBehaviour.GetInvokerFunctionForHash(cmdHash, UNetInvokeType.ClientRpc, out invokeFunction);
|
||||||
if (!invokeFound)
|
if (!invokeFound)
|
||||||
{
|
{
|
||||||
// We don't get a valid lookup of the command name when it doesn't exist...
|
// We don't get a valid lookup of the command name when it doesn't exist...
|
||||||
|
Loading…
Reference in New Issue
Block a user