Exemplo n.º 1
0
    protected void LinkButtonPassword_Click(object sender, EventArgs e)
    {
        LinkButton lb = sender as LinkButton;

        if (lb != null)
        {
            string accountName;
            string accountPassword;
            switch (lb.CommandName)
            {
            case "SavePass":
                accountName     = TextBoxInputAccount.Text;
                accountPassword = TheAdminServer.PaySysAgent.GetPassword(accountName);
                if (accountPassword == null || accountPassword.Length == 0)
                {
                    LabelOpMsg.Text = StringDef.OperationFail + StringDef.Colon + StringDef.SavePassword;
                    return;
                }
                if (!TheAdminServer.PaysysManager.SaveAccountPassword(accountName, accountPassword))
                {
                    LabelOpMsg.Text = StringDef.OperationFail + StringDef.Colon + StringDef.SavePassword;
                }
                else
                {
                    LabelOpMsg.Text = StringDef.OperationSucceed + StringDef.Colon + StringDef.SavePassword;
                }
                break;

            case "ResetPass":
                accountName     = TextBoxInputAccount.Text;
                accountPassword = TheAdminServer.PaysysManager.GetSavedPassword(accountName);
                if (accountPassword == null || accountPassword.Length == 0)
                {
                    LabelOpMsg.Text = StringDef.OperationFail + StringDef.Colon + StringDef.ResetPassword;
                    return;
                }
                FSEye.PaySysLib.OperationResult result = TheAdminServer.PaySysAgent.SetPassword(accountName, accountPassword, true);
                if (result != FSEye.PaySysLib.OperationResult.Success)
                {
                    LabelOpMsg.Text = StringDef.OperationFail + StringDef.Colon + result.ToString();
                }
                else
                {
                    LabelOpMsg.Text = StringDef.OperationSucceed + StringDef.Colon + StringDef.ResetPassword;
                }
                break;
            }
        }
    }
Exemplo n.º 2
0
    protected void LinkButtonRoleAccountFreeze_Click(object sender, EventArgs e)
    {
        int num = 0;

        foreach (DataGridItem item in DataGridResult.Items)
        {
            CheckBox selection = (CheckBox)item.FindControl("CheckBoxSelect");
            if (selection != null && selection.Checked)
            {
                //对选择的角色进行操作
                string accountName = item.Cells[2].Text;
                FSEye.PaySysLib.OperationResult result = GMUtil.SetAccountFrozen(CurrentUser.Id, accountName, true);

                //如果不成功则不进行后面发GM指今操作
                if (result != FSEye.PaySysLib.OperationResult.Success)
                {
                    continue;
                }

                ++num;

                string gatewayInfo = GMUtil.GetGatewayByAccount(CurrentUser.Id, accountName);

                //如果Gateway信息不是Offline则得到其serverId然后对其上角色进行强制退出操作
                if (gatewayInfo != null && !gatewayInfo.Equals("Offline", StringComparison.OrdinalIgnoreCase))
                {
                    GameServer server = GMUtil.GetAccountOnlineServer(CurrentUser.Id, accountName);
                    if (server == null)
                    {
                        LabelOpMsg.Text = string.Format(StringDef.MsgCannotBeNone, StringDef.GameServer);
                        return;
                    }
                    IList roleNameList = GMUtil.GetRoleNameByAccount(CurrentUser.Id, server, accountName, true);
                    if (roleNameList.Count != 0)
                    {
                        foreach (string roleName in roleNameList)
                        {
                            server.DoPlugInAction(CurrentUser.Id, LordControl.PlugInGuid, LordControl.ActionKeyExecuteGMCommand, roleName, WebConfig.GMCommandKickPlayer);
                        }
                    }
                }
            }
        }
        LabelOpMsg.Text = StringDef.OperationSucceed + StringDef.Colon + StringDef.Unfreeze + StringDef.Role + StringDef.Account + num + StringDef.Unit;
    }
Exemplo n.º 3
0
    protected void LinkButtonSetPassword_Click(object sender, EventArgs e)
    {
        string accountName = TextBoxInputAccount.Text.Trim();

        if (accountName.Length == 0)
        {
            LabelOpMsg.Text = string.Format(StringDef.MsgCannotBeNone, StringDef.Account);
            return;
        }
        string accountPassword = TextBoxInputPassword.Text;

        if (accountPassword.Length == 0)
        {
            LabelOpMsg.Text = string.Format(StringDef.MsgCannotBeNone, StringDef.Password);
            return;
        }
        FSEye.PaySysLib.OperationResult result = TheAdminServer.PaySysAgent.SetPassword(accountName, accountPassword, false);
        LabelOpMsg.Text = result.ToString();
    }