示例#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();
        }
 public static string DelTimedMail(int Id)
 {
     if (TimedMailSender.RemoveTimedMail(Id))
     {
         return("{\"error\":0, \"msg\": \"success\"}");
     }
     return("{\"error\":1, \"msg\": \"fail\"}");
 }
        /// <summary>
        /// 发放单人礼包按钮点击响应
        /// </summary>
        protected void singleGiftButton_Click(object sender, EventArgs e)
        {
            if (this.selectListBox.Items.Count != 1 ||
                string.IsNullOrEmpty(this.selectListBox.Items[0].Value))
            {
                this.errorLabel.Text = TableManager.GetGMTText(720);
                return;
            }

            if (string.IsNullOrEmpty(this.uidTextBox.Text))
            {
                this.errorLabel.Text = TableManager.GetGMTText(721);
                return;
            }

            string account = Session["user"] as string;

            gmt.Server server = gmt.Server.GetServer(this.selectListBox.Items[0].Value);

            int giftId = 0;

            if (!int.TryParse(this.giftOptionDropDownList.SelectedValue, out giftId))
            {
                return;
            }

            uint playerId = this.GetPlayerId();

            if (playerId == 0)
            {
                return;
            }

            string gmcmd = string.Format("GIFT({0},{1})", playerId, giftId);

            bool   isGiftTimeOn = (Request.Form["gift_timer_checker"] == "on") ? true : false;
            string give_time    = this.datetimepicker_1.Value;

            if (isGiftTimeOn)
            {
                STTimedMail stMailInfo = new STTimedMail();
                stMailInfo.uid        = playerId;
                stMailInfo.mailId     = giftId;
                stMailInfo.serverName = this.selectListBox.Items[0].Value;
                stMailInfo.sendTime   = CUtils.GetTimestamp(Convert.ToDateTime(give_time));
                stMailInfo.cmd        = gmcmd;
                TimedMailSender.AddTimedMail(stMailInfo);
            }
            else
            {
                AGmPage.ExecuteGmCommand(account, server, playerId.ToString(), gmcmd, "", true, text => this.errorLabel.Text += text);
            }
        }
        /// <summary>
        /// 发放全员礼包按钮点击响应
        /// </summary>
        protected void wholeGiftButton_Click(object sender, EventArgs e)
        {
            int giftId = 0;

            if (!int.TryParse(this.giftOptionDropDownList.SelectedValue, out giftId))
            {
                return;
            }

            uint playerId = 0;

            bool   isGiftTimeOn = (Request.Form["gift_timer_checker"] == "on") ? true : false;
            string give_time    = this.datetimepicker_1.Value;
            string gmcmd        = string.Format("GIFT({0},{1})", playerId, giftId);

            string account = Session["user"] as string;

            for (int i = 0; i < selectListBox.Items.Count; ++i)
            {
                gmt.Server server = gmt.Server.GetServer(selectListBox.Items[i].Text);
                if (server == null)
                {
                    this.errorLabel.Text += TableManager.GetGMTText(733) + ":" + selectListBox.Items[i].Text;
                    continue;
                }

                if (isGiftTimeOn)
                {
                    STTimedMail stMailInfo = new STTimedMail();
                    stMailInfo.uid        = playerId;
                    stMailInfo.mailId     = giftId;
                    stMailInfo.serverName = selectListBox.Items[i].Text;
                    stMailInfo.sendTime   = CUtils.GetTimestamp(Convert.ToDateTime(give_time));
                    stMailInfo.cmd        = gmcmd;
                    TimedMailSender.AddTimedMail(stMailInfo);
                }
                else
                {
                    AGmPage.ExecuteGmCommand(account, server, playerId.ToString(), gmcmd, "", true, text => this.errorLabel.Text += text);
                }
            }
        }
 public static string GetTimedMailData()
 {
     return(TimedMailSender.GetMailList());
 }