This commit is contained in:
vis2k 2022-01-18 15:55:16 +08:00
parent 308e995ad5
commit 0aa70d8e61

View File

@ -80,22 +80,16 @@ internal static int RegisterDelegate(Type invokeClass, string functionFullName,
}
// pass full function name to avoid ClassA.Func <-> ClassB.Func collisions
public static void RegisterCommandDelegate(Type invokeClass, string functionFullName, RemoteCallDelegate func, bool requiresAuthority)
{
public static void RegisterCommandDelegate(Type invokeClass, string functionFullName, RemoteCallDelegate func, bool requiresAuthority) =>
RegisterDelegate(invokeClass, functionFullName, RemoteCallType.Command, func, requiresAuthority);
}
// pass full function name to avoid ClassA.Func <-> ClassB.Func collisions
public static void RegisterRpcDelegate(Type invokeClass, string functionFullName, RemoteCallDelegate func)
{
public static void RegisterRpcDelegate(Type invokeClass, string functionFullName, RemoteCallDelegate func) =>
RegisterDelegate(invokeClass, functionFullName, RemoteCallType.ClientRpc, func);
}
// to clean up tests
internal static void RemoveDelegate(int hash)
{
internal static void RemoveDelegate(int hash) =>
remoteCallDelegates.Remove(hash);
}
// note: no need to throw an error if not found.
// an attacker might just try to call a cmd with an rpc's hash etc.