protected void Page_Load(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(WebConfig.FunctionGameServerServerOperationHistory, OpType.READ, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }

        if (IsPostBack == false)
        {
            CreateCheckBoxListOperation();
            SelectedServerGroupChanged(null, null);

            DateTime now = DateTime.Now;
            EndDate.SelectedDate   = now;
            StartDate.SelectedDate = now.AddDays(-1);

            if (Page.Request.Params["SerialNum"] != null)
            {
                QueryByWhatRadioButtonList.SelectedValue = "operationId";
                QueryByWhatRadioButtonList_OnSelectedIndexChanged(null, null);
                OperationIdTextBox.Text = Page.Request.Params["SerialNum"];
                ButtonQuery_Click(null, null);
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        ////if (ViewState["serverId"] != null)
        ////{
        ////    _updateServerId = int.Parse(ViewState["serverId"].ToString());
        ////    ftpServer = AdminServer.TheInstance.FTPClient.GetFTPServer(_updateServerId);
        ////    ////需要对该UpdateServer有Read的权限
        ////    //if (!WebUtil.CheckPrivilege(ftpServer.SecurityObject, OpType.READ, Session))
        ////    //{
        ////    //    Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        ////    //}
        ////}

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


        if (!Page.IsPostBack)
        {
            LabelOpMsg.Text = "";
            ListFTPServer();
        }
        ////ListServerFiles();
    }
    protected void LinkButtonAdd_Click(object sender, EventArgs e)
    {
        try
        {
            //添加需要写权限
            if (!WebUtil.CheckPrivilege(WebConfig.FunctionGameServerAlertCondition, OpType.WRITE, Session))
            {
                LabelOpMsg.Text = StringDef.NotEnoughPrivilege;
                return;
            }

            AlertCondition condition = MakeAlertCondition(ListBoxAlertCondition.SelectedIndex, TextBoxParam1.Text, TextBoxParam2.Text);
            if (condition != null)
            {
                TheAdminServer.GameServerMonitor.AlertConditions.Add(condition);

                //ShowMessage(StringDef.AddAlertCondition + StringDef.Colon + StringDef.Success, MessageType.Success);
                Response.Redirect("AlertConfig.aspx");
            }
        }
        catch (Exception)
        {
            ShowMessage(StringDef.AddAlertCondition + StringDef.Colon + StringDef.Failure, MessageType.Failure);
        }
    }
    protected void ButtonServiceSwitch_Click(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(AdminServer.TheInstance.SecurityManager.Root, OpType.WRITE, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }

        try
        {
            if (AdminServer.TheInstance.IsRunning)
            {
                AdminServer.TheInstance.StopService(_user);
            }
            else
            {
                AdminServer.TheInstance.StartService(_user);
            }

            ButtonServiceSwitch.Text = AdminServer.TheInstance.IsRunning ? StringDef.StopService : StringDef.StartService;
        }
        catch (Exception ex)
        {
            LabelMessage.Text = ex.Message;
        }
    }
Exemple #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //页面权限判断
     if (!WebUtil.CheckPrivilege(WebConfig.FunctionGameServerDatabaseInfo, OpType.READ, Session))
     {
         Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
     }
     if (!IsPostBack)
     {
         if (Request.Params[WebConfig.ParamServerId] != null)
         {
             ViewState[WebConfig.ParamServerId] = int.Parse(Request.Params[WebConfig.ParamServerId]);
         }
         else
         {
             Response.Redirect("ServerList.aspx", true);
         }
         //服务器权限判断
         if (!WebUtil.CheckPrivilege((int)ViewState[WebConfig.ParamServerId], OpType.READ, Session))
         {
             Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
         }
         ShowProcessList();
     }
 }
Exemple #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(WebConfig.FunctionGameServerPlayerCount, OpType.READ, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }

        if (!IsPostBack)
        {
            string serverIdText = Request.Params[WebConfig.ParamServerId];
            if (serverIdText != null)
            {
                int        serverId = int.Parse(serverIdText);
                GameServer server   = TheAdminServer.GameServerManager.GetGameServer(serverId);
                ServerGroupDropDownList.SelectedServerGroup = server.Group;
                ServerDropDownList.CreateServerList(server.Group);
                ServerDropDownList.SelectedGameServer = server;
            }
            else
            {
                ServerDropDownList.CreateServerList(ServerGroupDropDownList.SelectedServerGroup);
            }

            _dayIndex = 0;
            Session[WebConfig.SessionDayIndex] = _dayIndex;
        }
        else
        {
            _dayIndex = (int)Session[WebConfig.SessionDayIndex];
        }

        RefreshDayButton();
    }
    protected void UploadFileDelete_Click(object sender, EventArgs e)
    {
        //需要对该页面有执行权限
        if (!WebUtil.CheckPrivilege(WebConfig.FunctionUpdateServerUpdateServerState, OpType.EXECUTE, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }
        LinkButton link  = sender as LinkButton;
        int        delId = int.Parse(link.ID.Substring(10));

        if (delId == 0)
        {
            //Abort
            server.Abort = true;
            //ShowMessage(StringDef.Processing, MessageType.Success);
        }
        else
        {
            //先清掉UploadFilesStateTable里的记录
            server.UploadFilesStateTable.Remove(server.UploadFiles[delId]);

            server.UploadFiles.Remove(server.UploadFiles[delId]);
            //ShowMessage(StringDef.Processing, MessageType.Success);
        }
        MessageUploadFile.Text = StringDef.Processing;
    }
Exemple #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(WebConfig.FunctionSecurityEditUser, OpType.READ, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }

        if (Request.Params[WebConfig.ParamUserId] != null)
        {
            try
            {
                int userId = int.Parse(Request.Params[WebConfig.ParamUserId]);
                _user = AdminServer.TheInstance.SecurityManager.GetUser(userId);
                HyperLinkEditPrivilege.NavigateUrl  = "EditPrivilege.aspx?objectId=" + userId;
                HyperLinkAddUserToGroup.NavigateUrl = "UserGroup.aspx?userId=" + userId;
            }
            catch (Exception)
            {
                //Response.Redirect("ListUser.aspx");
            }
        }
        else
        {
            Response.Redirect("ListUser.aspx");
        }

        if (!IsPostBack)
        {
            SetUserBasicInfo(_user);
            SetUserInGroupInfo(_user);
            //CreateCheckBoxListGroup();
        }

        LabelOpMsg.Text = string.Empty;
    }
