mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Simplify command invocation
This commit is contained in:
parent
ec7185ad49
commit
eff9287236
@ -345,20 +345,12 @@ internal bool InvokeCommandDelegate(int cmdHash, NetworkReader reader)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GetType() != inv.invokeClass)
|
||||
if (inv.invokeClass.IsInstanceOfType(this))
|
||||
{
|
||||
if (GetType().IsSubclassOf(inv.invokeClass))
|
||||
{
|
||||
// allowed, commands function is on a base class.
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
inv.invokeFunction(this, reader);
|
||||
return true;
|
||||
}
|
||||
|
||||
inv.invokeFunction(this, reader);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
internal bool InvokeRpcDelegate(int cmdHash, NetworkReader reader)
|
||||
@ -374,20 +366,12 @@ internal bool InvokeRpcDelegate(int cmdHash, NetworkReader reader)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (GetType() != inv.invokeClass)
|
||||
if (inv.invokeClass.IsInstanceOfType(this))
|
||||
{
|
||||
if (GetType().IsSubclassOf(inv.invokeClass))
|
||||
{
|
||||
// allowed, rpc function is on a base class.
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
inv.invokeFunction(this, reader);
|
||||
return true;
|
||||
}
|
||||
|
||||
inv.invokeFunction(this, reader);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
internal bool InvokeSyncEventDelegate(int cmdHash, NetworkReader reader)
|
||||
|
Loading…
Reference in New Issue
Block a user