Ejemplo n.º 1
0
        /*
         * .method assembly hidebysig instance bool
         * SetLogic(class [SimIFace]Sims3.SimIFace.IScriptLogic obj,
         *         bool postLoad) cil managed
         *
         *
         * // Code size       188 (0xbc)
         * .maxstack  4
         * .locals init (class [mscorlib]System.Exception V_0,
         *   object[] V_1)
         * .try
         * {
         * IL_0000:  ldarg.0
         * IL_0001:  ldarg.1
         * IL_0002:  stfld      class [SimIFace]Sims3.SimIFace.IScriptLogic [ScriptCore]ScriptCore.ScriptProxy::mTarget
         * IL_0007:  ldarg.0
         * IL_0008:  ldfld      class [SimIFace]Sims3.SimIFace.IScriptLogic [ScriptCore]ScriptCore.ScriptProxy::mTarget
         * IL_000d:  ldarg.0
         * IL_000e:  callvirt   instance void [SimIFace]Sims3.SimIFace.IScriptLogic::set_Proxy(class [SimIFace]Sims3.SimIFace.IScriptProxy)
         * .try
         * {
         * IL_0013:  ldsfld     class ScriptCore.ExceptionTrap/PostLoad ScriptCore.ExceptionTrap::OnPrePostLoad
         * IL_0018:  brfalse.s  IL_002c
         *
         * IL_001a:  ldsfld     class ScriptCore.ExceptionTrap/PostLoad ScriptCore.ExceptionTrap::OnPrePostLoad
         * IL_001f:  ldarg.0
         * IL_0020:  ldarg.0
         * IL_0021:  ldfld      class [SimIFace]Sims3.SimIFace.IScriptLogic [ScriptCore]ScriptCore.ScriptProxy::mTarget
         * IL_0026:  ldarg.2
         * IL_0027:  callvirt   instance void ScriptCore.ExceptionTrap/PostLoad::Invoke(class [ScriptCore]ScriptCore.ScriptProxy,
         *                                                                           class [SimIFace]Sims3.SimIFace.IScriptLogic,
         *                                                                           bool)
         * .try
         * {
         * IL_002c:  ldarg.0
         * IL_002d:  ldarg.0
         * IL_002e:  ldfld      class [SimIFace]Sims3.SimIFace.IScriptLogic [ScriptCore]ScriptCore.ScriptProxy::mTarget
         * IL_0033:  ldarg.2
         * IL_0034:  callvirt   instance valuetype [SimIFace]Sims3.SimIFace.ScriptExecuteType [SimIFace]Sims3.SimIFace.IScriptLogic::Init(bool)
         * IL_0039:  stfld      valuetype [SimIFace]Sims3.SimIFace.ScriptExecuteType [ScriptCore]ScriptCore.ScriptProxy::mExecuteType
         * IL_003e:  leave.s    IL_005a
         *
         * }  // end .try
         * finally
         * {
         * IL_0040:  ldsfld     class ScriptCore.ExceptionTrap/PostLoad ScriptCore.ExceptionTrap::OnPostPostLoad
         * IL_0045:  brfalse.s  IL_0059
         *
         * IL_0047:  ldsfld     class ScriptCore.ExceptionTrap/PostLoad ScriptCore.ExceptionTrap::OnPostPostLoad
         * IL_004c:  ldarg.0
         * IL_004d:  ldarg.0
         * IL_004e:  ldfld      class [SimIFace]Sims3.SimIFace.IScriptLogic [ScriptCore]ScriptCore.ScriptProxy::mTarget
         * IL_0053:  ldarg.2
         * IL_0054:  callvirt   instance void ScriptCore.ExceptionTrap/PostLoad::Invoke(class [ScriptCore]ScriptCore.ScriptProxy,
         *                                                                             class [SimIFace]Sims3.SimIFace.IScriptLogic,
         *                                                                             bool)
         * IL_0059:  endfinally
         * }  // end handler
         * IL_005a:  leave.s    IL_0066
         *
         * }  // end .try
         * catch [SimIFace]Sims3.SimIFace.ResetException
         * {
         * IL_005c:  pop
         * IL_005d:  ldarg.0
         * IL_005e:  ldc.i4.0
         * IL_005f:  stfld      valuetype [SimIFace]Sims3.SimIFace.ScriptExecuteType [ScriptCore]ScriptCore.ScriptProxy::mExecuteType
         * IL_0064:  leave.s    IL_0066
         *
         * }  // end handler
         * IL_0066:  ldc.i4.3
         * IL_0067:  newarr     [mscorlib]System.Object
         * IL_006c:  stloc.1
         * IL_006d:  ldloc.1
         * IL_006e:  ldc.i4.0
         * IL_006f:  ldstr      "ScriptProxy:SetLogic"
         * IL_0074:  stelem.ref
         * IL_0075:  ldloc.1
         * IL_0076:  ldc.i4.1
         * IL_0077:  ldarg.0
         * IL_0078:  ldfld      valuetype [SimIFace]Sims3.SimIFace.ScriptExecuteType [ScriptCore]ScriptCore.ScriptProxy::mExecuteType
         * IL_007d:  box        [SimIFace]Sims3.SimIFace.ScriptExecuteType
         * IL_0082:  stelem.ref
         * IL_0083:  ldloc.1
         * IL_0084:  ldc.i4.2
         * IL_0085:  ldarg.0
         * IL_0086:  ldfld      class [SimIFace]Sims3.SimIFace.IScriptLogic [ScriptCore]ScriptCore.ScriptProxy::mTarget
         * IL_008b:  stelem.ref
         * IL_008c:  ldloc.1
         * IL_008d:  call       void ScriptCore.ExceptionTrap::Notify(object[])
         * IL_0092:  ldarg.0
         * IL_0093:  ldfld      valuetype [SimIFace]Sims3.SimIFace.ScriptExecuteType [ScriptCore]ScriptCore.ScriptProxy::mExecuteType
         * IL_0098:  brtrue.s   IL_00ad
         *
         * IL_009a:  ldarg.0
         * IL_009b:  ldfld      class [SimIFace]Sims3.SimIFace.IScriptLogic [ScriptCore]ScriptCore.ScriptProxy::mTarget
         * IL_00a0:  ldnull
         * IL_00a1:  callvirt   instance void [SimIFace]Sims3.SimIFace.IScriptLogic::set_Proxy(class [SimIFace]Sims3.SimIFace.IScriptProxy)
         * IL_00a6:  ldarg.0
         * IL_00a7:  ldnull
         * IL_00a8:  stfld      class [SimIFace]Sims3.SimIFace.IScriptLogic [ScriptCore]ScriptCore.ScriptProxy::mTarget
         * IL_00ad:  leave.s    IL_00ba
         *
         * }  // end .try
         * catch [mscorlib]System.Exception
         * {
         * IL_00af:  stloc.0
         * IL_00b0:  ldarg.0
         * IL_00b1:  ldloc.0
         * IL_00b2:  call       instance bool [ScriptCore]ScriptCore.ScriptProxy::OnScriptError(class [mscorlib]System.Exception)
         * IL_00b7:  pop
         * IL_00b8:  leave.s    IL_00ba
         *
         * }  // end handler
         * IL_00ba:  ldc.i4.1
         * IL_00bb:  ret
         */
        public new bool SetLogic(Sims3.SimIFace.IScriptLogic obj, bool postLoad)
        {
            try
            {
                mTarget       = obj;
                mTarget.Proxy = this;
                try
                {
                    if (ExceptionTrap.OnPrePostLoad != null)
                    {
                        ExceptionTrap.OnPrePostLoad(this, mTarget, postLoad);
                    }

                    try
                    {
                        mExecuteType = mTarget.Init(postLoad);
                    }
                    finally
                    {
                        if (ExceptionTrap.OnPostPostLoad != null)
                        {
                            ExceptionTrap.OnPostPostLoad(this, mTarget, postLoad);
                        }
                    }
                }
                catch (Sims3.SimIFace.ResetException)
                {
                    mExecuteType = Sims3.SimIFace.ScriptExecuteType.InitFailed;
                }

                ExceptionTrap.Notify(new object[] { "ScriptProxy:SetLogic", mExecuteType, mTarget });

                if (mExecuteType == Sims3.SimIFace.ScriptExecuteType.InitFailed)
                {
                    mTarget.Proxy = null;
                    mTarget       = null;
                }
            }
            catch (Exception exception)
            {
                OnScriptError(exception);
            }
            return(true);
        }
Ejemplo n.º 2
0
        public static void OnPostPostLoad(ScriptCore.ScriptProxy proxy, Sims3.SimIFace.IScriptLogic logic, bool postLoad)
        {
            using (TestSpan span = new TestSpan(TimeSpanLogger.Bin, "OnPostPostLoad", DebuggingLevel))
            {
                try
                {
                    List <ICheck> checks = DerivativeSearch.Find <ICheck>();

                    foreach (ICheck check in checks)
                    {
                        check.IPostPerform(logic, postLoad);
                    }
                }
                catch (Exception e)
                {
                    Exception(proxy.Target, e);
                }
            }
        }