use default int32 reader

This commit is contained in:
Paul Pacheco 2019-08-30 21:35:00 -05:00
parent a5d4f46980
commit 609480208c
2 changed files with 2 additions and 4 deletions

View File

@ -157,7 +157,7 @@ static MethodDefinition GenerateArrayReadFunc(TypeReference variable, int recurs
// int length = reader.ReadPackedInt32(); // int length = reader.ReadPackedInt32();
worker.Append(worker.Create(OpCodes.Ldarg_0)); 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)); worker.Append(worker.Create(OpCodes.Stloc_0));
// if (length < 0) { // if (length < 0) {
@ -256,7 +256,7 @@ static MethodDefinition GenerateArraySegmentReadFunc(TypeReference variable, int
// int length = reader.ReadPackedInt32(); // int length = reader.ReadPackedInt32();
worker.Append(worker.Create(OpCodes.Ldarg_0)); 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)); worker.Append(worker.Create(OpCodes.Stloc_0));
// T[] array = new int[length] // T[] array = new int[length]

View File

@ -85,7 +85,6 @@ class Weaver
public static MethodReference NetworkServerGetLocalClientActive; public static MethodReference NetworkServerGetLocalClientActive;
public static MethodReference NetworkClientGetActive; public static MethodReference NetworkClientGetActive;
public static MethodReference getBehaviourIsServer; public static MethodReference getBehaviourIsServer;
public static MethodReference NetworkReaderReadPackedInt32;
public static MethodReference NetworkReaderReadPackedUInt32; public static MethodReference NetworkReaderReadPackedUInt32;
public static MethodReference NetworkWriterWritePackedUInt64; public static MethodReference NetworkWriterWritePackedUInt64;
public static MethodReference NetworkWriterWritePackedInt32; public static MethodReference NetworkWriterWritePackedInt32;
@ -318,7 +317,6 @@ static void SetupTargetTypes()
NetworkServerGetLocalClientActive = Resolvers.ResolveMethod(NetworkServerType, CurrentAssembly, "get_localClientActive"); NetworkServerGetLocalClientActive = Resolvers.ResolveMethod(NetworkServerType, CurrentAssembly, "get_localClientActive");
NetworkClientGetActive = Resolvers.ResolveMethod(NetworkClientType, CurrentAssembly, "get_active"); NetworkClientGetActive = Resolvers.ResolveMethod(NetworkClientType, CurrentAssembly, "get_active");
NetworkReaderReadPackedInt32 = Resolvers.ResolveMethod(NetworkReaderType, CurrentAssembly, "ReadPackedInt32");
NetworkReaderReadPackedUInt32 = Resolvers.ResolveMethod(NetworkReaderType, CurrentAssembly, "ReadPackedUInt32"); NetworkReaderReadPackedUInt32 = Resolvers.ResolveMethod(NetworkReaderType, CurrentAssembly, "ReadPackedUInt32");
NetworkReaderReadPackedUInt64 = Resolvers.ResolveMethod(NetworkReaderType, CurrentAssembly, "ReadPackedUInt64"); NetworkReaderReadPackedUInt64 = Resolvers.ResolveMethod(NetworkReaderType, CurrentAssembly, "ReadPackedUInt64");