예제 #1
0
        /// <summary>
        /// 应用程序启动
        /// </summary>
        protected void Application_Start(object sender, EventArgs e)
        {
            System.Net.ServicePointManager.DefaultConnectionLimit = 100;

            Init();

            UserManager.Init();

            gmt.Server.Load();
            gmt.Server.newLoad();

            Log.Start();
            Network.Start();
            FTPManager.Load();
            TableManager.Start();
            TextManager.Load();
            RevolvingManager.Start();
            NoticeManager.Load();

            ActivityManger.Start();
            ServerListConfig.Load();
            GMTActivityMananger.start();
            GiftTable.Start();
            TimedMailSender.Init();
            RevolvingManager.UpdateService();
            PayType.LoadPayType();
        }
        /// <summary>
        /// 开始
        /// </summary>
        public static void Start()
        {
            GiftTable.GiftListEx = TableManager.Load <mw.GiftConfig>();
            if (null == GiftTable.GiftListEx)
            {
                GiftTable.GiftListEx = new List <mw.GiftConfig>();
            }

            List <mw.GiftConfig> list = new List <mw.GiftConfig>();

            for (int i = 0; i < GiftTable.GiftListEx.Count; ++i)
            {
                if (GiftTable.GiftListEx[i].id >= 1000000)
                {
                    list.Add(GiftTable.GiftListEx[i]);
                }
            }

            TableManager.Save(list);

            GiftTable.GiftList = TableManager.Load <mw.GiftConfig>("protodatas/GiftConfig.protodata.bytes");
            if (null == GiftTable.GiftList)
            {
                GiftTable.GiftList = new List <mw.GiftConfig>();
            }

            if (GiftTable.GiftListEx != null)
            {
                for (int i = 0; i < GiftTable.GiftListEx.Count; i++)
                {
                    int j = 0;
                    for (; j < GiftTable.GiftList.Count; j++)
                    {
                        if (GiftTable.GiftListEx[i].id == GiftTable.GiftList[j].id)
                        {
                            break;
                        }
                    }
                    if (j == GiftTable.GiftList.Count)
                    {
                        GiftTable.GiftList.Add(GiftTable.GiftListEx[i]);
                    }
                }
            }

            foreach (var gift in GiftTable.GiftList)
            {
                gift.title_id = gift.title;
                gift.desc_id  = gift.desc;
            }

            GiftTable.DoStart();
        }