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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetType() != inv.invokeClass)
|
if (inv.invokeClass.IsInstanceOfType(this))
|
||||||
{
|
{
|
||||||
if (GetType().IsSubclassOf(inv.invokeClass))
|
inv.invokeFunction(this, reader);
|
||||||
{
|
return true;
|
||||||
// allowed, commands function is on a base class.
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
inv.invokeFunction(this, reader);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal bool InvokeRpcDelegate(int cmdHash, NetworkReader reader)
|
internal bool InvokeRpcDelegate(int cmdHash, NetworkReader reader)
|
||||||
@ -374,20 +366,12 @@ 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))
|
inv.invokeFunction(this, reader);
|
||||||
{
|
return true;
|
||||||
// allowed, rpc function is on a base class.
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
inv.invokeFunction(this, reader);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal bool InvokeSyncEventDelegate(int cmdHash, NetworkReader reader)
|
internal bool InvokeSyncEventDelegate(int cmdHash, NetworkReader reader)
|
||||||
|
Loading…
Reference in New Issue
Block a user