mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkBehaviour.InvokeRpcDelegate simplified
This commit is contained in:
parent
b3a4c3159c
commit
3d7a10fd08
@ -309,21 +309,12 @@ internal bool InvokeCommandDelegate(int cmdHash, NetworkReader reader)
|
||||
|
||||
internal bool InvokeRpcDelegate(int cmdHash, NetworkReader reader)
|
||||
{
|
||||
if (!s_CmdHandlerDelegates.ContainsKey(cmdHash))
|
||||
Invoker invoker;
|
||||
if (s_CmdHandlerDelegates.TryGetValue(cmdHash, out invoker) &&
|
||||
invoker.invokeType == UNetInvokeType.ClientRpc &&
|
||||
invoker.invokeClass.IsInstanceOfType(this))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Invoker inv = s_CmdHandlerDelegates[cmdHash];
|
||||
if (inv.invokeType != UNetInvokeType.ClientRpc)
|
||||
{
|
||||
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