Exemple #9
0
    //protected void DataGridUser_Delete(object sender, DataGridCommandEventArgs e)
    //{
    //    string userName = e.Item.Cells[4].Text;

    //    FSEye.Security.User user = AdminServer.TheInstance.SecurityManager.GetUser(userName);

    //    //需要Write权限
    //    if(user!=null)
    //    {
    //        if (!WebUtil.CheckPrivilege(user.SecurityObject, OpType.WRITE, Session))
    //        {
    //            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
    //        }

    //        AdminServer.TheInstance.SecurityManager.DeleteUser(user.UserName);
    //    }

    //    CreateDataGridUser();
    //}

    //protected void DataGridUser_Edit(object sender, DataGridCommandEventArgs e)
    //{
    //    DataGridUser.EditItemIndex = e.Item.ItemIndex;
    //    DataGridUser.DataSource = new DataView(Store);
    //    DataGridUser.DataBind();
    //    //生成组的CheckBoxList
    //    CreateCheckBoxListGroup();
    //}

    //protected void DataGridUser_Cancel(object sender, DataGridCommandEventArgs e)
    //{
    //    DataGridUser.EditItemIndex = -1;
    //    DataGridUser.DataSource = new DataView(Store);
    //    DataGridUser.DataBind();
    //}

    //protected void DataGridUser_Update(object sender, DataGridCommandEventArgs e)
    //{
    //    User user = TheAdminServer.SecurityManager.GetUser((int)Store.Rows[DataGridUser.EditItemIndex].ItemArray[0]);
    //    if (user != null)
    //    {
    //        //权限检查
    //        if (!WebUtil.CheckPrivilege(user.SecurityObject, OpType.WRITE, Session))
    //        {
    //            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
    //        }

    //        TextBox textBoxRealName = e.Item.Cells[5].Controls[0] as TextBox;
    //        if(textBoxRealName!=null)
    //        {
    //            string newRealName = textBoxRealName.Text.Trim();
    //            if (newRealName == string.Empty)
    //            {
    //                return;
    //            }
    //            user.RealName = newRealName;
    //        }
    //        TextBox textBoxComment = e.Item.Cells[6].Controls[0] as TextBox;
    //        if(textBoxComment!=null)
    //        {
    //            string newComment = textBoxComment.Text.Trim();
    //            if (newComment == string.Empty)
    //            {
    //                return;
    //            }
    //            user.SecurityObject.Comment = newComment;
    //        }

    //        TheAdminServer.SecurityManager.SetUser(user);

    //        //添加用户到组
    //        CheckBoxList groupList = e.Item.Cells[7].FindControl("CheckBoxListGroup") as CheckBoxList;
    //        if (groupList != null)
    //        {
    //            foreach (ListItem item in groupList.Items)
    //            {
    //                if (item.Selected)
    //                {
    //                    TheAdminServer.SecurityManager.AddUserToGroup(user.SecurityObject.Id, int.Parse(item.Value));
    //                }
    //                else
    //                {
    //                    TheAdminServer.SecurityManager.RemoveUserFromGroup(user.SecurityObject.Id, int.Parse(item.Value));
    //                }
    //            }
    //        }
    //    }

    //    DataGridUser.EditItemIndex = -1;
    //    CreateDataGridUser();

    //}

    protected void LinkButton_Click(object sender, EventArgs e)
    {
        DataGridCommandEventArgs dataGridEvent = e as DataGridCommandEventArgs;
        LinkButton lb = sender as LinkButton;

        if (lb != null)
        {
            switch (lb.CommandName)
            {
            case "Delete":
                DataGridItem dataGridItem = lb.Parent.Parent as DataGridItem;
                if (dataGridItem != null)
                {
                    string userName = dataGridItem.Cells[1].Text;

                    FSEye.Security.User user = AdminServer.TheInstance.SecurityManager.GetUser(userName);

                    //需要Write权限
                    if (user != null)
                    {
                        if (!WebUtil.CheckPrivilege(user.SecurityObject, OpType.WRITE, Session))
                        {
                            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
                        }

                        AdminServer.TheInstance.SecurityManager.DeleteUser(user.UserName);
                    }

                    CreateDataGridUser();
                }
                break;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(WebConfig.FunctionUpdateServerUpdateServerState, OpType.READ, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }

        if (Request.Params["serverId"] != null && Request.Params["serverId"].Length != 0)
        {
            _updateServerId = int.Parse(Request.Params["serverId"]);
            server          = AdminServer.TheInstance.FTPClient.GetFTPServer(_updateServerId);
        }

        Message.Text = String.Empty;

        if (!IsPostBack)
        {
            ViewState[ParamPath] = String.Empty;
            ListServerFiles();
            Thread.Sleep(RefreshServerFilesDelayTime);
            GetServerFileList();
        }

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

        if (!IsPostBack)
        {
            ServerDropDownList.CreateServerList(ServerGroupDropDownList.SelectedServerGroup);
            LiteralRemove.Text = StringDef.Sender + StringDef.FilterNegative;

            StartDate.SelectedDate = DateTime.Today;
            EndDate.SelectedDate   = DateTime.Now;
        }
        else
        {
            try
            {
                _recordPerPage = int.Parse(ListBoxRecordPerPage.SelectedValue);
            }
            catch (Exception)
            {
                _recordPerPage = DefaultRecordPerPage;
            }
        }

        LabelOpMsg.Text     = string.Empty;
        PanelResult.Visible = false;
    }
Exemple #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(WebConfig.FunctionGameServerAlertConfig, OpType.READ, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }

        if (!IsPostBack)
        {
            TextBoxCheckPeriod.Text = TheAdminServer.GameServerMonitor.CheckPeriod.ToString();
        }

        if (Request.Params[WebConfig.ParamOperation] == OperationRemoveAlertCondition)
        {
            try
            {
                int index = int.Parse(Request.Params[WebConfig.ParamIndex]);
                RemoveAlertCondition(index);

                Response.Redirect("AlertConfig.aspx");
            }
            catch (Exception)
            {
            }
        }

        CreateTableAlertCondition();
        LabelOpMsg.Text = string.Empty;
    }
Exemple #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(WebConfig.FunctionSecurityDeleteUser, OpType.READ, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }

        ClearMessage();

        try
        {
            _userId = 0;
            if (Request.Params[WebConfig.ParamUserId] != null)
            {
                _userId = int.Parse(Request.Params[WebConfig.ParamUserId]);
                //if (!WebUtil.CheckPrivilege(_userId, OpType.WRITE, Session))
                //{
                //    Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
                //}
            }
        }
        catch (FormatException)
        {
        }

        if (!IsPostBack)
        {
            User user = AdminServer.TheInstance.SecurityManager.GetUser(_userId);
            if (user != null)
            {
                TextBoxUserName.Text = user.UserName;
            }
        }
    }
