This commit is contained in:
Paul Pacheco 2020-09-22 13:03:33 -05:00
parent c868561822
commit 25b2fa9af8

View File

@ -33,23 +33,12 @@ static void ProcessMethods(TypeDefinition td)
// find command and RPC functions
foreach (MethodDefinition md in td.Methods)
{
foreach (CustomAttribute ca in md.CustomAttributes)
{
if (ca.AttributeType.Is<CommandAttribute>())
{
Weaver.Error($"Command {md.Name} must be declared inside a NetworkBehaviour", md);
}
if (ca.AttributeType.Is<ClientRpcAttribute>())
{
Weaver.Error($"ClientRpc {md.Name} must be declared inside a NetworkBehaviour", md);
}
if (ca.AttributeType.Is<TargetRpcAttribute>())
{
Weaver.Error($"TargetRpc {md.Name} must be declared inside a NetworkBehaviour", md);
}
}
if (md.HasCustomAttribute<CommandAttribute>())
Weaver.Error($"Command {md.Name} must be declared inside a NetworkBehaviour", md);
if (md.HasCustomAttribute<ClientRpcAttribute>())
Weaver.Error($"ClientRpc {md.Name} must be declared inside a NetworkBehaviour", md);
if (md.HasCustomAttribute<TargetRpcAttribute>())
Weaver.Error($"TargetRpc {md.Name} must be declared inside a NetworkBehaviour", md);
}
}
}