From 609480208c82317697eac4d5d1c7b7436b06ddd7 Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Fri, 30 Aug 2019 21:35:00 -0500 Subject: [PATCH] use default int32 reader --- Assets/Mirror/Editor/Weaver/Readers.cs | 4 ++-- Assets/Mirror/Editor/Weaver/Weaver.cs | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Assets/Mirror/Editor/Weaver/Readers.cs b/Assets/Mirror/Editor/Weaver/Readers.cs index ede739503..f1e218182 100644 --- a/Assets/Mirror/Editor/Weaver/Readers.cs +++ b/Assets/Mirror/Editor/Weaver/Readers.cs @@ -157,7 +157,7 @@ static MethodDefinition GenerateArrayReadFunc(TypeReference variable, int recurs // int length = reader.ReadPackedInt32(); worker.Append(worker.Create(OpCodes.Ldarg_0)); - worker.Append(worker.Create(OpCodes.Call, Weaver.NetworkReaderReadPackedInt32)); + worker.Append(worker.Create(OpCodes.Call, GetReadFunc(Weaver.int32Type))); worker.Append(worker.Create(OpCodes.Stloc_0)); // if (length < 0) { @@ -256,7 +256,7 @@ static MethodDefinition GenerateArraySegmentReadFunc(TypeReference variable, int // int length = reader.ReadPackedInt32(); worker.Append(worker.Create(OpCodes.Ldarg_0)); - worker.Append(worker.Create(OpCodes.Call, Weaver.NetworkReaderReadPackedInt32)); + worker.Append(worker.Create(OpCodes.Call, GetReadFunc(Weaver.int32Type))); worker.Append(worker.Create(OpCodes.Stloc_0)); // T[] array = new int[length] diff --git a/Assets/Mirror/Editor/Weaver/Weaver.cs b/Assets/Mirror/Editor/Weaver/Weaver.cs index 096906050..2f6b7915a 100644 --- a/Assets/Mirror/Editor/Weaver/Weaver.cs +++ b/Assets/Mirror/Editor/Weaver/Weaver.cs @@ -85,7 +85,6 @@ class Weaver public static MethodReference NetworkServerGetLocalClientActive; public static MethodReference NetworkClientGetActive; public static MethodReference getBehaviourIsServer; - public static MethodReference NetworkReaderReadPackedInt32; public static MethodReference NetworkReaderReadPackedUInt32; public static MethodReference NetworkWriterWritePackedUInt64; public static MethodReference NetworkWriterWritePackedInt32; @@ -318,7 +317,6 @@ static void SetupTargetTypes() NetworkServerGetLocalClientActive = Resolvers.ResolveMethod(NetworkServerType, CurrentAssembly, "get_localClientActive"); NetworkClientGetActive = Resolvers.ResolveMethod(NetworkClientType, CurrentAssembly, "get_active"); - NetworkReaderReadPackedInt32 = Resolvers.ResolveMethod(NetworkReaderType, CurrentAssembly, "ReadPackedInt32"); NetworkReaderReadPackedUInt32 = Resolvers.ResolveMethod(NetworkReaderType, CurrentAssembly, "ReadPackedUInt32"); NetworkReaderReadPackedUInt64 = Resolvers.ResolveMethod(NetworkReaderType, CurrentAssembly, "ReadPackedUInt64");