Exemple #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(WebConfig.FunctionSecurityDeleteGroup, OpType.READ, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }

        ClearMessage();

        try
        {
            _groupId = 0;
            if (Request.Params[WebConfig.ParamGroupId] != null)
            {
                _groupId = int.Parse(Request.Params[WebConfig.ParamGroupId]);
                if (!WebUtil.CheckPrivilege(_groupId, OpType.WRITE, Session))
                {
                    Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
                }
            }
        }
        catch (FormatException)
        {
        }

        if (!IsPostBack)
        {
            Group group = AdminServer.TheInstance.SecurityManager.GetGroup(_groupId);
            if (group != null)
            {
                TextBoxGroupName.Text = group.SecurityObject.Name;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(WebConfig.FunctionGameServerAdvancedPlayerCount, OpType.READ, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }

        if (!IsPostBack)
        {
            string serverIdText = Request.Params[WebConfig.ParamServerId];
            if (serverIdText != null)
            {
                int        serverId = int.Parse(serverIdText);
                GameServer server   = TheAdminServer.GameServerManager.GetGameServer(serverId);
                ServerGroupDropDownList.SelectedServerGroup = server.Group;
                ServerDropDownList.CreateServerList(server.Group);
                ServerDropDownList.SelectedGameServer = server;
            }
            else
            {
                ServerDropDownList.CreateServerList(ServerGroupDropDownList.SelectedServerGroup);
            }

            CalendarStartTime.SelectedDate = DateTime.Today.AddMonths(-1);
            CalendarEndTime.SelectedDate   = DateTime.Now;
        }

        LabelOpMsg.Text = string.Empty;
        ZedGraphWebPlayerCount.Visible = false;
    }
Exemple #16
0
    protected void LinkButtonAdd_Click(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(TheAdminServer.SecurityManager.GroupsSecurityObject, OpType.WRITE, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }
        string groupName = TextBoxGroupName.Text;
        string comment   = TextBoxComment.Text;

        try
        {
            AdminServer.TheInstance.SecurityManager.AddGroup(groupName, comment);

            Session[WebConfig.SessionOpResult] = new OperationResult("Add group \"" + groupName + "\" success.", MessageType.Success);

            Group group = AdminServer.TheInstance.SecurityManager.GetGroup(groupName);
            if (group != null)
            {
                Response.Redirect("EditGroup.aspx?groupId=" + group.SecurityObject.Id);
            }
            else
            {
                Response.Redirect("ListGroup.aspx");
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, MessageType.Failure);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(WebConfig.FunctionAutomationBatchTaskDetail, OpType.READ, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }

        try
        {
            int       taskId = int.Parse(Request.Params[WebConfig.ParamTaskId]);
            BatchTask task   = TheAdminServer.BatchTaskManager.GetBatchTask(taskId);
            if (task != null)
            {
                SetTask(task);
            }
            else
            {
                throw new Exception();
            }
        }
        catch (Exception)
        {
            Response.Redirect("BatchTask.aspx", true);
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!WebUtil.CheckPrivilege(WebConfig.FunctionGameServerServerOverviewPlayerCount, OpType.READ, Session))
     {
         Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
     }
 }
Exemple #19
0
    protected void LinkButtonAdd_Click(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(TheAdminServer.SecurityManager.UsersSecurityObject, OpType.WRITE, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }
        string userName = TextBoxUserName.Text;
        string comment  = TextBoxComment.Text;
        string realName = TextBoxRealName.Text;
        string password = TextBoxPassword.Text;

        try
        {
            AdminServer.TheInstance.SecurityManager.AddUser(userName, password, realName, comment);

            Session[WebConfig.SessionOpResult] = new OperationResult("Add user \"" + userName + "\" success.", MessageType.Success);

            User user = AdminServer.TheInstance.SecurityManager.GetUser(userName);
            //if (user != null)
            //{
            //    Response.Redirect("EditUser.aspx?userId=" + user.SecurityObject.Id);
            //}
            //else
            //{
            Response.Redirect("ListUser.aspx");
            //}
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, MessageType.Failure);
        }
    }
Exemple #20
0
    protected void CancelUploadFile_Click(object sender, EventArgs e)
    {
        //需要对该页面有执行权限
        if (!WebUtil.CheckPrivilege(WebConfig.FunctionUpdateServerUploadFiles, OpType.EXECUTE, Session))
        {
            ShowLabelMessage("取消上传失败:没有足够的权限", MessageType.Failure);
            return;
        }

        LinkButton link = sender as LinkButton;

        int       serverId = int.Parse(link.CommandName);
        FTPServer server   = TheAdminServer.FTPClient.GetFTPServer(serverId);

        string cancel = "CancelUploadFile";

        int delId = int.Parse(link.ID.Substring(cancel.Length + link.CommandName.Length));

        //delId == 0说明这是正在上传的任务
        if (delId == 0)
        {
            server.Abort = true;
        }
        //delId != 0说明这是在队列里等待上传的任务
        else
        {
            //先清掉UploadFilesStateTable里的记录
            server.UploadFilesStateTable.Remove(server.UploadFiles[delId]);

            server.UploadFiles.Remove(server.UploadFiles[delId]);
        }
    }
Exemple #21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UserInfo userInfo = Session[WebConfig.SessionCurrentUser] as UserInfo;

        LabelPageCreateTime.Text = Resources.StringDef.PageCreateTime + ": " + DateTime.Now.ToString();
        LiteralUserName.Text     = userInfo.RealName;

        LabelWebVersion.Text = "ÍøÕ¾°æ±¾ºÅ:" + SystemConfig.Current.WebSiteVersion;


        if (WebUtil.CheckPrivilege(AdminServer.TheInstance.SecurityManager.Root, OpType.EXECUTE, Session))
        {
            LinkSystemControl.Visible = true;
        }
        else
        {
            LinkSystemControl.Visible = false;
        }

        if (Request.Params["fromSelf"] == null)
        {
            if (!AdminServer.TheInstance.IsRunning)
            {
                Response.Redirect("~/Common/ServiceUnavaiable.aspx?fromSelf=true");
            }
        }

        bool showSiteMap = true;

        if (Session[WebConfig.SessionShowSiteMap] != null)
        {
            showSiteMap = (bool)Session[WebConfig.SessionShowSiteMap];
        }
        ShowSiteMap(showSiteMap);
    }
