mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
syntax
This commit is contained in:
parent
b996b52c0f
commit
69cd7c9d85
@ -10,7 +10,7 @@ namespace Mirror.Weaver
|
||||
{
|
||||
public static class Resolvers
|
||||
{
|
||||
public static MethodReference ResolveMethod(TypeReference tr, AssemblyDefinition scriptDef, Logger Log, string name, ref bool WeavingFailed)
|
||||
public static MethodReference ResolveMethod(TypeReference tr, AssemblyDefinition assembly, Logger Log, string name, ref bool WeavingFailed)
|
||||
{
|
||||
if (tr == null)
|
||||
{
|
||||
@ -18,7 +18,7 @@ public static MethodReference ResolveMethod(TypeReference tr, AssemblyDefinition
|
||||
WeavingFailed = true;
|
||||
return null;
|
||||
}
|
||||
MethodReference method = ResolveMethod(tr, scriptDef, Log, m => m.Name == name, ref WeavingFailed);
|
||||
MethodReference method = ResolveMethod(tr, assembly, Log, m => m.Name == name, ref WeavingFailed);
|
||||
if (method == null)
|
||||
{
|
||||
Log.Error($"Method not found with name {name} in type {tr.Name}", tr);
|
||||
@ -27,13 +27,13 @@ public static MethodReference ResolveMethod(TypeReference tr, AssemblyDefinition
|
||||
return method;
|
||||
}
|
||||
|
||||
public static MethodReference ResolveMethod(TypeReference t, AssemblyDefinition scriptDef, Logger Log, System.Func<MethodDefinition, bool> predicate, ref bool WeavingFailed)
|
||||
public static MethodReference ResolveMethod(TypeReference t, AssemblyDefinition assembly, Logger Log, System.Func<MethodDefinition, bool> predicate, ref bool WeavingFailed)
|
||||
{
|
||||
foreach (MethodDefinition methodRef in t.Resolve().Methods)
|
||||
{
|
||||
if (predicate(methodRef))
|
||||
{
|
||||
return scriptDef.MainModule.ImportReference(methodRef);
|
||||
return assembly.MainModule.ImportReference(methodRef);
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ public static MethodReference ResolveMethod(TypeReference t, AssemblyDefinition
|
||||
return null;
|
||||
}
|
||||
|
||||
public static MethodReference TryResolveMethodInParents(TypeReference tr, AssemblyDefinition scriptDef, string name)
|
||||
public static MethodReference TryResolveMethodInParents(TypeReference tr, AssemblyDefinition assembly, string name)
|
||||
{
|
||||
if (tr == null)
|
||||
{
|
||||
@ -52,12 +52,12 @@ public static MethodReference TryResolveMethodInParents(TypeReference tr, Assemb
|
||||
{
|
||||
if (methodRef.Name == name)
|
||||
{
|
||||
return scriptDef.MainModule.ImportReference(methodRef);
|
||||
return assembly.MainModule.ImportReference(methodRef);
|
||||
}
|
||||
}
|
||||
|
||||
// Could not find the method in this class, try the parent
|
||||
return TryResolveMethodInParents(tr.Resolve().BaseType, scriptDef, name);
|
||||
return TryResolveMethodInParents(tr.Resolve().BaseType, assembly, name);
|
||||
}
|
||||
|
||||
public static MethodDefinition ResolveDefaultPublicCtor(TypeReference variable)
|
||||
@ -74,13 +74,13 @@ public static MethodDefinition ResolveDefaultPublicCtor(TypeReference variable)
|
||||
return null;
|
||||
}
|
||||
|
||||
public static MethodReference ResolveProperty(TypeReference tr, AssemblyDefinition scriptDef, string name)
|
||||
public static MethodReference ResolveProperty(TypeReference tr, AssemblyDefinition assembly, string name)
|
||||
{
|
||||
foreach (PropertyDefinition pd in tr.Resolve().Properties)
|
||||
{
|
||||
if (pd.Name == name)
|
||||
{
|
||||
return scriptDef.MainModule.ImportReference(pd.GetMethod);
|
||||
return assembly.MainModule.ImportReference(pd.GetMethod);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user