Weaver - first switch (#224)

This commit is contained in:
MichalPetryka 2019-01-02 19:19:24 +01:00 committed by Paul Pacheco
parent 4fee160b6c
commit c8a0ddb6d3

View File

@ -909,21 +909,20 @@ static void ProcessSiteMethod(ModuleDefinition moduleDef, TypeDefinition td, Met
{ {
foreach (CustomAttribute attr in md.CustomAttributes) foreach (CustomAttribute attr in md.CustomAttributes)
{ {
if (attr.Constructor.DeclaringType.ToString() == "Mirror.ServerAttribute") switch (attr.Constructor.DeclaringType.ToString())
{ {
InjectServerGuard(moduleDef, td, md, true); case "Mirror.ServerAttribute":
} InjectServerGuard(moduleDef, td, md, true);
else if (attr.Constructor.DeclaringType.ToString() == "Mirror.ServerCallbackAttribute") break;
{ case "Mirror.ServerCallbackAttribute":
InjectServerGuard(moduleDef, td, md, false); InjectServerGuard(moduleDef, td, md, false);
} break;
else if (attr.Constructor.DeclaringType.ToString() == "Mirror.ClientAttribute") case "Mirror.ClientAttribute":
{ InjectClientGuard(moduleDef, td, md, true);
InjectClientGuard(moduleDef, td, md, true); break;
} case "Mirror.ClientCallbackAttribute":
else if (attr.Constructor.DeclaringType.ToString() == "Mirror.ClientCallbackAttribute") InjectClientGuard(moduleDef, td, md, false);
{ break;
InjectClientGuard(moduleDef, td, md, false);
} }
} }