Exemple #22
0
    protected void DataGridResult_ItemCommand(object sender, DataGridCommandEventArgs e)
    {
        switch (((LinkButton)e.CommandSource).CommandName)
        {
        case "Download":
            GameServer server = TheAdminServer.GameServerManager.GetGameServer((int)ViewState[WebConfig.ParamServerId]);
            if (server != null)
            {
                if (!WebUtil.CheckPrivilege(TheAdminServer.GameServerManager.SecurityObject, OpType.EXECUTE, Session))
                {
                    LabelOpMsg.Text = StringDef.NotEnoughPrivilege;
                    return;
                }
                string   fileName = e.Item.Cells[4].Text;
                CheckBox check    = e.Item.Cells[3].FindControl("CheckBoxOverWrite") as CheckBox;
                if (check == null)
                {
                    return;
                }
                string path = ViewState["Path"] as string;
                if (path[path.Length - 1].ToString() != GameServer.FilePathDelimiter)
                {
                    path += GameServer.FilePathDelimiter;
                }
                server.AddFMTask(new FileDownloadTask(path + fileName, fileName, check.Checked));
                LabelOpMsg.Text = StringDef.OperationSucceed + StringDef.Colon + StringDef.AddToFileList;
            }
            break;

        default:
            break;
        }
    }
