Make Weaver variable naming consistent (#781)

* Rename netViewTmp

* Rename UBehaviourIsServer

* Better name for IsServer
This commit is contained in:
rodolphito 2019-04-09 00:55:56 -07:00 committed by vis2k
parent 98d6e667b0
commit 68433660ca
2 changed files with 6 additions and 6 deletions

View File

@ -50,7 +50,7 @@ public static MethodDefinition ProcessCommandCall(TypeDefinition td, MethodDefin
// local client check // local client check
Instruction localClientLabel = cmdWorker.Create(OpCodes.Nop); Instruction localClientLabel = cmdWorker.Create(OpCodes.Nop);
cmdWorker.Append(cmdWorker.Create(OpCodes.Ldarg_0)); cmdWorker.Append(cmdWorker.Create(OpCodes.Ldarg_0));
cmdWorker.Append(cmdWorker.Create(OpCodes.Call, Weaver.UBehaviourIsServer)); cmdWorker.Append(cmdWorker.Create(OpCodes.Call, Weaver.getBehaviourIsServer));
cmdWorker.Append(cmdWorker.Create(OpCodes.Brfalse, localClientLabel)); cmdWorker.Append(cmdWorker.Create(OpCodes.Brfalse, localClientLabel));
// call the cmd function directly. // call the cmd function directly.

View File

@ -91,7 +91,7 @@ class Weaver
public static MethodReference NetworkServerGetActive; public static MethodReference NetworkServerGetActive;
public static MethodReference NetworkServerGetLocalClientActive; public static MethodReference NetworkServerGetLocalClientActive;
public static MethodReference NetworkClientGetActive; public static MethodReference NetworkClientGetActive;
public static MethodReference UBehaviourIsServer; public static MethodReference getBehaviourIsServer;
public static MethodReference NetworkReaderReadPackedUInt32; public static MethodReference NetworkReaderReadPackedUInt32;
public static MethodReference NetworkReaderReadPackedUInt64; public static MethodReference NetworkReaderReadPackedUInt64;
public static MethodReference NetworkWriterWritePackedUInt64; public static MethodReference NetworkWriterWritePackedUInt64;
@ -325,8 +325,8 @@ static void SetupTargetTypes()
CurrentAssembly.MainModule.ImportReference(gameObjectType); CurrentAssembly.MainModule.ImportReference(gameObjectType);
CurrentAssembly.MainModule.ImportReference(transformType); CurrentAssembly.MainModule.ImportReference(transformType);
TypeReference netViewTmp = NetAssembly.MainModule.GetType("Mirror.NetworkIdentity"); TypeReference networkIdentityTmp = NetAssembly.MainModule.GetType("Mirror.NetworkIdentity");
NetworkIdentityType = CurrentAssembly.MainModule.ImportReference(netViewTmp); NetworkIdentityType = CurrentAssembly.MainModule.ImportReference(networkIdentityTmp);
NetworkBehaviourType = NetAssembly.MainModule.GetType("Mirror.NetworkBehaviour"); NetworkBehaviourType = NetAssembly.MainModule.GetType("Mirror.NetworkBehaviour");
NetworkBehaviourType2 = CurrentAssembly.MainModule.ImportReference(NetworkBehaviourType); NetworkBehaviourType2 = CurrentAssembly.MainModule.ImportReference(NetworkBehaviourType);
@ -352,11 +352,11 @@ static void SetupTargetTypes()
// get specialized GetComponent<NetworkIdentity>() // get specialized GetComponent<NetworkIdentity>()
getComponentReference = Resolvers.ResolveMethodGeneric(ComponentType, CurrentAssembly, "GetComponent", NetworkIdentityType); getComponentReference = Resolvers.ResolveMethodGeneric(ComponentType, CurrentAssembly, "GetComponent", NetworkIdentityType);
getNetIdReference = Resolvers.ResolveMethod(netViewTmp, CurrentAssembly, "get_netId"); getNetIdReference = Resolvers.ResolveMethod(networkIdentityTmp, CurrentAssembly, "get_netId");
gameObjectInequality = Resolvers.ResolveMethod(unityObjectType, CurrentAssembly, "op_Inequality"); gameObjectInequality = Resolvers.ResolveMethod(unityObjectType, CurrentAssembly, "op_Inequality");
UBehaviourIsServer = Resolvers.ResolveMethod(NetworkBehaviourType, CurrentAssembly, "get_isServer"); getBehaviourIsServer = Resolvers.ResolveMethod(NetworkBehaviourType, CurrentAssembly, "get_isServer");
setSyncVarReference = Resolvers.ResolveMethod(NetworkBehaviourType, CurrentAssembly, "SetSyncVar"); setSyncVarReference = Resolvers.ResolveMethod(NetworkBehaviourType, CurrentAssembly, "SetSyncVar");
setSyncVarHookGuard = Resolvers.ResolveMethod(NetworkBehaviourType, CurrentAssembly, "set_syncVarHookGuard"); setSyncVarHookGuard = Resolvers.ResolveMethod(NetworkBehaviourType, CurrentAssembly, "set_syncVarHookGuard");
getSyncVarHookGuard = Resolvers.ResolveMethod(NetworkBehaviourType, CurrentAssembly, "get_syncVarHookGuard"); getSyncVarHookGuard = Resolvers.ResolveMethod(NetworkBehaviourType, CurrentAssembly, "get_syncVarHookGuard");