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_Statistics_FusionStatsGraphDefault_Binding { public static void Register(UnityFusion.Runtime.Enviorment.AppDomain app) { BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly; MethodBase method; Type[] args; Type type = typeof(Fusion.Statistics.FusionStatsGraphDefault); args = new Type[]{typeof(Fusion.NetworkRunner), typeof(Fusion.Statistics.FusionStatisticsManager), typeof(System.DateTime).MakeByRefType()}; method = type.GetMethod("UpdateGraph", flag, null, args, null); app.RegisterCLRMethodRedirection(method, UpdateGraph_0); args = new Type[]{typeof(Fusion.Statistics.FusionStatistics.FusionStatisticsStatCustomConfig)}; method = type.GetMethod("ApplyCustomStatsConfig", flag, null, args, null); app.RegisterCLRMethodRedirection(method, ApplyCustomStatsConfig_1); app.RegisterCLRCreateDefaultInstance(type, () => new Fusion.Statistics.FusionStatsGraphDefault()); app.RegisterCLRCreateArrayInstance(type, s => new Fusion.Statistics.FusionStatsGraphDefault[s]); args = new Type[]{}; method = type.GetConstructor(flag, null, args, null); app.RegisterCLRMethodRedirection(method, Ctor_0); } static StackObject* UpdateGraph_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, 4); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); System.DateTime @now = (System.DateTime)typeof(System.DateTime).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack), (CLR.Utils.Extensions.TypeFlags)16); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); Fusion.Statistics.FusionStatisticsManager @statisticsManager = (Fusion.Statistics.FusionStatisticsManager)typeof(Fusion.Statistics.FusionStatisticsManager).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); Fusion.NetworkRunner @runner = (Fusion.NetworkRunner)typeof(Fusion.NetworkRunner).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); ptr_of_this_method = ILIntepreter.Minus(__esp, 4); Fusion.Statistics.FusionStatsGraphDefault instance_of_this_method = (Fusion.Statistics.FusionStatsGraphDefault)typeof(Fusion.Statistics.FusionStatsGraphDefault).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); instance_of_this_method.UpdateGraph(@runner, @statisticsManager, ref @now); 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); object ___obj = @now; if (___dst->ObjectType >= ObjectTypes.Object) { if (___obj is CrossBindingAdaptorType) ___obj = ((CrossBindingAdaptorType)___obj).ILInstance; __mStack[___dst->Value] = ___obj; } else { ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain); } } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if(___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @now; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @now); } } 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] = @now; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @now); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.DateTime[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @now; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 4); __intp.Free(ptr_of_this_method); return __ret; } static StackObject* ApplyCustomStatsConfig_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, 2); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); Fusion.Statistics.FusionStatistics.FusionStatisticsStatCustomConfig @config = (Fusion.Statistics.FusionStatistics.FusionStatisticsStatCustomConfig)typeof(Fusion.Statistics.FusionStatistics.FusionStatisticsStatCustomConfig).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); Fusion.Statistics.FusionStatsGraphDefault instance_of_this_method = (Fusion.Statistics.FusionStatsGraphDefault)typeof(Fusion.Statistics.FusionStatsGraphDefault).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); __intp.Free(ptr_of_this_method); instance_of_this_method.ApplyCustomStatsConfig(@config); return __ret; } static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* __ret = ILIntepreter.Minus(__esp, 0); var result_of_this_method = new Fusion.Statistics.FusionStatsGraphDefault(); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } } }