mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkBehaviour.InvokeCommandDelegate simplified
This commit is contained in:
parent
dd7915bf75
commit
b3a4c3159c
@ -296,21 +296,12 @@ static bool GetInvokerForHash(int cmdHash, UNetInvokeType invokeType, out CmdDel
|
||||
|
||||
internal bool InvokeCommandDelegate(int cmdHash, NetworkReader reader)
|
||||
{
|
||||
if (!s_CmdHandlerDelegates.ContainsKey(cmdHash))
|
||||
Invoker invoker;
|
||||
if (s_CmdHandlerDelegates.TryGetValue(cmdHash, out invoker) &&
|
||||
invoker.invokeType == UNetInvokeType.Command &&
|
||||
invoker.invokeClass.IsInstanceOfType(this))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Invoker inv = s_CmdHandlerDelegates[cmdHash];
|
||||
if (inv.invokeType != UNetInvokeType.Command)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// 'this' instance of invokeClass?
|
||||
if (inv.invokeClass.IsInstanceOfType(this))
|
||||
{
|
||||
inv.invokeFunction(this, reader);
|
||||
invoker.invokeFunction(this, reader);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user