Exemple #1
0
        public static void Initialize(Initializers ths)
        {
            Common.StringBuilder msg = new Common.StringBuilder("Initialize");

            try
            {
                GameUtils.BeginLoadEvent("GameInit");
                for (int i = 0x0; i < ths.mInitializerRecords.Count; i++)
                {
                    Initializers.Record record = ths.mInitializerRecords[i];
                    GameUtils.BeginLoadEvent("GameInit/" + record.ToString());

                    Initializers.Action action = record.Instantiate();

                    if (action.Valid)
                    {
                        msg += Common.NewLine + "Instance: " + action.mInstance;
                        msg += Common.NewLine + "Init: " + action.mInit;
                        msg += Common.NewLine + "Type: " + action.mType;
                        Traveler.InsanityWriteLog(msg);

                        try
                        {
                            string header = action.mType + " - " + action.mInit;
                            using (Common.TestSpan span = new Common.TestSpan(Common.ExternalTimeSpanLogger.sLogger, header))
                            {
                                if (header == "Sims3.Gameplay.CAS.SimDescription - Void PostLoadFixUp()")
                                {
                                    PostLoadFixUp();
                                }
                                else
                                {
                                    action.DoInit();
                                }
                            }
                        }
                        catch (Exception e)
                        {
                            Common.Exception(msg, e);
                        }
                    }

                    GameUtils.EndLoadEvent();
                }
                GameUtils.EndLoadEvent();
            }
            finally
            {
                Common.WriteLog(msg);
            }
        }