Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (!WebUtil.CheckPrivilege(WebConfig.FunctionGameServerAddServerGroupSimplified, OpType.READ, Session))
            {
                Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
            }
            TextBoxFSEyeIp.Text = SystemConfig.Current.AdminServerListenIP;
            int defaultPort = SystemConfig.Current.AdminServerListenPort;
            TextBoxFSEyePort.Text = Convert.ToString(defaultPort);

            ServerGroupDropDownList.ListEmptyServerGroups();
            FtpDropDownList.ListFtpByType(FTPServer.FTPServerType.ServerUpdate);
        }

        CreateConfigParametersTableByXml();
    }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(WebConfig.FunctionGameServerEditServer, OpType.READ, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }

        _operation = Operation.Add;
        string operation = Request.Params[WebConfig.ParamOperation];

        if (operation != null)
        {
            switch (operation)
            {
            case "add":
                _operation = Operation.Add;
                break;

            case "modify":
                _operation = Operation.Modify;
                break;
            }
        }

        if (_operation == Operation.Add)
        {
            TextBoxServerId.Text           = StringDef.Unknown;
            LinkButtonEdit.Text            = StringDef.Add;
            ButtonShowLordConfig.Enabled   = false;
            ButtonShowServerConfig.Enabled = false;
        }
        else if (_operation == Operation.Modify)
        {
            LinkButtonEdit.Text = StringDef.Save;
            string serverIdText = Request.Params[WebConfig.ParamServerId];
            if (serverIdText != null)
            {
                int serverId = int.Parse(serverIdText);
                _server = TheAdminServer.GameServerManager.GetGameServer(serverId);
                if (_server != null)
                {
                    if (_server.LordConfig.FSEyeIp == null || _server.LordConfig.FSEyeIp.Length == 0)
                    {
                        LabelLordIsConfig.Visible = true;
                    }
                    else
                    {
                        LabelLordIsConfig.Visible = false;
                    }
                    //HyperLinkViewLordConfigFile.NavigateUrl = String.Format("GameServerHandler.ashx?op=CreateLordConfigFile&serverId={0}", serverId);
                    //HyperLinkViewLordConfigFile.NavigateUrl = String.Format("GameServerHandler.ashx?op=CreateGuardConfigFile&serverId={0}", serverId);
                    HyperLinkViewLordConfigFile.NavigateUrl = String.Format("ShowGuardConfig.aspx?serverId={0}", serverId);
                }
            }

            if (_server == null)
            {
                Response.Redirect("GameServer.aspx");
            }

            if (!WebUtil.CheckPrivilege(TheAdminServer.GameServerManager.SecurityObject, OpType.READ, Session))
            {
                Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
            }

            if (!IsPostBack)
            {
                FtpDropDownList.ListFtpByType(FTPServer.FTPServerType.ServerUpdate);

                ShowGameServerInfo();

                if (_operation == Operation.Modify)
                {
                    //备份服务器名称供提交时进行判断使用
                    ViewState["serverNameTemp"] = TextBoxServerName.Text;
                }
            }

            //my code//
            //当是Modify页面时禁止修改这两个DropDownList
            ListBoxServerType.Enabled       = false;
            ServerGroupDropDownList.Enabled = false;
        }

        ServerGroupDropDownList.GroupType    = ServerGroup.Type.Server;
        ServerGroupDropDownList.AutoPostBack = true;
        LabelOpMsg.Text      = string.Empty;
        LabelSuccess.Visible = false;

        if (_operation == Operation.Add)
        {
            SetGameDir();
        }

        if (_operation == Operation.Add && !IsPostBack)
        {
            SetServerNameAndComment();
        }
        //给该Blaze控件增加EventHandler
        ServerGroupDropDownList.SelectedServerGroupChanged += new EventHandler(ServerGroupDropDownList_SelectedServerGroupChanged);
    }