mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Weaver ValidateRemoteCallAndParameters IsStatic check added so we don't need to check in Command/Rpc/TargetRpcProcessors
This commit is contained in:
parent
2e178b7eaf
commit
5e7257d7bc
@ -126,12 +126,6 @@ static void AddSenderConnection(MethodDefinition method, ILProcessor worker)
|
||||
|
||||
public static bool ValidateCommand(MethodDefinition md)
|
||||
{
|
||||
if (md.IsStatic)
|
||||
{
|
||||
Weaver.Error($"{md.Name} cannot be static", md);
|
||||
return false;
|
||||
}
|
||||
|
||||
// validate
|
||||
return NetworkBehaviourProcessor.ValidateRemoteCallAndParameters(md, RemoteCallType.Command);
|
||||
}
|
||||
|
@ -875,8 +875,14 @@ public static void AddInvokeParameters(ICollection<ParameterDefinition> collecti
|
||||
}
|
||||
|
||||
// check if a Command/TargetRpc/Rpc function & parameters are valid for weaving
|
||||
public static bool ValidateRemoteCallAndParameters(MethodReference method, RemoteCallType callType)
|
||||
public static bool ValidateRemoteCallAndParameters(MethodDefinition method, RemoteCallType callType)
|
||||
{
|
||||
if (method.IsStatic)
|
||||
{
|
||||
Weaver.Error($"{method.Name} must not be static", method);
|
||||
return false;
|
||||
}
|
||||
|
||||
return ValidateFunction(method) &&
|
||||
ValidateParameters(method, callType);
|
||||
}
|
||||
|
@ -104,12 +104,6 @@ public static MethodDefinition ProcessRpcCall(TypeDefinition td, MethodDefinitio
|
||||
|
||||
public static bool ValidateRpc(MethodDefinition md)
|
||||
{
|
||||
if (md.IsStatic)
|
||||
{
|
||||
Weaver.Error($"{md.Name} must not be static", md);
|
||||
return false;
|
||||
}
|
||||
|
||||
// validate
|
||||
return NetworkBehaviourProcessor.ValidateRemoteCallAndParameters(md, RemoteCallType.ClientRpc);
|
||||
}
|
||||
|
@ -133,12 +133,6 @@ public static MethodDefinition ProcessTargetRpcCall(TypeDefinition td, MethodDef
|
||||
|
||||
public static bool ValidateTargetRpc(MethodDefinition md)
|
||||
{
|
||||
if (md.IsStatic)
|
||||
{
|
||||
Weaver.Error($"{md.Name} must not be static", md);
|
||||
return false;
|
||||
}
|
||||
|
||||
// validate
|
||||
return NetworkBehaviourProcessor.ValidateRemoteCallAndParameters(md, RemoteCallType.TargetRpc);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user