weaver: don't use ClientScene anymore because it's obsolete

This commit is contained in:
vis2k 2021-03-24 17:41:53 +08:00
parent 86ae1b0804
commit 968f239345
2 changed files with 4 additions and 7 deletions

View File

@ -35,8 +35,8 @@ public static MethodDefinition ProcessTargetRpcInvoke(TypeDefinition td, MethodD
if (HasNetworkConnectionParameter(md))
{
// if call has NetworkConnection write clients connection as first arg
//ClientScene.readyconnection
worker.Emit(OpCodes.Call, WeaverTypes.ReadyConnectionReference);
//NetworkClient.connection
worker.Emit(OpCodes.Call, WeaverTypes.NetworkClientConnection);
}
// process reader parameters and skip first one if first one is NetworkConnection

View File

@ -34,9 +34,6 @@ public static class WeaverTypes
public static TypeReference NetworkIdentityType;
public static TypeReference IEnumeratorType;
public static TypeReference ClientSceneType;
public static MethodReference ReadyConnectionReference;
public static TypeReference ComponentType;
public static TypeReference ObjectType;
@ -46,6 +43,7 @@ public static class WeaverTypes
public static MethodReference NetworkServerGetActive;
public static MethodReference NetworkServerGetLocalClientActive;
public static MethodReference NetworkClientGetActive;
public static MethodReference NetworkClientConnection;
// custom attribute types
public static TypeReference SyncVarType;
@ -176,6 +174,7 @@ public static void SetupTargetTypes(AssemblyDefinition unityAssembly, AssemblyDe
NetworkServerGetActive = Resolvers.ResolveMethod(NetworkServerType, currentAssembly, "get_active");
NetworkServerGetLocalClientActive = Resolvers.ResolveMethod(NetworkServerType, currentAssembly, "get_localClientActive");
NetworkClientGetActive = Resolvers.ResolveMethod(NetworkClientType, currentAssembly, "get_active");
NetworkClientConnection = Resolvers.ResolveMethod(NetworkClientType, currentAssembly, "get_connection");
CmdDelegateReference = mirrorAssembly.MainModule.GetType("Mirror.RemoteCalls.CmdDelegate");
CmdDelegateConstructor = Resolvers.ResolveMethod(CmdDelegateReference, currentAssembly, ".ctor");
@ -214,8 +213,6 @@ public static void SetupTargetTypes(AssemblyDefinition unityAssembly, AssemblyDe
ComponentType = unityAssembly.MainModule.GetType("UnityEngine.Component");
ObjectType = unityAssembly.MainModule.GetType("UnityEngine.Object");
ClientSceneType = mirrorAssembly.MainModule.GetType("Mirror.ClientScene");
ReadyConnectionReference = Resolvers.ResolveMethod(ClientSceneType, currentAssembly, "get_readyConnection");
syncVarEqualReference = Resolvers.ResolveMethod(NetworkBehaviourType, currentAssembly, "SyncVarEqual");
syncVarNetworkIdentityEqualReference = Resolvers.ResolveMethod(NetworkBehaviourType, currentAssembly, "SyncVarNetworkIdentityEqual");