Exemplo n.º 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>
 /// <param name="index">索引</param>
 /// <param name="data">服务器列表配置数据</param>
 public static void Modify(int index, ServerListConfigData data)
 {
     if (index >= 0 && index < ServerListConfig.DataList.Count)
     {
         ServerListConfig.DataList[index] = data;
         ServerListConfig.Save();
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 页面载入响应
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.ContentType = "application/x-msdownload";
            string filename = "attachment; filename=" + "ServerList_" + ServerListConfig.GetData(0).Name + ".zip";

            Response.AddHeader("Content-Disposition", filename);
            Response.BinaryWrite(CdnZip.PackServerList(Request.Params["version"]));
        }
 /// <summary>
 /// 删除服务器列表配置数据
 /// </summary>
 /// <param name="index">索引</param>
 public static void Delete(int index)
 {
     if (index >= 0 && index < ServerListConfig.DataList.Count)
     {
         ServerListConfig.DataList.RemoveAt(index);
         ServerListConfig.Save();
     }
 }
 /// <summary>
 /// 删除服务器
 /// </summary>
 /// <param name="index">索引</param>
 public void Delete(int index)
 {
     if (index >= 0 && index < this.configList.Count)
     {
         this.configList.RemoveAt(index);
         ServerListConfig.Save();
     }
 }
        /// <summary>
        /// 渠道列表选择改变响应
        /// </summary>
        //protected void channelListBox_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //	this.UpdateCurrentServerList();
        //}

        /// <summary>
        /// 添加按钮点击响应
        /// </summary>
        protected void addButton_Click(object sender, EventArgs e)
        {
            ServerListConfigData data = new ServerListConfigData();

            this.UpdateData(data);
            ServerListConfig.Add(data);
            this.channelListBox.Items.Add(new ListItem(data.Name, data.Name));
            this.channelListBox.SelectedIndex = channelListBox.Items.Count - 1;
        }
        /// <summary>
        /// 删除按钮点击响应
        /// </summary>
        protected void deleteButton_Click(object sender, EventArgs e)
        {
            if (this.channelListBox.SelectedIndex < 0)
            {
                return;
            }

            ServerListConfig.Delete(this.channelListBox.SelectedIndex);
            channelListBox.Items.RemoveAt(this.channelListBox.SelectedIndex);
        }
 /// <summary>
 /// 修改服务器
 /// </summary>
 /// <param name="text">文本</param>
 /// <param name="visible">是否可见</param>
 /// <param name="index">索引</param>
 public void Modify(string text, bool visible, int index)
 {
     if (index >= 0 && index < this.configList.Count)
     {
         ServerConfig config = this.configList[index];
         config.Text    = text;
         config.Visible = visible;
         ServerListConfig.Save();
     }
 }
        /// <summary>
        /// 下移
        /// </summary>
        /// <param name="index">索引</param>
        public void MoveDown(int index)
        {
            if (index >= 0 && index < this.configList.Count - 1)
            {
                ServerConfig config = this.configList[index];

                this.configList.RemoveAt(index);
                this.configList.Insert(index + 1, config);

                ServerListConfig.Save();
            }
        }
        /// <summary>
        /// 修改按钮点击响应
        /// </summary>
        protected void modifyButton_Click(object sender, EventArgs e)
        {
            if (this.channelListBox.SelectedIndex < 0)
            {
                return;
            }

            ServerListConfigData data = ServerListConfig.GetData(this.channelListBox.SelectedIndex);

            this.UpdateData(data);
            ServerListConfig.Modify(this.channelListBox.SelectedIndex, data);
            this.channelListBox.Items[this.channelListBox.SelectedIndex].Text = data.Name;
        }
 /// <summary>
 /// 添加按钮点击响应
 /// </summary>
 protected void addButton_Click(object sender, EventArgs e)
 {
     if (this.CurrentServerList != null)
     {
         string config = this.GetConfig();
         this.CurrentServerList.Add(config, this.visibleCheckBox.Checked);
         if (!this.visibleCheckBox.Checked)
         {
             config += ("," + TableManager.GetGMTText(400) + "");
         }
         ServerListConfig.Save();
         this.serverListBox.Items.Add(new ListItem(config, this.idTextBox.Text));
     }
 }
 /// <summary>
 /// 添加服务器列表配置数据
 /// </summary>
 /// <param name="data">服务器列表配置数据</param>
 public static void Add(ServerListConfigData data)
 {
     ServerListConfig.DataList.Add(data);
     ServerListConfig.Save();
 }