mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkBehaviour.InvokeSyncEventDelegate simplified
This commit is contained in:
parent
3d7a10fd08
commit
98f984182a
@ -322,19 +322,14 @@ internal bool InvokeRpcDelegate(int cmdHash, NetworkReader reader)
|
|||||||
|
|
||||||
internal bool InvokeSyncEventDelegate(int cmdHash, NetworkReader reader)
|
internal bool InvokeSyncEventDelegate(int cmdHash, NetworkReader reader)
|
||||||
{
|
{
|
||||||
if (!s_CmdHandlerDelegates.ContainsKey(cmdHash))
|
Invoker invoker;
|
||||||
|
if (s_CmdHandlerDelegates.TryGetValue(cmdHash, out invoker) &&
|
||||||
|
invoker.invokeType == UNetInvokeType.SyncEvent)
|
||||||
{
|
{
|
||||||
return false;
|
invoker.invokeFunction(this, reader);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
Invoker inv = s_CmdHandlerDelegates[cmdHash];
|
|
||||||
if (inv.invokeType != UNetInvokeType.SyncEvent)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
inv.invokeFunction(this, reader);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static string GetCmdHashHandlerName(int cmdHash)
|
internal static string GetCmdHashHandlerName(int cmdHash)
|
||||||
|
Loading…
Reference in New Issue
Block a user