Exemple #23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!WebUtil.CheckPrivilege(WebConfig.FunctionGameMasterGMCommand, OpType.READ, Session))
            {
                Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
            }

            CreateServerGroupTree();

            //依靠javascript无刷新勾选checkbox
            TreeViewServerGroup.Attributes.Add("onclick", "OnTreeClick(event)");
        }

        //从GMCommandTemplate.xml读入GM指令模板,生成对应页面元素
        try
        {
            LoadGMCommandTemplate();
        }
        catch (Exception ex)
        {
            LabelOpMsg.Text = ex.Message;
            TableCell templateTableCell = this.TemplateTable.FindControl("TemplateTableCell") as TableCell;
            TemplateTableCell.Controls.Clear();
            return;
        }
    }
    protected void ButtonMoveToGroup_Click(object sender, EventArgs e)
    {
        //需要在GameServerManager上有Write的权限
        if (!WebUtil.CheckPrivilege(TheAdminServer.GameServerManager.SecurityObject, OpType.WRITE, Session))
        {
            LabelOpMsg.Text    = StringDef.NotEnoughPrivilege;
            LabelOpMsg.Visible = true;
            return;
        }

        object selectedObj = GetSelectedObject();

        if (selectedObj != null && selectedObj.GetType() == typeof(GameServer))
        {
            try
            {
                GameServer  server = selectedObj as GameServer;
                ServerGroup group  = ServerGroupDropDownList.SelectedServerGroup;

                TheAdminServer.GameServerManager.MoveToServerGroup(server, group);
                ServerGroupDropDownList.Refresh();
                CreateServerGroupTree();

                LabelSuccess.Text    = StringDef.OperationSucceed + StringDef.Colon + "服务器 " + server.Name + " 成功移动到组 " + group.Name;
                LabelSuccess.Visible = true;
            }
            catch (Exception ex)
            {
                LabelOpMsg.Text    = StringDef.OperationFail + StringDef.Colon + ex.Message;
                LabelOpMsg.Visible = true;
                return;
            }
        }
    }
