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,21 +345,13 @@ internal bool InvokeCommandDelegate(int cmdHash, NetworkReader reader)
|
|||||||
return false;
|
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);
|
inv.invokeFunction(this, reader);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
internal bool InvokeRpcDelegate(int cmdHash, NetworkReader reader)
|
internal bool InvokeRpcDelegate(int cmdHash, NetworkReader reader)
|
||||||
{
|
{
|
||||||
@ -374,21 +366,13 @@ internal bool InvokeRpcDelegate(int cmdHash, NetworkReader reader)
|
|||||||
return false;
|
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);
|
inv.invokeFunction(this, reader);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
internal bool InvokeSyncEventDelegate(int cmdHash, NetworkReader reader)
|
internal bool InvokeSyncEventDelegate(int cmdHash, NetworkReader reader)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user