/// <summary> /// 执行操作 /// </summary> /// <param name="prmServerIP"></param> /// <param name="userAccount"></param> /// <param name="prmServiceKey"></param> public void DoAction(string prmServerIP, string userAccount, C_Global.CEnum.ServiceKey prmServiceKey) { try { C_Global.CEnum.Message_Body[] messageBody = new C_Global.CEnum.Message_Body[3]; messageBody[0].eTag = C_Global.CEnum.TagFormat.TLV_INTEGER; messageBody[0].eName = C_Global.CEnum.TagName.UserByID; messageBody[0].oContent = int.Parse(m_ClientEvent.GetInfo("USERID").ToString()); messageBody[1].eTag = C_Global.CEnum.TagFormat.TLV_STRING; messageBody[1].eName = C_Global.CEnum.TagName.MJ_ServerIP; messageBody[1].oContent = prmServerIP; messageBody[2].eTag = C_Global.CEnum.TagFormat.TLV_STRING; messageBody[2].eName = C_Global.CEnum.TagName.MJ_Account; messageBody[2].oContent = userAccount; mResult = m_ClientEvent.RequestResult(prmServiceKey, C_Global.CEnum.Msg_Category.MJ_ADMIN, messageBody); //检测状态 if (mResult[0, 0].eName == C_Global.CEnum.TagName.ERROR_Msg) { MessageBox.Show(mResult[0, 0].oContent.ToString()); //Application.Exit(); return; } else if (mResult[0, 0].oContent.Equals("FAILURE")) { MessageBox.Show("操作失败"); return; } else { MessageBox.Show("帐号" + userAccount + _actionType + "操作完成!"); return; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public bool DoAction(string prmServerIP, string userAccount, C_Global.CEnum.ServiceKey prmServiceKey, bool canViewError) { bool returnValue = true; try { C_Global.CEnum.Message_Body[] messageBody = new C_Global.CEnum.Message_Body[3]; messageBody[0].eTag = C_Global.CEnum.TagFormat.TLV_INTEGER; messageBody[0].eName = C_Global.CEnum.TagName.UserByID; messageBody[0].oContent = int.Parse(m_ClientEvent.GetInfo("USERID").ToString()); messageBody[1].eTag = C_Global.CEnum.TagFormat.TLV_STRING; messageBody[1].eName = C_Global.CEnum.TagName.MJ_ServerIP; messageBody[1].oContent = prmServerIP; messageBody[2].eTag = C_Global.CEnum.TagFormat.TLV_STRING; messageBody[2].eName = C_Global.CEnum.TagName.MJ_Account; messageBody[2].oContent = userAccount; searchFrmResult = m_ClientEvent.RequestResult(prmServiceKey, C_Global.CEnum.Msg_Category.MJ_ADMIN, messageBody); //检测状态 if (searchFrmResult[0, 0].oContent.Equals("FAILURE")) { returnValue = false; } else { //MessageBox.Show("帐号" + userAccount + _actionType + "操作完成!"); returnValue = true; } } catch (Exception ex) { MessageBox.Show(ex.Message); } return(returnValue); }
private void btnOK_Click(object sender, EventArgs e) { if (this.serverIP.Text == "") { MessageBox.Show("请选择服务器"); this.serverIP.Focus(); return; } if (this.actionType.Text == "") { MessageBox.Show("请选择操作"); this.actionType.Focus(); return; } if (this.userName.Text == "") { MessageBox.Show("请输入玩家帐号"); this.userName.Focus(); return; } _actionType = this.actionType.Text.Trim(); _userName = this.userName.Text.Trim(); #region 查询ip for (int i = 0; i < this.serverIPResult.GetLength(0); i++) { if (serverIPResult[i, 1].oContent.ToString().Trim().Equals(this.serverIP.Text.Trim())) { this._serverIP = serverIPResult[i, 0].oContent.ToString(); } } #endregion #region servicekey switch (_actionType) { case "解封帐号": _actionServiceKey = CEnum.ServiceKey.MJ_ACCOUNT_REMOTE_RESTORE; break; case "永久封停": if (SaveAccountToLocal()) { _actionServiceKey = CEnum.ServiceKey.MJ_ACCOUNT_REMOTE_DELETE; } else { MessageBox.Show("封停失败"); return; } break; } #endregion try { DoAction(_serverIP, _userName, _actionServiceKey); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void search_Click(object sender, EventArgs e) { if (this.serverIP.Text == null || this.serverIP.Text == "") { MessageBox.Show("请选择要查看的区域"); return; } if (this.userType.Text == null || this.userType.Text == "") { MessageBox.Show("请选择角色类型"); return; } if (this.orderType.Text == null || this.orderType.Text == "") { MessageBox.Show("请选择排名类型"); return; } //更新界面 this.listViewSortOrder.Items.Clear(); this.search.Enabled = false; Status.WriteStatusText(_parent, "正在读取\"" + this.serverIP.Text + this.userType.Text + this.orderType.Text + "\"排行榜数据,请等待..."); _srhUserType = this.userType.Text.Trim(); _srhOrderType = this.orderType.Text.Trim(); #region 查询ip for (int i = 0; i < this.serverIPResult.GetLength(0); i++) { if (serverIPResult[i, 1].oContent.ToString().Trim().Equals(this.serverIP.Text.Trim())) { this._srhServerIP = serverIPResult[i, 0].oContent.ToString(); } } #endregion #region 获取ServiceKey switch (_srhOrderType) { case "金钱": switch (_srhUserType) { case "所有职业": _srhServiceKey = CEnum.ServiceKey.MJ_MONEYSORT_QUERY; break; case "战士": _srhServiceKey = CEnum.ServiceKey.MJ_MONEYFIGHTERSORT_QUERY; break; case "法师": _srhServiceKey = CEnum.ServiceKey.MJ_MONEYRABBISORT_QUERY; break; case "道士": _srhServiceKey = CEnum.ServiceKey.MJ_MONEYTAOISTSORT_QUERY; break; } break; case "等级": switch (_srhUserType) { case "所有职业": _srhServiceKey = CEnum.ServiceKey.MJ_LEVELSORT_QUERY; break; case "战士": _srhServiceKey = CEnum.ServiceKey.MJ_LEVELFIGHTERSORT_QUERY; break; case "法师": _srhServiceKey = CEnum.ServiceKey.MJ_LEVELRABBISORT_QUERY; break; case "道士": _srhServiceKey = CEnum.ServiceKey.MJ_LEVELTAOISTSORT_QUERY; break; } break; } #endregion thread1 = new Thread(new ThreadStart(InitializeListView)); thread1.Start(); }