Ejemplo n.º 1
0
        /// <summary>
        /// 帐户/角色封停,帐户:1,角色:2
        /// </summary>
        public static string URlock(string UserOrRole, string taskid, string locktype)
        {
            if (!WinUtil.IsNumber(taskid) || !WinUtil.IsNumber(locktype))
            {
                return("命令传输错误");
            }
            try
            {
                int uorr = Convert.ToInt32(UserOrRole);

                string sql = @"SELECT F_GameName,F_GameBigZone,F_GUserID,F_GUserName,F_GRoleID,F_GRoleName FROM T_Tasks where F_ID= " + taskid;

                DataSet ds = DbHelperSQL.Query(sql);

                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    return("此工单已经不存在");
                }

                DataRow dr = ds.Tables[0].Rows[0];

                string url = GetWebServUrl(dr["F_GameName"].ToString(), dr["F_GameBigZone"].ToString());
                if (url.Trim().Length == 0)
                {
                    return("服务器:WEBSERVICE地址配置不正确");
                }
                else
                {
                    webserv.Url         = url;
                    webserv.Credentials = System.Net.CredentialCache.DefaultCredentials;
                }

                sql = @"SELECT F_ID,F_ParentID,F_Name,F_Value,F_IsUsed,F_Sort FROM T_GameConfig where F_ID=" + locktype;

                DataSet dsc = DbHelperSQL.Query(sql);

                if (dsc == null)
                {
                    return("服务器WEBSERVICE配置错误");
                }

                DataRow drc = dsc.Tables[0].Rows[0];

                string reback = "";
                if (uorr == 1)
                {
                    reback = webserv.SetUserLock(dr["F_GUserID"].ToString(), dr["F_GUserName"].ToString(), locktype, drc["F_Value"].ToString());
                }
                else if (uorr == 2)
                {
                    reback = webserv.SetRoleLock(dr["F_GRoleID"].ToString(), dr["F_GRoleName"].ToString(), locktype, drc["F_Value"].ToString());
                }
                return(reback);
            }
            catch (System.Exception ex)
            {
                ShareData.Log.Error(ex);
                return(ex.Message);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 删除全服邮件
 /// </summary>
 public static string DeleteFullServiceEmail(string taskid)
 {
     if (!WinUtil.IsNumber(taskid))
     {
         return("命令传输错误");
     }
     try
     {
         string  reback = string.Empty;
         string  sql    = @"SELECT F_GameName,F_URInfo,F_TUseData FROM T_Tasks  WITH(NOLOCK)  where F_ID= " + taskid + "";
         DataSet ds     = DbHelperSQL.Query(sql);
         if (ds == null || ds.Tables[0].Rows.Count == 0)
         {
             return("此工单已经不存在");
         }
         string str1 = "DELETE FROM OPENQUERY (LKSV_GSS_7_gspara_db_0_1,'SELECT * FROM sys_loss_award_table WHERE DBID=" + taskid + "' )";
         string str2 = "DELETE FROM dbo.T_Tasks WHERE F_ID=" + taskid;
         int    res  = DbHelperSQL.ExecuteSql(str1);
         int    res1 = DbHelperSQL.ExecuteSql(str2);
         if (res1 > 0)
         {
             reback = "true";
         }
         else
         {
             reback = "false";
         }
         return(reback);
     }
     catch (System.Exception ex)
     {
         ShareData.Log.Error(ex);
         return(ex.Message);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 帐户/角色解封,帐户:1,角色:2
        /// </summary>
        public static string URNolock(string UserOrRole, string taskid)
        {
            if (!WinUtil.IsNumber(taskid))
            {
                return("命令传输错误");
            }
            try
            {
                string.Format("unlock action is  user or role (1->user,2->role ),input=[{0}]", UserOrRole);
                int uorr = Convert.ToInt32(UserOrRole);

                string sql = @"SELECT F_GameName,F_GameBigZone,F_GUserID,F_GUserName,F_GRoleID,F_GRoleName FROM T_Tasks  WITH(NOLOCK)  where F_ID= " + taskid + "";

                DataSet ds = DbHelperSQL.Query(sql);

                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    return("此工单已经不存在");
                }
                DataRow dr = ds.Tables[0].Rows[0];

                string url = GetWebServUrl(dr["F_GameName"].ToString(), dr["F_GameBigZone"].ToString());
                string.Format("url->{0}", url).Logger();
                if (url.Trim().Length == 0)
                {
                    return("服务器:WEBSERVICE地址配置不正确");
                }
                else
                {
                    webserv.Url         = url;
                    webserv.Credentials = System.Net.CredentialCache.DefaultCredentials;
                }

                string reback = string.Empty;
                if (uorr == 1)
                {
                    "will unlock user unlock".Logger();
                    reback = webserv.SetUserNoLock(dr["F_GUserID"].ToString());
                }
                else if (uorr == 2)
                {
                    "will unlock role unlock".Logger();
                    reback = webserv.SetRoleNoLock(dr["F_GRoleID"].ToString());
                }
                string.Format("response result:{0}", reback).Logger();
                return(reback);
            }
            catch (System.Exception ex)
            {
                ex.Message.Logger();
                ShareData.Log.Error(ex);
                return(ex.Message);
            }
        }
        /// <summary>
        /// 检查提交的数据
        /// </summary>
        private bool CheckData()
        {
            string msg = "";

            if (comboBoxZoneList.SelectedIndex == 0)
            {
                msg += "请选择要查询的战区\n";
            }
            //SQL语句查询
            if (labelTool0.BorderStyle == BorderStyle.Fixed3D)
            {
                if (RichTextBoxSql.Text.Trim().Length == 0 || !CheckQuerySql(RichTextBoxSql.Text.Trim()))
                {
                    msg += "SQL查询命令不正确\n";
                }
            }
            //FDBI查询
            if (labelTool3.BorderStyle == BorderStyle.Fixed3D)
            {
                if (comboBoxType0.SelectedIndex == 0)
                {
                    msg += "请选择查询类型\n";
                }


                if (tboxUID.Text.Length > 0 && !WinUtil.IsNumber(tboxUID.Text))
                {
                    msg += "帐号UID应该为数字\n";
                }
                if (tboxCID.Text.Length > 0 && !WinUtil.IsNumber(tboxCID.Text))
                {
                    msg += "角色CID应该为数字\n";
                }
                if (tboxPARA_1.Text.Length > 0 && !WinUtil.IsNumber(tboxPARA_1.Text))
                {
                    msg += "参数1应该为数字\n";
                }
                if (tboxPARA_2.Text.Length > 0 && !WinUtil.IsNumber(tboxPARA_2.Text))
                {
                    msg += "参数2应该为数字\n";
                }
            }

            if (msg.Length > 0)
            {
                MsgBox.Show(msg, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return(false);
            }
            else
            {
                return(true);
            }
        }
Ejemplo n.º 5
0
 private void textBoxTs_TextChanged(object sender, EventArgs e)
 {
     textBoxTs.Text = textBoxTs.Text.Trim();
     if (textBoxTs.Text.IndexOf("0") == 0 && textBoxTs.Text.Length > 1)
     {
         textBoxTs.Text = textBoxTs.Text.Substring(1);
     }
     if (textBoxTs.Text.Length > 0 && !WinUtil.IsNumber(textBoxTs.Text))
     {
         textBoxTs.Text = "0";
     }
 }
Ejemplo n.º 6
0
        /// <summary>
        /// 公告工具:发奖工具
        /// </summary>
        public static string GameGiftAwardDo(string taskid)
        {
            if (!WinUtil.IsNumber(taskid))
            {
                return("命令传输错误");
            }
            try
            {
                string sql = @"SELECT F_GameName,F_GameBigZone,F_URInfo,F_TUseData,F_TToolUsed,F_COther FROM T_Tasks  WITH(NOLOCK)  where F_ID= " + taskid + "";

                DataSet ds = DbHelperSQL.Query(sql);

                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    return("此工单已经不存在");
                }
                if (ds.Tables[0].Rows[0]["F_TToolUsed"].ToString() == "True")
                {
                    return("此工单下的发奖信息已经执行");
                }
                DataRow dr = ds.Tables[0].Rows[0];

                string giftstr = dr["F_COther"].ToString();

                byte[] dsuser = (byte[])GSSCSFrameWork.DataSerialize.GetObjectFromString(dr["F_URInfo"].ToString());
                if (dsuser == null)
                {
                    return("工单中的游戏用户列表为空");
                }



                string url = GetWebServUrl(dr["F_GameName"].ToString(), dr["F_GameBigZone"].ToString());
                if (url.Trim().Length == 0)
                {
                    return("GSS服务器:WEBSERVICE地址配置不正确;");
                }
                else
                {
                    webserv.Url         = url;
                    webserv.Credentials = System.Net.CredentialCache.DefaultCredentials;
                    return(webserv.GameGiftAwardDoFor5Num(taskid, giftstr, dsuser));
                }
            }
            catch (System.Exception ex)
            {
                ShareData.Log.Error(ex);
                return(ex.Message);
            }
        }
Ejemplo n.º 7
0
        private void buttonCode_Click(object sender, EventArgs e)
        {
            if (buttonCode.Text == LanguageResource.Language.LblPreview)
            {
                buttonCode.Text = LanguageResource.Language.LblEdit;
                CodeStr         = aRichTextBoxCode.Text;
                //转换颜色
                string codeBeginStr = "";
                string colorlistStr = "";
                string Gnotice      = aRichTextBoxCode.Text.Replace("\n", "\\par").Replace("&199", "}");
                System.Collections.ArrayList colorlist = new System.Collections.ArrayList();

                for (int i = 0; i < Gnotice.Length - 10; i++)
                {
                    if (Gnotice.Substring(i, 2) == "&2")
                    {
                        codeBeginStr = Gnotice.Substring(i + 2, 9);
                        if (WinUtil.IsNumber(codeBeginStr))
                        {
                            colorlist.Add(codeBeginStr);
                        }
                    }
                }
                int colorindex = 4;
                foreach (object colora in colorlist)
                {
                    colorlistStr += "\\red" + colora.ToString().Substring(0, 3) + "\\green" + colora.ToString().Substring(3, 3) + "\\blue" + colora.ToString().Substring(6, 3) + ";";
                    Gnotice       = Gnotice.Replace("&2" + colora.ToString(), @"{\cf" + colorindex.ToString());
                    colorindex++;
                }


                changStrColor = @"{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset134 \'cb\'ce\'cc\'e5;}}{\colortbl ;\red255\green0\blue0;\red30\green20\blue160;\red80\green200\blue60;" + colorlistStr + @"}\viewkind4\uc1\pard\li300\lang2052\f0\fs18 " + Gnotice;

                changStrColor       += @"}";
                aRichTextBoxCode.RTF = changStrColor;
            }
            else
            {
                buttonCode.Text       = LanguageResource.Language.LblPreview;
                aRichTextBoxCode.Text = CodeStr;
            }
            aRichTextBoxCode.TextChangeds += new GSSUI.AControl.ARichTextBox.ARichTextBoxE.TextChangedkEventHandler(this.aRichTextBoxCode_TextChanged);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 清空防沉迷
        /// </summary>
        public static string GameResetChildInfo(string taskid)
        {
            if (!WinUtil.IsNumber(taskid))
            {
                return("命令传输错误");
            }
            try
            {
                string sql = @"SELECT F_GameName,F_GameBigZone,F_GUserID,F_GUserName,F_GRoleID,F_GRoleName FROM T_Tasks  WITH(NOLOCK)  where F_ID= " + taskid + "";

                DataSet ds = DbHelperSQL.Query(sql);

                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    return("此工单已经不存在");
                }
                DataRow dr = ds.Tables[0].Rows[0];

                string url = GetWebServUrl(dr["F_GameName"].ToString(), dr["F_GameBigZone"].ToString());
                if (url.Trim().Length == 0)
                {
                    return("服务器:WEBSERVICE地址配置不正确");
                }
                else
                {
                    webserv.Url         = url;
                    webserv.Credentials = System.Net.CredentialCache.DefaultCredentials;
                }

                string reback = "";

                reback = webserv.ClearChildDisInfo(dr["F_GUserID"].ToString());

                return(reback);
            }
            catch (System.Exception ex)
            {
                ShareData.Log.Error(ex);
                return(ex.Message);
            }
        }
        /// <summary>
        /// 服务端数据保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                string gssip   = cbGSSip.Text;
                string gssport = tPort.Text.Trim();
                if (!WinUtil.isIpaddres(gssip))
                {
                    MessageBox.Show("服务器IP地址格式不正确!");
                    return;
                }
                if (!WinUtil.IsNumber(gssport))
                {
                    MessageBox.Show("服务器端口号应该为数字!");
                    return;
                }

                string sql = "UPDATE GSSCONFIG SET GSSIP='" + gssip + "',GSSPORT='" + gssport + "'WHERE ID=1";
                int    row = DbHelperSQLite.ExecuteSql(sql);
                if (row >= 1)
                {
                    MessageBox.Show("服务端参数保存成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("服务端参数保存失败!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (System.Exception ex)
            {
                ex.ToString().ErrorLogger();
                MessageBox.Show("服务端参数提交失败!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //日志记录
                ShareData.Log.Warn("服务端参数提交失败!" + ex.Message);
            }
        }
 /// <summary>
 /// 保存网络配置
 /// </summary>
 private void SaveConfig()
 {
     try
     {
         string gssip   = tGSSIP.Text;
         string gssport = tPort.Text.Trim();
         if (!WinUtil.isIpaddres(gssip))
         {
             MsgBox.Show(LanguageResource.Language.Tip_ErrorServiceIPFormat);
             return;
         }
         if (!WinUtil.IsNumber(gssport))
         {
             MsgBox.Show(LanguageResource.Language.Tip_PortShouldNumber);
             return;
         }
         string sql = "UPDATE GSSCONFIG SET GSSIP='" + gssip + "',GSSPORT='" + gssport + "'WHERE ID=1";
         int    row = DbHelperSQLite.ExecuteSql(sql);
         if (row >= 1)
         {
             MsgBox.Show(LanguageResource.Language.Tip_SuccessSaveNetConfig, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
             SetConfigView();
         }
         else
         {
             MsgBox.Show(LanguageResource.Language.Tip_ErrorSaveNetConfig, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (System.Exception ex)
     {
         ex.ToString().ErrorLogger();
         MsgBox.Show(LanguageResource.Language.Tip_ErrorSaveNetConfigTip, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
         //日志记录
         ShareData.Log.Error(ex);
     }
 }
Ejemplo n.º 11
0
        /// <summary>
        /// 公告工具:停止公告
        /// </summary>
        public static string GameNoticeStop(string taskid)
        {
            if (!WinUtil.IsNumber(taskid))
            {
                return("命令传输错误");
            }
            try
            {
                string sql = @"SELECT F_GameName,F_URInfo,F_TUseData FROM T_Tasks  WITH(NOLOCK)  where F_ID= " + taskid + "";

                DataSet ds = DbHelperSQL.Query(sql);

                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    return("此工单已经不存在");
                }
                DataRow dr = ds.Tables[0].Rows[0];

                string   area    = dr["F_TUseData"].ToString();
                string[] TareaAs = area.Split('|');
                foreach (string TareaA in TareaAs)
                {
                    string[] TareaBs = TareaA.Split(',');
                    if (TareaBs.Length != 3)
                    {
                        return("公告范围参数不正确");
                    }
                }

                string   reback = "";
                string[] areaAs = area.Split('|');
                foreach (string areaA in areaAs)
                {
                    string[] areaBs = areaA.Split(',');
                    if (areaBs.Length == 3)
                    {
                        reback += "游戏大区" + areaBs[0] + ">>";
                        string url = GetWebServUrlID(dr["F_GameName"].ToString(), areaBs[0]);
                        if (url.Trim().Length == 0)
                        {
                            reback += "服务器:WEBSERVICE地址配置不正确;";
                        }
                        else
                        {
                            webserv.Url         = url;
                            webserv.Credentials = System.Net.CredentialCache.DefaultCredentials;
                            reback += webserv.GameNoticeStop(taskid);
                        }
                    }
                }
                if (reback.Replace("true", "成功").Length + areaAs.Length * 2 == reback.Length)
                {
                    reback = "true";
                }
                return(reback);
            }
            catch (System.Exception ex)
            {
                ShareData.Log.Error(ex);
                return(ex.Message);
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 提交工单
        /// </summary>
        private void CommitTask()
        {
            GSSModel.Tasks model  = GetTaskData();
            string         strErr = "";

            if (model.F_Title.Length == 0)
            {
                strErr += "公告工单标题不能为空!\n";
            }
            if (model.F_GPeopleName.Length == 0)
            {//在公告数据中是将发起人的数据存储到玩家信息中
                strErr += LanguageResource.Language.LblInitiatorNameIsRequire + "!\n";
            }
            //edit hexw 2017-9-18 取消电话号码必须
            //if (model.F_Telphone.Trim().Length == 0)
            //{
            //    // strErr += LanguageResource.Language.LblTelNotAllowBlank + "!\n";
            //}
            //else if (!WinUtil.IsTelphone(model.F_Telphone) && !WinUtil.IsMobile(model.F_Telphone))
            //{
            //    strErr += LanguageResource.Language.LblTelFormIsError + "!\n(格式:010-88886666或13912341234)\n";
            //}

            if (string.IsNullOrEmpty(model.F_URInfo))
            {
                strErr += LanguageResource.Language.Tip_NoticeMessgaeIsRequired + "!\n";
            }
            else if (model.F_URInfo.Length > 300)
            {
                strErr += LanguageResource.Language.Tip_LimitNoticeMsgLength + "\r\n";
            }
            if (model.F_TUseData.Trim().Length == 0)
            {
                strErr += "请选择接收范围!\n";
            }
            int row = 1;

            foreach (string sstr in aRichTextBoxCode.Lines)
            {
                string[] param = sstr.Split('|');
                if (param.Length != 6)
                {
                    strErr += "公告内容:行" + row + "需要6个参数!\n";
                }
                else
                {
                    if (param[1].Split(',').Length != 2)
                    {
                        strErr += "公告内容:行" + row + "参数2格式不正确!\n";
                    }
                    else
                    {
                        if (!WinUtil.IsNumber(param[1].Split(',')[0]) || !WinUtil.IsNumber(param[1].Split(',')[1]))
                        {
                            strErr += "公告内容:行" + row + "参数2格式不正确!\n";
                        }
                    }
                    if (!WinUtil.IsNumber(param[2]))
                    {
                        strErr += "公告内容:行" + row + "参数3格式不正确!\n";
                    }
                    if (!WinUtil.IsDateTime(param[3]))
                    {
                        strErr += "公告内容:行" + row + "参数4格式不正确!\n";
                    }
                    if (!WinUtil.IsDateTime(param[4]))
                    {
                        strErr += "公告内容:行" + row + "参数5格式不正确!\n";
                    }
                    if (!WinUtil.IsNumber(param[5]))
                    {
                        strErr += "公告内容:行" + row + "参数6格式不正确!\n";
                    }
                }
                row++;
            }

            if (model.F_Note.Trim().Length == 0)
            {
                strErr += LanguageResource.Language.Tip_RemarkNoEmpty + "!\n";
            }
            if (strErr != "")
            {
                MsgBox.Show(strErr, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            string backStr = _clienthandle.AddTaskSyn(model);

            ComitDoControl(true);
            if (backStr == "0")
            {
                MsgBox.Show(LanguageResource.Language.Tip_WorkOrderCreateFailure, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                MsgBox.Show(LanguageResource.Language.Tip_WorkOrderCreateSucc + "!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                _taskid = backStr;
                this.Close();
            }
        }