#if FUSION2 && XRMOD_INSTALL using System; using System.Collections.Generic; using System.Reflection; using System.Runtime.InteropServices; using UnityFusion.CLR.TypeSystem; using UnityFusion.CLR.Method; using UnityFusion.Runtime.Enviorment; using UnityFusion.Runtime.Intepreter; using UnityFusion.Runtime.Stack; using UnityFusion.Reflection; using UnityFusion.CLR.Utils; #if DEBUG && !DISABLE_UNITYFUSION_DEBUG using AutoList = System.Collections.Generic.List; #else using AutoList = UnityFusion.Other.UncheckedList; #endif namespace UnityFusion.Runtime.Generated { unsafe class Fusion_Sockets_ReliableKey_Binding { public static void Register(UnityFusion.Runtime.Enviorment.AppDomain app) { BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly; MethodBase method; FieldInfo field; Type[] args; Type type = typeof(Fusion.Sockets.ReliableKey); args = new Type[] { typeof(System.Int32).MakeByRefType(), typeof(System.Int32).MakeByRefType(), typeof(System.Int32).MakeByRefType(), typeof(System.Int32).MakeByRefType() }; method = type.GetMethod("GetInts", flag, null, args, null); app.RegisterCLRMethodRedirection(method, GetInts_0); args = new Type[] {typeof(System.UInt64).MakeByRefType(), typeof(System.UInt64).MakeByRefType()}; method = type.GetMethod("GetUlongs", flag, null, args, null); app.RegisterCLRMethodRedirection(method, GetUlongs_1); args = new Type[] {typeof(System.Int32), typeof(System.Int32), typeof(System.Int32), typeof(System.Int32)}; method = type.GetMethod("FromInts", flag, null, args, null); app.RegisterCLRMethodRedirection(method, FromInts_2); args = new Type[] {typeof(System.UInt64), typeof(System.UInt64)}; method = type.GetMethod("FromULongs", flag, null, args, null); app.RegisterCLRMethodRedirection(method, FromULongs_3); field = type.GetField("SIZE", flag); app.RegisterCLRFieldGetter(field, get_SIZE_0); app.RegisterCLRFieldBinding(field, CopyToStack_SIZE_0, null); app.RegisterCLRMemberwiseClone(type, PerformMemberwiseClone); app.RegisterCLRCreateDefaultInstance(type, () => new Fusion.Sockets.ReliableKey()); app.RegisterCLRCreateArrayInstance(type, s => new Fusion.Sockets.ReliableKey[s]); } static void WriteBackInstance(UnityFusion.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, AutoList __mStack, ref Fusion.Sockets.ReliableKey instance_of_this_method) { ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method); switch (ptr_of_this_method->ObjectType) { case ObjectTypes.Object: { __mStack[ptr_of_this_method->Value] = instance_of_this_method; } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if (___obj is ILTypeInstance) { ((ILTypeInstance) ___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method; } else { var t = __domain.GetType(___obj.GetType()) as CLRType; t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method); } } break; case ObjectTypes.StaticFieldReference: { var t = __domain.GetType(ptr_of_this_method->Value); if (t is ILType) { ((ILType) t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method; } else { ((CLRType) t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as Fusion.Sockets.ReliableKey[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method; } break; } } static StackObject* GetInts_0(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 5); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Int32 @key3 = __intp.RetriveInt32(ptr_of_this_method, __mStack); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Int32 @key2 = __intp.RetriveInt32(ptr_of_this_method, __mStack); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); System.Int32 @key1 = __intp.RetriveInt32(ptr_of_this_method, __mStack); ptr_of_this_method = ILIntepreter.Minus(__esp, 4); System.Int32 @key0 = __intp.RetriveInt32(ptr_of_this_method, __mStack); ptr_of_this_method = ILIntepreter.Minus(__esp, 5); ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method); Fusion.Sockets.ReliableKey instance_of_this_method = (Fusion.Sockets.ReliableKey) typeof(Fusion.Sockets.ReliableKey).CheckCLRTypes( StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 16); instance_of_this_method.GetInts(out @key0, out @key1, out @key2, out @key3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); switch (ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); ___dst->ObjectType = ObjectTypes.Integer; ___dst->Value = @key3; } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if (___obj is ILTypeInstance) { ((ILTypeInstance) ___obj)[ptr_of_this_method->ValueLow] = @key3; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @key3); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if (___type is ILType) { ((ILType) ___type).StaticInstance[ptr_of_this_method->ValueLow] = @key3; } else { ((CLRType) ___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @key3); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Int32[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @key3; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); switch (ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); ___dst->ObjectType = ObjectTypes.Integer; ___dst->Value = @key2; } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if (___obj is ILTypeInstance) { ((ILTypeInstance) ___obj)[ptr_of_this_method->ValueLow] = @key2; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @key2); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if (___type is ILType) { ((ILType) ___type).StaticInstance[ptr_of_this_method->ValueLow] = @key2; } else { ((CLRType) ___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @key2); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Int32[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @key2; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); switch (ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); ___dst->ObjectType = ObjectTypes.Integer; ___dst->Value = @key1; } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if (___obj is ILTypeInstance) { ((ILTypeInstance) ___obj)[ptr_of_this_method->ValueLow] = @key1; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @key1); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if (___type is ILType) { ((ILType) ___type).StaticInstance[ptr_of_this_method->ValueLow] = @key1; } else { ((CLRType) ___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @key1); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Int32[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @key1; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 4); switch (ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); ___dst->ObjectType = ObjectTypes.Integer; ___dst->Value = @key0; } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if (___obj is ILTypeInstance) { ((ILTypeInstance) ___obj)[ptr_of_this_method->ValueLow] = @key0; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @key0); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if (___type is ILType) { ((ILType) ___type).StaticInstance[ptr_of_this_method->ValueLow] = @key0; } else { ((CLRType) ___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @key0); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Int32[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @key0; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 5); WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method); __intp.Free(ptr_of_this_method); return __ret; } static StackObject* GetUlongs_1(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.UInt64 @key1 = (System.UInt64) __intp.RetriveInt64(ptr_of_this_method, __mStack); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.UInt64 @key0 = (System.UInt64) __intp.RetriveInt64(ptr_of_this_method, __mStack); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method); Fusion.Sockets.ReliableKey instance_of_this_method = (Fusion.Sockets.ReliableKey) typeof(Fusion.Sockets.ReliableKey).CheckCLRTypes( StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 16); instance_of_this_method.GetUlongs(out @key0, out @key1); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); switch (ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); ___dst->ObjectType = ObjectTypes.Long; *(ulong*) &___dst->Value = @key1; } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if (___obj is ILTypeInstance) { ((ILTypeInstance) ___obj)[ptr_of_this_method->ValueLow] = @key1; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @key1); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if (___type is ILType) { ((ILType) ___type).StaticInstance[ptr_of_this_method->ValueLow] = @key1; } else { ((CLRType) ___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @key1); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.UInt64[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @key1; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); switch (ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); ___dst->ObjectType = ObjectTypes.Long; *(ulong*) &___dst->Value = @key0; } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if (___obj is ILTypeInstance) { ((ILTypeInstance) ___obj)[ptr_of_this_method->ValueLow] = @key0; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @key0); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if (___type is ILType) { ((ILType) ___type).StaticInstance[ptr_of_this_method->ValueLow] = @key0; } else { ((CLRType) ___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @key0); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.UInt64[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @key0; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method); __intp.Free(ptr_of_this_method); return __ret; } static StackObject* FromInts_2(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 4); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.Int32 @key3 = ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.Int32 @key2 = ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 3); System.Int32 @key1 = ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 4); System.Int32 @key0 = ptr_of_this_method->Value; var result_of_this_method = Fusion.Sockets.ReliableKey.FromInts(@key0, @key1, @key2, @key3); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* FromULongs_3(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.UInt64 @key1 = *(ulong*) &ptr_of_this_method->Value; ptr_of_this_method = ILIntepreter.Minus(__esp, 2); System.UInt64 @key0 = *(ulong*) &ptr_of_this_method->Value; var result_of_this_method = Fusion.Sockets.ReliableKey.FromULongs(@key0, @key1); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static object get_SIZE_0(ref object o) { return Fusion.Sockets.ReliableKey.SIZE; } static StackObject* CopyToStack_SIZE_0(ref object o, ILIntepreter __intp, StackObject* __ret, AutoList __mStack) { var result_of_this_method = Fusion.Sockets.ReliableKey.SIZE; __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method; return __ret + 1; } static object PerformMemberwiseClone(ref object o) { var ins = new Fusion.Sockets.ReliableKey(); ins = (Fusion.Sockets.ReliableKey) o; return ins; } } } #endif