Exemple #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(WebConfig.FunctionGameMasterPlayerWho, OpType.READ, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }

        if (!IsPostBack)
        {
            //CreateLevelList();
            ListBoxRecordPerPage.SelectedIndex = 1;
            _recordPerPage = DefaultRecordPerPage;
            ServerDropDownList.CreateServerList(ServerGroupDropDownList.SelectedServerGroup);
            CreateCheckBoxListRoleType();
        }
        else
        {
            try
            {
                _recordPerPage = int.Parse(ListBoxRecordPerPage.SelectedValue);
            }
            catch (Exception)
            {
                _recordPerPage = DefaultRecordPerPage;
            }
        }

        LabelOpMsg.Text = string.Empty;
    }
Exemple #26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!WebUtil.CheckPrivilege(WebConfig.FunctionSecurity, OpType.READ, Session))
     {
         Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
     }
 }
Exemple #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(WebConfig.FunctionPaysysAccountInfo, OpType.READ, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }

        if (Request.Params[WebConfig.ParamAccount] != null)
        {
            TextBoxInputAccount.Text = Request.Params[WebConfig.ParamAccount];
        }

        if (!IsPostBack)
        {
            //添加确认提示
            LinkButtonFreeze.Attributes.Add("onclick",
                                            string.Format("return msgConfirm('{0}');", string.Format(StringDef.MsgConfirm, StringDef.Freeze + StringDef.Account)));
            LinkButtonUnFreeze.Attributes.Add("onclick",
                                              string.Format("return msgConfirm('{0}');", string.Format(StringDef.MsgConfirm, StringDef.Unfreeze + StringDef.Account)));
            LinkButtonSavePassword.Attributes.Add("onclick",
                                                  string.Format("return msgConfirm('{0}');", string.Format(StringDef.MsgConfirm, StringDef.SavePassword)));
            LinkButtonResetPassword.Attributes.Add("onclick",
                                                   string.Format("return msgConfirm('{0}');", string.Format(StringDef.MsgConfirm, StringDef.ResetPassword)));
        }

        LabelOpMsg.Text    = string.Empty;
        LabelOpResult.Text = string.Empty;
    }
Exemple #28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(WebConfig.FunctionGameMasterOperationQuery, OpType.READ, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }

        if (!IsPostBack)
        {
            ServerDropDownList.CreateServerList(ServerGroupDropDownList.SelectedServerGroup);
            CreateCheckBoxListOperation();

            StartDate.SelectedDate = DateTime.Today.AddMonths(-1);
            EndDate.SelectedDate   = DateTime.Now;
        }
        else
        {
            try
            {
                _recordPerPage = int.Parse(ListBoxRecordPerPage.SelectedValue);
            }
            catch (Exception)
            {
                _recordPerPage = DefaultRecordPerPage;
            }
        }

        LabelOpMsg.Visible  = false;
        PanelResult.Visible = false;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!WebUtil.CheckPrivilege(WebConfig.FunctionGameInfoStatisticActivePlayerStatistic, OpType.READ, Session))
        {
            Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
        }

        if (!IsPostBack)
        {
            ServerDropDownList.CreateServerList(ServerGroupDropDownList.SelectedServerGroup);
            CalendarDate.SelectedDate = DateTime.Today;
            CreateCheckBoxListRoleType();
        }
        else
        {
            try
            {
                _recordPerPage = int.Parse(ListBoxRecordPerPage.SelectedValue);
            }
            catch (Exception)
            {
                _recordPerPage = DefaultRecordPerPage;
            }
        }

        PanelResult.Visible = false;
        LabelOpMsg.Text     = string.Empty;
    }
Exemple #30
0
 protected void ButtonQuery_Click(object sender, EventArgs e)
 {
     if (!WebUtil.CheckPrivilege(WebConfig.FunctionSecurityLog, OpType.EXECUTE, Session))
     {
         Response.Redirect(WebConfig.PageNotEnoughPrivilege, true);
     }
     Query(0);
 }