private void btnDosure_Click(object sender, EventArgs e)
        {
            if (rtboxNote.Text.Trim().Length == 0)
            {
                MsgBox.Show("工具使用备注不能为空!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            try
            {
                ComitDoControl(false);


                int          bigzoneid   = Convert.ToInt32(ClientCache.GetBigZoneGameID(_model.F_GameBigZone));
                string       bigzoneCFID = ClientCache.GetGameConfigID(_model.F_GameBigZone);
                int          zoneid      = Convert.ToInt32(ClientCache.GetZoneGameID(bigzoneCFID, _model.F_GameZone));
                string       sql         = string.Format("update OPENQUERY ([LKSV] ,'select * from T_Role_Base where F_ID={0} and F_UserID={1}')  set F_DepotPass='******'", _model.F_GRoleID, _model.F_GUserID);
                GSSBLL.Tasks bll         = ClientRemoting.Tasks();
                int          result      = bll.GSSTool_CustomExec(bigzoneid, zoneid, 6, sql);

                string info = "";
                if (result != 0)
                {
                    info = "操作执行成功";
                }
                else
                {
                    info = "此角色已经不存在";
                }


                GSSModel.Tasks task = new GSSModel.Tasks();
                task.F_ID        = _model.F_ID;
                task.F_EditMan   = int.Parse(ShareData.UserID);
                task.F_EditTime  = DateTime.Now;
                task.F_TToolUsed = true;
                task.F_TUseData  = string.Format("角色二级密码清空工具 \n{0} \n{1}", lblUR.Text, info);
                task.F_Note      = rtboxNote.Text;
                _isToolUsed      = true;
                bll.Edit(task);

                MsgBox.Show(info, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);

                if (result != 0)
                {
                    this.Close();
                }
            }
            catch (System.Exception ex)
            {
                ShareData.Log.Warn(ex);
                MsgBox.Show(ex.Message, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            finally
            {
                ComitDoControl(true);
            }
        }
        private void btnDosure_Click(object sender, EventArgs e)
        {
            if (rtboxNote.Text.Trim().Length == 0)
            {
                MsgBox.Show("工具使用备注不能为空!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            try
            {
                ComitDoControl(false);


                int userid = Convert.ToInt32(_model.F_GUserID);


                if (userid.ToString().Length == 0)
                {
                    MsgBox.Show("用户都不能为空!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }


                GSSServerLibrary.ServerRemoteLib remote = ClientRemoting.ServerRemoteLib();
                string resultStr = remote.UserRoleClearOnline("寻龙记", _model.F_GameBigZone, userid);

                GSSBLL.Tasks   bll  = ClientRemoting.Tasks();
                GSSModel.Tasks task = new GSSModel.Tasks();
                task.F_ID        = _model.F_ID;
                task.F_EditMan   = int.Parse(ShareData.UserID);
                task.F_EditTime  = DateTime.Now;
                task.F_TToolUsed = true;
                task.F_TUseData  = string.Format("帐号/角色清除在线状态工具 \n{0} \n{1}", lblUR.Text, resultStr);
                task.F_Note      = rtboxNote.Text;
                _isToolUsed      = true;
                bll.Edit(task);

                MsgBox.Show(resultStr, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);

                if (resultStr.IndexOf("成功") != -1)
                {
                    this.Close();
                }
            }
            catch (System.Exception ex)
            {
                ShareData.Log.Warn(ex);
                MsgBox.Show(ex.Message, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            finally
            {
                ComitDoControl(true);
            }
        }
示例#3
0
        public DataSet GSSMSGList(string roleid)
        {
            if (!VerifyRemoteServiceIP(GetIP4Address()))
            {
                Log.Info("GSSTaskAdd,非法请求,请求IP:" + GetIP4Address() + "");
                return(null);
            }

            roleid = roleid.Replace("'", "’").Replace(",", ",");

            if (!CheckQuerySql(roleid))
            {
                Log.Info("GSSTaskAdd,非法请求(PARAMETER) ,请求IP:" + GetIP4Address() + "");
                return(null);
            }
            try
            {
                DbHelperSQLP sp = new DbHelperSQLP();
                sp.connectionString = ConnStrGSSDB;
                GSSServerLibrary.DBHandle db = new GSSServerLibrary.DBHandle(ConnStrGSSDB);
                DataSet ds = db.GetTaskLog(" and F_Rowtype=6 and F_OCanRestor is null and F_Note is not null and F_ID in (select F_ID from T_Tasks with(nolock) where  F_GRoleID=" + roleid + " and F_Type=20000216)", sp);

                try
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        if (dr["F_EditMan"].ToString().Length != 0 && dr["F_OCanRestor"].ToString() == "")
                        {
                            GSSModel.Tasks model = new GSSModel.Tasks();
                            model.F_ID         = Convert.ToInt32(dr["F_ID"]);
                            model.F_OCanRestor = true;
                            db.EditTaskLog(model, sp);
                        }
                    }
                }
                catch (System.Exception ex)
                {
                }
                return(ds);
            }
            catch (System.Exception ex)
            {
                Log.Warn("执行了GSSTaskAdd,请求IP:" + GetIP4Address() + "", ex);
                return(null);
            }
        }
        /// <summary>
        /// 窗口之间消息
        /// </summary>
        /// <param name="m"></param>
        protected override void DefWndProc(ref System.Windows.Forms.Message m)
        {
            switch (m.Msg)
            {
            case 601:
                this.Activate();
                if (_taskid == null || _taskid.Trim().Length == 0)
                {
                    ComitDoControl(true);
                    return;
                }
                string msg = ShareData.Msg[m.WParam.ToInt32()].ToString();    //分为两段,FORM编号+返回结果(字符串:true或错误结果)

                GSSModel.Tasks task = new GSSModel.Tasks();
                task.F_ID        = int.Parse(_taskid);
                task.F_EditMan   = int.Parse(ShareData.UserID);
                task.F_EditTime  = DateTime.Now;
                task.F_TToolUsed = true;
                task.F_TUseData  = "解封工具-" + (_LockUorR == 1 ? "帐号解封" : "角色解封") + "\n" + lblUR.Text + "\n";
                task.F_Note      = rtboxNote.Text;
                _isToolUsed      = true;
                if (msg == "true")
                {
                    task.F_TUseData += " 解封成功!";
                    _clihandle.EditTaskNoReturn(task);
                    MsgBox.Show(string.Format(LanguageResource.Language.Tip_UnlockSuccFormat, lblUR.Text), LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);

                    this.Close();
                }
                else
                {
                    task.F_TUseData += " 解封失败!" + msg;
                    MsgBox.Show(string.Format(LanguageResource.Language.Tip_UnlockFailureFormat, lblUR.Text) + msg, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    _clihandle.EditTaskNoReturn(task);
                    ComitDoControl(true);
                }

                base.DefWndProc(ref m);
                break;

            default:
                base.DefWndProc(ref m);
                break;
            }
        }
示例#5
0
        private void btnDosure_Click(object sender, EventArgs e)
        {
            //MsgBox.Show("功能完善中,暂停使用!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //return;
            if (rtboxNote.Text.Trim().Length == 0)
            {
                MsgBox.Show("工具使用备注不能为空!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            try
            {
                ComitDoControl(false);

                string newRoleName = tboxNewRoleName.Text.Trim();
                int    userid      = Convert.ToInt32(_model.F_GUserID);
                int    roleid      = Convert.ToInt32(_model.F_GRoleID);

                if (userid.ToString().Length == 0 || roleid.ToString().Length == 0)
                {
                    MsgBox.Show("用户和角色都不能为空!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (newRoleName.Length < 2 || newRoleName.Length > 7)
                {
                    MsgBox.Show("新的角色名不能小于2位,大于7位!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                GSSServerLibrary.ServerRemoteLib remote = ClientRemoting.ServerRemoteLib();
                string resultStr = remote.RoleNameChange("寻龙记", _model.F_GameBigZone, userid, roleid, _model.F_GRoleName, newRoleName);

                GSSBLL.Tasks   bll  = ClientRemoting.Tasks();
                GSSModel.Tasks task = new GSSModel.Tasks();
                task.F_ID        = _model.F_ID;
                task.F_EditMan   = int.Parse(ShareData.UserID);
                task.F_EditTime  = DateTime.Now;
                task.F_TToolUsed = true;
                task.F_TUseData  = string.Format("角色改名工具 \n{0} \n新名:{1} \n{2}", lblUR.Text, newRoleName, resultStr);
                task.F_Note      = rtboxNote.Text;
                _isToolUsed      = true;
                bll.Edit(task);

                MsgBox.Show(resultStr, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);

                if (resultStr.IndexOf("成功") != -1)
                {
                    this.Close();
                }
            }
            catch (System.Exception ex)
            {
                ShareData.Log.Warn(ex);
                MsgBox.Show(ex.Message, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            finally
            {
                ComitDoControl(true);
            }
        }
示例#6
0
        public string GSSTaskAdd(string type, string note, string qq, string mobile, string gdata, string file)
        {
            if (!VerifyRemoteServiceIP(GetIP4Address()))
            {
                Log.Info("GSSTaskAdd,非法请求,请求IP:" + GetIP4Address() + "");
                return("非法请求,将拒绝对此请求提供服务");
            }

            type   = type.Replace("'", "’").Replace(",", ",");
            note   = note.Replace("'", "’").Replace(",", ",");
            qq     = qq.Replace("'", "’").Replace(",", ",");
            mobile = mobile.Replace("'", "’").Replace(",", ",");
            gdata  = gdata.Replace("'", "’").Replace(",", ",");
            file   = file.Replace("'", "’").Replace(",", ",");

            if (!CheckQuerySql(note) || !CheckQuerySql(type) || !CheckQuerySql(qq) || !CheckQuerySql(mobile) || !CheckQuerySql(gdata) | !CheckQuerySql(file))
            {
                Log.Info("GSSTaskAdd,非法请求(PARAMETER) ,请求IP:" + GetIP4Address() + "");
                return("非法请求,将拒绝对此请求提供服务(PARAMETER)");
            }
            try
            {
                GSSModel.Tasks task = new GSSModel.Tasks();

                string[] ps = gdata.Split('|');

                task.F_GameName = 1000;
                //task.F_GameBigZone = ps[6];
                task.F_GameBigZone = "第一大区";
                task.F_GameZone    = ps[8];

                task.F_GUserID   = ps[3];
                task.F_GUserName = ps[4];
                task.F_GRoleID   = ps[1];
                task.F_GRoleName = ps[2];



                task.F_URInfo = string.Format("用户编号:{0} 用户名称:{1} 角色编号:{2} 角色名称:{3} 大区名称:{4} 战区名称:{5} 战线:{6}\r\n--来自游戏内嵌反馈系统", task.F_GUserID, task.F_GUserName, task.F_GRoleID, task.F_GRoleName, task.F_GameBigZone, task.F_GameZone, ps[10]);

                task.F_Note     = "\n--- 来自游戏内嵌反馈系统\n 玩家联系方式\n 【QQ:" + qq + "】\n 【手机:" + mobile + "】\n";
                task.F_Note    += note;
                task.F_Telphone = mobile;

                if (ps.Length == 12)
                {
                    string gamedateStr = ps[11];
                    task.F_URInfo += "\r\n【游戏数据】" + gamedateStr;
                    task.F_Note   += "\r\n【游戏数据】" + gamedateStr;
                    if (gamedateStr.IndexOf("ClientIP:") >= 0)
                    {
                        string gip      = gamedateStr.Substring(gamedateStr.IndexOf("ClientIP:"), gamedateStr.Length - gamedateStr.IndexOf("ClientIP:")).Replace("ClientIP:", "");
                        string uaddress = GetIPLocation(gip);
                        task.F_URInfo += "\r\n【玩家地址】" + uaddress;
                        task.F_Note   += "\r\n【玩家地址】" + uaddress;
                    }
                }
                else if (ps.Length == 11)//游戏版本发出后删除此判断
                {
                    string gamedateStr = ps[10];
                    if (gamedateStr.IndexOf("ClientIP:") >= 0)
                    {
                        string gip = gamedateStr.Substring(gamedateStr.IndexOf("ClientIP:"), gamedateStr.Length - gamedateStr.IndexOf("ClientIP:")).Replace("ClientIP:", "");

                        task.F_URInfo += "\r\n【游戏数据】ClientIP:" + gip;
                        task.F_Note   += "\r\n【游戏数据】ClientIP:" + gip;

                        string uaddress = GetIPLocation(gip);
                        task.F_URInfo += "\r\n【玩家地址】" + uaddress;
                        task.F_Note   += "\r\n【玩家地址】" + uaddress;
                    }
                }

                task.F_CreatTime      = DateTime.Now;
                task.F_LimitTime      = DateTime.Now.AddDays(7);
                task.F_EditTime       = DateTime.Now;
                task.F_From           = 100103103;
                task.F_LimitType      = 100104107;
                task.F_OLastLoginTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                task.F_Rowtype        = 0;
                task.F_State          = 100100100;
                task.F_Type           = Convert.ToInt32(type);
                task.F_VipLevel       = 100105003;
                task.F_Title          = "来自游戏内嵌反馈系统";



                if (file.Trim().Length > 0)
                {
                    WebClient mywebclient  = new WebClient();
                    string    downfilepath = file;

                    string savepath = downfilepath.Replace("http://", "");
                    savepath = savepath.Substring(savepath.IndexOf('/'));
                    string savepathp = savepath.Replace(savepath.Substring(savepath.LastIndexOf("/")), "") + "/";

                    // string picurl = "http://" + HttpContext.Current.Request.Url.Host + ":" + HttpContext.Current.Request.Url.Port + savepath;

                    FileInfo finfo = new FileInfo(Server.MapPath("." + savepathp));
                    if (!finfo.Directory.Exists)
                    {
                        finfo.Directory.Create();
                    }
                    mywebclient.DownloadFile(downfilepath, Server.MapPath("." + savepath));

                    // task.F_TToolUsed = true;
                    task.F_TUseData = savepath;
                }



                DbHelperSQLP sp = new DbHelperSQLP();
                sp.connectionString = ConnStrGSSDB;
                int result = AddTask(task, sp);
                if (result == 0)
                {
                    Log.Info("执行了GSSTaskAdd,保存失败,请求IP:" + GetIP4Address() + "");
                    return("保存失败,数据ERROR");
                }
                else
                {
                    return("0");
                }
            }
            catch (System.Exception ex)
            {
                Log.Warn("执行了GSSTaskAdd,请求IP:" + GetIP4Address() + "", ex);
                return("执行异常GSSWebService" + ex.Message);
            }
        }
示例#7
0
        /// <summary>
        /// 增加工单
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public int AddTask(GSSModel.Tasks model, DbHelperSQLP sp)
        {
            int rowsAffected = 0;

            SqlParameter[] parameters =
            {
                new SqlParameter("@F_Title",          SqlDbType.NVarChar,   30),
                new SqlParameter("@F_Note",           SqlDbType.VarChar),
                new SqlParameter("@F_From",           SqlDbType.Int,         4),
                new SqlParameter("@F_VipLevel",       SqlDbType.Int,         4),
                new SqlParameter("@F_LimitType",      SqlDbType.Int,         4),
                new SqlParameter("@F_LimitTime",      SqlDbType.DateTime),
                new SqlParameter("@F_Type",           SqlDbType.Int,         4),
                new SqlParameter("@F_State",          SqlDbType.Int,         4),
                new SqlParameter("@F_GameName",       SqlDbType.Int,         4),
                new SqlParameter("@F_GameBigZone",    SqlDbType.NVarChar,   16),
                new SqlParameter("@F_GameZone",       SqlDbType.NVarChar,   16),
                new SqlParameter("@F_GUserID",        SqlDbType.NVarChar,   16),
                new SqlParameter("@F_GUserName",      SqlDbType.NVarChar,   16),
                new SqlParameter("@F_GRoleID",        SqlDbType.NVarChar,   16),
                new SqlParameter("@F_GRoleName",      SqlDbType.NVarChar,   16),
                new SqlParameter("@F_Telphone",       SqlDbType.NVarChar,   16),
                new SqlParameter("@F_GPeopleName",    SqlDbType.NVarChar,   16),
                new SqlParameter("@F_DutyMan",        SqlDbType.Int,         4),
                new SqlParameter("@F_PreDutyMan",     SqlDbType.Int,         4),
                new SqlParameter("@F_CreatMan",       SqlDbType.Int,         4),
                new SqlParameter("@F_CreatTime",      SqlDbType.DateTime),
                new SqlParameter("@F_EditMan",        SqlDbType.Int,         4),
                new SqlParameter("@F_EditTime",       SqlDbType.DateTime),
                new SqlParameter("@F_URInfo",         SqlDbType.VarChar),
                new SqlParameter("@F_Rowtype",        SqlDbType.TinyInt,     1),
                new SqlParameter("@F_CUserName",      SqlDbType.Bit,         1),
                new SqlParameter("@F_CPSWProtect",    SqlDbType.Bit,         1),
                new SqlParameter("@F_CPersonID",      SqlDbType.Bit,         1),
                new SqlParameter("@F_COther",         SqlDbType.VarChar,   500),
                new SqlParameter("@F_OLastLoginTime", SqlDbType.NVarChar,   50),
                new SqlParameter("@F_OCanRestor",     SqlDbType.Bit,         1),
                new SqlParameter("@F_OAlwaysPlace",   SqlDbType.NVarChar,   50),
                new SqlParameter("@F_TToolUsed",      SqlDbType.Bit,         1),
                new SqlParameter("@F_TUseData",       SqlDbType.VarChar),
                new SqlParameter("@F_ID",             SqlDbType.Int, 4)
            };
            parameters[0].Value      = model.F_Title;
            parameters[1].Value      = model.F_Note;
            parameters[2].Value      = model.F_From;
            parameters[3].Value      = model.F_VipLevel;
            parameters[4].Value      = model.F_LimitType;
            parameters[5].Value      = model.F_LimitTime;
            parameters[6].Value      = model.F_Type;
            parameters[7].Value      = model.F_State;
            parameters[8].Value      = model.F_GameName;
            parameters[9].Value      = model.F_GameBigZone;
            parameters[10].Value     = model.F_GameZone;
            parameters[11].Value     = model.F_GUserID;
            parameters[12].Value     = model.F_GUserName;
            parameters[13].Value     = model.F_GRoleID;
            parameters[14].Value     = model.F_GRoleName;
            parameters[15].Value     = model.F_Telphone;
            parameters[16].Value     = model.F_GPeopleName;
            parameters[17].Value     = model.F_DutyMan;
            parameters[18].Value     = model.F_PreDutyMan;
            parameters[19].Value     = model.F_CreatMan;
            parameters[20].Value     = model.F_CreatTime;
            parameters[21].Value     = model.F_EditMan;
            parameters[22].Value     = model.F_EditTime;
            parameters[23].Value     = model.F_URInfo;
            parameters[24].Value     = model.F_Rowtype;
            parameters[25].Value     = model.F_CUserName;
            parameters[26].Value     = model.F_CPSWProtect;
            parameters[27].Value     = model.F_CPersonID;
            parameters[28].Value     = model.F_COther;
            parameters[29].Value     = model.F_OLastLoginTime;
            parameters[30].Value     = model.F_OCanRestor;
            parameters[31].Value     = model.F_OAlwaysPlace;
            parameters[32].Value     = model.F_TToolUsed;
            parameters[33].Value     = model.F_TUseData;
            parameters[34].Direction = ParameterDirection.Output;

            try
            {
                sp.RunProcedure("GSS_Tasks_ADD", parameters, out rowsAffected);
                int id = (int)parameters[34].Value;
                return(id);
            }
            catch (System.Exception ex)
            {
                return(0);
            }
        }
示例#8
0
        public string GSSMSGAdd(string note, string gdata)
        {
            if (!VerifyRemoteServiceIP(GetIP4Address()))
            {
                Log.Info("GSSTaskAdd,非法请求,请求IP:" + GetIP4Address() + "");
                return("非法请求,将拒绝对此请求提供服务");
            }

            note  = note.Replace("'", "’").Replace(",", ",");
            gdata = gdata.Replace("'", "’").Replace(",", ",");


            if (!CheckQuerySql(note) || !CheckQuerySql(gdata))
            {
                Log.Info("GSSTaskAdd,非法请求(PARAMETER) ,请求IP:" + GetIP4Address() + "");
                return("非法请求,将拒绝对此请求提供服务(PARAMETER)");
            }
            try
            {
                GSSModel.Tasks task = new GSSModel.Tasks();

                string[] ps = gdata.Split('|');
                //task.F_GameBigZone = ps[6];
                task.F_GameBigZone    = "第一大区";
                task.F_GameZone       = ps[8];
                task.F_GUserID        = ps[3];
                task.F_GUserName      = ps[4];
                task.F_GRoleID        = ps[1];
                task.F_GRoleName      = ps[2];
                task.F_GameName       = 1000;
                task.F_CreatTime      = DateTime.Now;
                task.F_LimitTime      = DateTime.Now.AddDays(2);
                task.F_EditTime       = DateTime.Now;
                task.F_From           = 100103103;
                task.F_LimitType      = 100104107;
                task.F_OLastLoginTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                task.F_Rowtype        = 6;//聊天
                task.F_State          = 100100100;
                task.F_Type           = 20000216;
                task.F_VipLevel       = 100105003;
                task.F_Title          = "来自游戏内嵌反馈系统【在线咨询】";
                task.F_TToolUsed      = null;
                task.F_OCanRestor     = true;



                DbHelperSQLP sp = new DbHelperSQLP();
                sp.connectionString = ConnStrGSSDB;
                GSSServerLibrary.DBHandle db = new GSSServerLibrary.DBHandle(ConnStrGSSDB);


                DataSet ds = db.GetTask(" and F_Type=" + task.F_Type + " and F_GUserID=" + task.F_GUserID + " and F_GRoleID=" + task.F_GRoleID + "", sp);
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    task.F_Note   = note + "\n--来自游戏内嵌反馈系统【在线咨询】";
                    task.F_URInfo = string.Format("用户编号:{0} 用户名称:{1} 角色编号:{2} 角色名称:{3} 大区名称:{4} 战区名称:{5} 战线:{6}\r\n--来自游戏内嵌反馈系统【在线咨询】", task.F_GUserID, task.F_GUserName, task.F_GRoleID, task.F_GRoleName, task.F_GameBigZone, task.F_GameZone, ps[10]);

                    if (ps.Length == 12)
                    {
                        string gamedateStr = ps[11];
                        task.F_URInfo += "\r\n【游戏数据】" + gamedateStr;
                        // task.F_Note += "\r\n【游戏数据】" + gamedateStr;
                        if (gamedateStr.IndexOf("ClientIP:") >= 0)
                        {
                            string gip      = gamedateStr.Substring(gamedateStr.IndexOf("ClientIP:"), gamedateStr.Length - gamedateStr.IndexOf("ClientIP:")).Replace("ClientIP:", "");
                            string uaddress = GetIPLocation(gip);
                            task.F_URInfo += "\r\n【玩家地址】" + uaddress;
                            //   task.F_Note += "\r\n【玩家地址】" + uaddress;
                        }
                    }
                    int result = db.AddTask(task, sp);
                    if (result == 0)
                    {
                        Log.Info("执行了GSSTaskAdd,保存失败,请求IP:" + GetIP4Address() + "");
                        return("保存失败,数据ERROR");
                    }
                    else
                    {
                        return("0");
                    }
                }
                else
                {
                    task.F_Note = note;

                    task.F_GameBigZone    = null;
                    task.F_GameZone       = null;
                    task.F_GUserID        = null;
                    task.F_GUserName      = null;
                    task.F_GRoleID        = null;
                    task.F_GRoleName      = null;
                    task.F_GameName       = null;
                    task.F_CreatTime      = null;
                    task.F_LimitTime      = null;
                    task.F_EditTime       = DateTime.Now;
                    task.F_From           = null;
                    task.F_LimitType      = null;
                    task.F_OLastLoginTime = null;
                    task.F_State          = null;
                    task.F_Type           = null;
                    task.F_VipLevel       = null;
                    task.F_Title          = null;



                    task.F_ID = Convert.ToInt32(ds.Tables[0].Rows[0]["F_ID"]);
                    int result = db.EditTask(task, sp);
                    if (result == 0)
                    {
                        Log.Info("执行了GSSTaskAdd,保存失败,请求IP:" + GetIP4Address() + "");
                        return("保存失败,数据ERROR");
                    }
                    else
                    {
                        return("0");
                    }
                }
            }
            catch (System.Exception ex)
            {
                Log.Warn("执行了GSSTaskAdd,请求IP:" + GetIP4Address() + "", ex);
                return("执行异常GSSWebService" + ex.Message);
            }
        }
示例#9
0
        public string GSSTaskAddRequst(string gdata, string answer)
        {
            if (!VerifyRemoteServiceIP(GetIP4Address()))
            {
                Log.Info("GSSTaskAdd,非法请求,请求IP:" + GetIP4Address() + "");
                return("非法请求,将拒绝对此请求提供服务");
            }

            gdata  = gdata.Replace("'", "’").Replace(",", ",");
            answer = answer.Replace("'", "’").Replace(",", ",");

            if (!CheckQuerySql(answer) || !CheckQuerySql(gdata))
            {
                Log.Info("GSSTaskAdd,非法请求(PARAMETER) ,请求IP:" + GetIP4Address() + "");
                return("非法请求,将拒绝对此请求提供服务(PARAMETER)");
            }
            try
            {
                GSSModel.Tasks task = new GSSModel.Tasks();

                string[] ps = gdata.Split('|');

                task.F_GameName = 1000;
                //task.F_GameBigZone = ps[6];
                task.F_GameBigZone = "第一大区";
                task.F_GameZone    = ps[8];

                task.F_GUserID   = ps[3];
                task.F_GUserName = ps[4];
                task.F_GRoleID   = ps[1];
                task.F_GRoleName = ps[2];

                if (IsHaveSubRequest(task.F_GUserID) && task.F_GUserName.Trim() != "100077")
                {
                    return("您已经提交过调查问卷! ");
                }



                task.F_URInfo = string.Format("用户编号:{0} 用户名称:{1} 角色编号:{2} 角色名称:{3} 大区名称:{4} 战区名称:{5} 战线:{6}\r\n--来自游戏内嵌反馈系统", task.F_GUserID, task.F_GUserName, task.F_GRoleID, task.F_GRoleName, task.F_GameBigZone, task.F_GameZone, ps[10]);


                task.F_Type = 20000215;
                task.F_Note = "+\r\n --来自游戏内嵌反馈系统【调查问卷】";

                task.F_COther   = "1";
                task.F_TUseData = answer;

                string[] items = answer.Split('|');
                //foreach (String item in items)
                //{
                //    task.F_Note += "\n"+GetAnswerItemKey(item);
                //}
                for (int i = 0; i < items.Length; i++)
                {
                    task.F_Note += "\n#" + (i + 1).ToString() + "." + GetAnswerItemKey(items[i]) + "";
                }

                if (ps.Length == 12)
                {
                    string gamedateStr = ps[11];
                    task.F_URInfo += "\r\n【游戏数据】" + gamedateStr;
                    task.F_Note   += "\r\n【游戏数据】" + gamedateStr;
                    if (gamedateStr.IndexOf("ClientIP:") >= 0)
                    {
                        string gip      = gamedateStr.Substring(gamedateStr.IndexOf("ClientIP:"), gamedateStr.Length - gamedateStr.IndexOf("ClientIP:")).Replace("ClientIP:", "");
                        string uaddress = GetIPLocation(gip);
                        task.F_URInfo += "\r\n【玩家地址】" + uaddress;
                        task.F_Note   += "\r\n【玩家地址】" + uaddress;
                    }
                }
                else if (ps.Length == 11)//游戏版本发出后删除此判断
                {
                    string gamedateStr = ps[10];
                    if (gamedateStr.IndexOf("ClientIP:") >= 0)
                    {
                        string gip = gamedateStr.Substring(gamedateStr.IndexOf("ClientIP:"), gamedateStr.Length - gamedateStr.IndexOf("ClientIP:")).Replace("ClientIP:", "");

                        task.F_URInfo += "\r\n【游戏数据】ClientIP:" + gip;
                        task.F_Note   += "\r\n【游戏数据】ClientIP:" + gip;

                        string uaddress = GetIPLocation(gip);
                        task.F_URInfo += "\r\n【玩家地址】" + uaddress;
                        task.F_Note   += "\r\n【玩家地址】" + uaddress;
                    }
                }

                task.F_CreatTime      = DateTime.Now;
                task.F_LimitTime      = DateTime.Now.AddDays(7);
                task.F_EditTime       = DateTime.Now;
                task.F_From           = 100103103;
                task.F_LimitType      = 100104107;
                task.F_OLastLoginTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                task.F_Rowtype        = 0;
                task.F_State          = 100100107;//直接完成工单
                task.F_VipLevel       = 100105003;
                task.F_Title          = "来自游戏内嵌反馈系统【调查问卷】";

                DbHelperSQLP sp = new DbHelperSQLP();
                sp.connectionString = ConnStrGSSDB;
                int result = AddTask(task, sp);
                if (result == 0)
                {
                    Log.Info("执行了GSSTaskAddRequst,保存失败,请求IP:" + GetIP4Address() + "");
                    return("保存失败,数据ERROR");
                }
                else
                {
                    string resulta = GiftUserAdd(task.F_GameBigZone, task.F_GUserID, "-1", "-1", "530114", "1", "问卷调查自动发奖 工单编号:" + result + "");
                    Log.Info("添加用户奖品,请求IP:" + GetIP4Address() + " 结果" + resulta + "");
                    if (resulta != "true")
                    {
                        return("问卷调查保存成功,但发奖出错(" + resulta + ")");
                    }
                    return("0");
                }
            }
            catch (System.Exception ex)
            {
                Log.Warn("执行了GSSTaskAddRequst,请求IP:" + GetIP4Address() + "", ex);
                return("执行异常GSSWebService" + ex.Message);
            }
        }
        /// <summary>
        /// 提交工单
        /// </summary>
        private void CommitTask()
        {
            string   Title       = tboxTitle.Text.Trim();
            string   gpeoplename = tboxCreator.Text.Trim();
            string   telephone   = tboxTelephone.Text.Trim();
            string   Note        = rboxNote.Text.Trim();
            int      From        = SystemConfig.AppID;//客服中心
            int      VipLevel    = int.Parse(cboxVIP.SelectedValue.ToString());
            DateTime?LimitTime   = GetLimitTime();
            int      LimitType   = int.Parse(cboxLimitTime.SelectedValue.ToString());
            int?     Type        = _tasktype;           //帐号封停工单
            int      State       = 100100102;           //处理中
            int      GameName    = SystemConfig.GameID; //寻龙记
            int?     DutyMan     = Convert.ToInt32(ShareData.UserID);
            int?     PreDutyMan  = null;
            int      CreatMan    = int.Parse(ShareData.UserID);
            DateTime CreatTime   = DateTime.Now;
            int      EditMan     = int.Parse(ShareData.UserID);
            DateTime EditTime    = DateTime.Now;
            string   bigzonename = ddlGBigzone.SelectedValue.ToString();


            int Rowtype = 0;
            //string ReceivArea = GetTreeValue();


            string strErr = "";

            if (Title.Length == 0)
            {
                strErr += "工单标题不能为空!\n";
            }
            if (gpeoplename.Length == 0)
            {
                strErr += LanguageResource.Language.LblInitiatorNameIsRequire + "!\n";
            }
            if (telephone.Trim().Length < 6)
            {
                strErr += LanguageResource.Language.LblTelFormIsError + "!\n";
            }

            if (Note.Trim().Length == 0)
            {
                strErr += LanguageResource.Language.Tip_RemarkNoEmpty + "!\n";
            }
            if (DGVGameUser.Rows.Count == 0)
            {
                strErr += LanguageResource.Language.Tip_GameUseNotIsRequire + "!\n";
            }


            if (strErr != "")
            {
                MsgBox.Show(strErr, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            ComitDoControl(false);



            try
            {
                GSSBLL.Tasks bll = ClientRemoting.Tasks();

                if (tboxInfo.Text.Trim().Length == 0)
                {
                    foreach (DataGridViewRow dr in DGVGameUser.Rows)
                    {
                        string userid   = dr.Cells[0].Value.ToString();
                        string username = dr.Cells[1].Value.ToString();

                        string result = bll.GSSTool_SetUserLock(userid, username, "0", cboxTime.SelectedValue.ToString());
                        tboxInfo.Text += string.Format(" {0},{1},{2}\n", userid, username, result);
                        tboxInfo.ScrollToCaret();
                    }
                }


                GSSModel.Tasks model = new GSSModel.Tasks();
                model.F_Title       = Title;
                model.F_GPeopleName = gpeoplename;
                model.F_Telphone    = telephone;
                model.F_Note        = Note;
                model.F_From        = From;
                model.F_VipLevel    = VipLevel;
                model.F_LimitType   = LimitType;
                model.F_LimitTime   = LimitTime;
                model.F_Type        = Type;
                model.F_State       = State;
                model.F_GameName    = GameName;
                model.F_DutyMan     = DutyMan;
                model.F_PreDutyMan  = PreDutyMan;
                model.F_CreatMan    = CreatMan;
                model.F_CreatTime   = CreatTime;
                model.F_EditMan     = EditMan;
                model.F_EditTime    = EditTime;
                model.F_GameBigZone = bigzonename;
                model.F_COther      = "";
                model.F_Rowtype     = 0;
                model.F_GUserID     = "0";
                model.F_GUserName   = "******";
                // model.F_URInfo = tboxInfo.Text;
                model.F_Note = Note + "\n用户列表:\n" + tboxInfo.Text;


                if (bll.AddP(model) > 0)
                {
                    MsgBox.Show("工单执行并保存成功", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.Close();
                }
                else
                {
                    MsgBox.Show("工单保存失败", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (System.Exception ex)
            {
                MsgBox.Show("错误:" + ex.Message, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            ComitDoControl(true);
        }
示例#11
0
        /// <summary>
        /// 处理接收到的请求
        /// </summary>
        /// <param name="Client"></param>
        /// <param name="recevStr"></param>
        public void DoRequest(Session Client, MsgStruts msg)
        {
            if (Client == null || msg == null || Client.TypeOfExit != Session.ExitType.NoExit)
            {
                ShareData.Log.Info(msg.command + "未返回数据");
                return;
            }

            string  msgStr;
            DataSet ds;
            string  backStr;

            string[]  msgs;
            MsgStruts callBack = new MsgStruts()
            {
                msgsendstate = msgSendState.single, msgtype = msgType.SendText
            };
            ClientData fromClientData;

            try
            {
                string.Format("command->" + msg.command).Logger();
                switch (msg.command)
                {
                case msgCommand.GetLogin:
                    msgStr = _coder.GetEncodingString(msg.Data, msg.Data.Length);
                    msgs   = msgStr.Split('|');
                    if (msgs.Length != 3)
                    {
                        backStr = "false";
                    }
                    else
                    {
                        backStr = dbhandle.Login(msgs[0], msgs[1], msgs[2]);
                    }
                    msg.Data = _coder.GetEncodingBytes(backStr);
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.GetCache:
                    msgStr   = _coder.GetEncodingString(msg.Data, msg.Data.Length);
                    ds       = dbhandle.GetCache();
                    msg.Data = DataSerialize.GetDataSetSurrogateZipBYtes(ds);
                    // ShareData.Log.Warn(msg.Data);
                    _tcpsvr.Send(Client, msg);
                    // _tcpsvr.SendDataContainerBuffer(Client, msg);//cache data  to the client will change to some package
                    System.Threading.Thread.Sleep(800);
                    ((Session)TcpSvr.SessionTable[Client.ID]).UserID = msgStr;

                    SendAlertNum(Client);
                    break;

                case msgCommand.GetAlertNum:
                    System.Threading.Thread.Sleep(800);
                    SendAlertNum();
                    break;

                case msgCommand.GetAllTasks:
                    msgStr = _coder.GetEncodingString(msg.Data, msg.Data.Length);
                    msgStr.Logger();
                    ds = dbhandle.GetTask(msgStr, msg.MsgParam.p1, msg.MsgParam.p2, Convert.ToInt16(msg.MsgParam.p3), Convert.ToInt16(msg.MsgParam.p4));
                    WebServiceLib.DataSetRowsLog(ds, "Service query cmd:" + msgCommand.GetAllTasks);
                    msg.MsgParam.p6 = dbhandle.GetTaskCount(msgStr).ToString();
                    msg.Data        = DataSerialize.GetDataSetSurrogateZipBYtes(ds);
                    _tcpsvr.Send(Client, msg);

                    //dbhandle.SysLog(((Session)TcpSvr.SessionTable[Client.ID]).UserID, "工单列表", msgStr);
                    break;

                case msgCommand.GetTaskLog:
                    msgStr   = _coder.GetEncodingString(msg.Data, msg.Data.Length);
                    ds       = dbhandle.GetTaskLog(msgStr);
                    msg.Data = DataSerialize.GetDataSetSurrogateZipBYtes(ds);
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.GetGameUsersC:
                    msgStr = _coder.GetEncodingString(msg.Data, msg.Data.Length);
                    "GetGameUsersC".Logger();
                    msgStr.Logger();
                    ds = WebServiceLib.GetGameUsersC(msgStr);
                    if (ds != null && ds.Tables.Count > 0)
                    {
                        string.Format("Service Query game user number:[{0}]", ds.Tables[0].Rows.Count).Logger();
                    }
                    else
                    {
                        string.Format("Service Query game user number:[{0}]", 0).Logger();
                    }
                    msg.Data = DataSerialize.GetDataSetSurrogateZipBYtes(ds);
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.GetGameRolesC:
                    msgStr = _coder.GetEncodingString(msg.Data, msg.Data.Length);
                    "GetGameRoleC".Logger();
                    msgStr.Logger();
                    ds = WebServiceLib.GetGameRoleC(msgStr);
                    WebServiceLib.DataSetRowsLog(ds, typeof(ServerHandle).Name + "." + msgCommand.GetGameRolesC);
                    if (ds != null)
                    {
                        msg.Data = DataSerialize.GetDataSetSurrogateZipBYtes(ds);
                    }
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.GetGameRolesCR:
                    msgCommand.GetGameRolesCR.ToString().Logger();
                    msgStr = _coder.GetEncodingString(msg.Data, msg.Data.Length);
                    ("Query where:" + msgStr).Logger();
                    ds = WebServiceLib.GetGameRoleCRALL(msgStr);
                    WebServiceLib.DataSetRowsLog(ds, msgCommand.GetGameRolesCR + " Totla");
                    msg.Data = DataSerialize.GetDataSetSurrogateZipBYtes(ds);
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.AddTask:
                    GSSModel.Tasks task = (GSSModel.Tasks)DataSerialize.GetObjectFromByte(msg.Data);
                    int            id   = dbhandle.AddTask(task);
                    if (task.F_Type.ToString() == "2203")
                    {
                        backStr = WebServiceLib.DisChatAdd(task);
                    }
                    else if (task.F_Type.ToString() == "2213")
                    {
                        backStr = WebServiceLib.DisChatDel(task);
                    }
                    msg.Data = _coder.GetEncodingBytes(id.ToString());
                    _tcpsvr.Send(Client, msg);
                    System.Threading.Thread.Sleep(800);
                    SendAlertNum();
                    break;

                case msgCommand.EditTask:
                    task     = (GSSModel.Tasks)DataSerialize.GetObjectFromByte(msg.Data);
                    id       = dbhandle.EditTask(task);
                    msg.Data = _coder.GetEncodingBytes(id.ToString());
                    _tcpsvr.Send(Client, msg);
                    System.Threading.Thread.Sleep(800);
                    SendAlertNum();
                    break;

                case msgCommand.EditTaskNoReturn:
                    task     = (GSSModel.Tasks)DataSerialize.GetObjectFromByte(msg.Data);
                    id       = dbhandle.EditTask(task);
                    msg.Data = _coder.GetEncodingBytes(id.ToString());
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.EditTaskLog:
                    task     = (GSSModel.Tasks)DataSerialize.GetObjectFromByte(msg.Data);
                    id       = dbhandle.EditTaskLog(task);
                    msg.Data = _coder.GetEncodingBytes(id.ToString());
                    _tcpsvr.Send(Client, msg);
                    System.Threading.Thread.Sleep(800);
                    SendAlertNum();
                    break;

                case msgCommand.ExcSql:
                    msgStr = _coder.GetEncodingString(msg.Data, msg.Data.Length);
                    string[] formsql  = msgStr.Split('|');   //分为两段,执行SQL语句的窗口ID和语句
                    int      rowcount = dbhandle.ExeSql(formsql[1]);
                    backStr  = formsql[0] + "|" + rowcount;
                    msg.Data = _coder.GetEncodingBytes(backStr);
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.ExcPro:
                    msgStr = _coder.GetEncodingString(msg.Data, msg.Data.Length);
                    string[]       pformsql = msgStr.Split('|');////格式 窗口ID+存储过程+参数
                    string         proname  = pformsql[1];
                    SqlParameter[] param    = DataSerialize.GetSqlParameterFromString(pformsql[2]);
                    break;

                case msgCommand.GameLockUR:    //格式 窗口ID+封停用户还是角色+工单编号+封停时间
                    msgStr = _coder.GetEncodingString(msg.Data, msg.Data.Length);
                    msgs   = GetParam(msgStr);
                    string formid = msgs[0];
                    string doStr  = WebServiceLib.URlock(msgs[1], msgs[2], msgs[3]);
                    backStr  = formid + "|" + doStr;
                    msg.Data = _coder.GetEncodingBytes(backStr);
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.GameNoLockUR:    //格式 窗口ID+封停用户还是角色+工单编号
                    msgStr   = _coder.GetEncodingString(msg.Data, msg.Data.Length);
                    msgs     = GetParam(msgStr);
                    formid   = msgs[0];
                    doStr    = WebServiceLib.URNolock(msgs[1], msgs[2]);
                    backStr  = formid + "|" + doStr;
                    msg.Data = _coder.GetEncodingBytes(backStr);
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.GameUserUse:    //格式 窗口ID+工单编号
                    msgStr   = _coder.GetEncodingString(msg.Data, msg.Data.Length);
                    msgs     = GetParam(msgStr);
                    formid   = msgs[0];
                    doStr    = WebServiceLib.GameUserUse(msgs[1], msgs[2]);
                    backStr  = formid + "|" + doStr;
                    msg.Data = _coder.GetEncodingBytes(backStr);
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.GameUserNoUse:    //格式 窗口ID+工单编号
                    msgStr   = _coder.GetEncodingString(msg.Data, msg.Data.Length);
                    msgs     = GetParam(msgStr);
                    formid   = msgs[0];
                    doStr    = WebServiceLib.GameUserNoUse(msgs[1]);
                    backStr  = formid + "|" + doStr;
                    msg.Data = _coder.GetEncodingBytes(backStr);
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.GameResetChildInfo:    //格式 窗口ID+工单编号
                    msgStr   = _coder.GetEncodingString(msg.Data, msg.Data.Length);
                    msgs     = GetParam(msgStr);
                    formid   = msgs[0];
                    doStr    = WebServiceLib.GameResetChildInfo(msgs[1]);
                    backStr  = formid + "|" + doStr;
                    msg.Data = _coder.GetEncodingBytes(backStr);
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.GameNoticeStart:
                    backStr  = WebServiceLib.GameNoticeStart(msg.MsgParam.p0);
                    msg.Data = _coder.GetEncodingBytes(backStr);
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.GameNoticeStop:
                    backStr  = WebServiceLib.GameNoticeStop(msg.MsgParam.p0);
                    msg.Data = _coder.GetEncodingBytes(backStr);
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.DeleteFullServiceEmail:
                    backStr  = WebServiceLib.DeleteFullServiceEmail(msg.MsgParam.p0);
                    msg.Data = _coder.GetEncodingBytes(backStr);
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.GameGiftAwardDo:
                    backStr  = WebServiceLib.GameGiftAwardDo(msg.MsgParam.p0);
                    msg.Data = _coder.GetEncodingBytes(backStr);
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.QuerySynGSLog:
                    msg.Data = WebServiceLib.QuerySynGSLog(msg.MsgParam.p0, msg.MsgParam.p1);
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.QueryLiveGSLog:
                    msg.Data = WebServiceLib.QueryLiveGSLog(msg.MsgParam.p0, msg.MsgParam.p1);
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.DownloadTemplateFile:    //下载模本文件
                    object obj = DataSerialize.GetObjectFromByte(msg.Data);
                    GSSModel.TemplateFile  tem = obj as GSSModel.TemplateFile;
                    System.IO.MemoryStream ms  = new System.IO.MemoryStream();
                    System.Runtime.Serialization.Formatters.Binary.BinaryFormatter bf = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();    //二进制序列化类
                    if (tem != null)
                    {
                        msgStr = _coder.GetEncodingString(msg.Data, msg.Data.Length);
                        string path = AppDomain.CurrentDomain.BaseDirectory + "\\Resources\\Template\\";
                        string file = path + tem.SystemLang + "\\" + tem.TemplateName;
                        if (!File.Exists(file))
                        {
                            msg.msgsendstate = msgSendState.None;
                            bf.Serialize(ms, string.Format(LanguageResource.Language.Tip_ServiceLackTemplateFormat, tem.TemplateName));    //将消息类转换为内存流
                            msg.Data = ms.ToArray();
                        }
                        else
                        {
                            FileStream  fs     = new FileStream(file, FileMode.Open, FileAccess.Read);
                            byte[]      bb     = new byte[1024];
                            List <byte> stream = new List <byte>();
                            int         len    = fs.Read(bb, 0, bb.Length);
                            stream.AddRange(bb);
                            while (len > 0)
                            {
                                len = fs.Read(bb, 0, bb.Length);
                                stream.AddRange(bb);
                            }
                            msg.Data = stream.ToArray();
                            fs.Close();
                            msg.msgsendstate = msgSendState.single;
                        }
                    }
                    else
                    {
                        msg.msgsendstate = msgSendState.None;
                        bf.Serialize(ms, LanguageResource.Language.Tip_ClientRequestLack);
                    }
                    _tcpsvr.Send(Client, msg);
                    break;

                case msgCommand.AddLoginAward:
                    object data = DataSerialize.GetObjectFromByte(msg.Data);
                    GSSModel.Request.ClientData     client = data as GSSModel.Request.ClientData;
                    GSSModel.Request.LoginAwardTask at     = client.Data as GSSModel.Request.LoginAwardTask;
                    msg.Data    = null;
                    client.Data = null;
                    string message = "";
                    if (at.Task.F_Type.ToString() == "20000215")
                    {
                        message = dbhandle.AddLoginAward(at);
                    }
                    else if (at.Task.F_Type.ToString() == "20000217")
                    {
                        message = dbhandle.AddFullServiceEmail(at);
                    }
                    if (message != true.ToString())
                    {
                        ShareData.Log.Error(message);
                    }
                    else
                    {
                        client.Success = true;
                    }
                    msg.Data         = DataSerialize.GetByteFromObject(client);;
                    msg.msgsendstate = msgSendState.single;
                    _tcpsvr.Send(Client, msg);
                    SendAlertNum(Client);
                    break;

                case msgCommand.AddFullServiceEmail:
                    object objData = DataSerialize.GetObjectFromByte(msg.Data);
                    GSSModel.Request.ClientData     clientData = objData as GSSModel.Request.ClientData;
                    GSSModel.Request.LoginAwardTask atl        = clientData.Data as GSSModel.Request.LoginAwardTask;
                    msg.Data        = null;
                    clientData.Data = null;
                    string strMessage = dbhandle.AddFullServiceEmail(atl);
                    if (strMessage != true.ToString())
                    {
                        ShareData.Log.Error(strMessage);
                    }
                    else
                    {
                        clientData.Success = true;
                    }
                    msg.Data         = DataSerialize.GetByteFromObject(clientData);;
                    msg.msgsendstate = msgSendState.single;
                    _tcpsvr.Send(Client, msg);
                    SendAlertNum(Client);
                    break;

                case msgCommand.GameRoleRecovery:
                    object         d   = DataSerialize.GetObjectFromByte(msg.Data);
                    ClientData     cd  = d as ClientData;
                    object[]       arr = cd.Data as object[];
                    GSSModel.Tasks tsk = arr[0] as GSSModel.Tasks;
                    id = dbhandle.AddTask(tsk);
                    if (id < 1)
                    {    //创建工单失败
                        msg.Data         = _coder.GetEncodingBytes(cd.FormID + "|" + "-1|" + LanguageResource.Language.Tip_CreateWorkOrderFailure);
                        msg.msgsendstate = msgSendState.single;
                        _tcpsvr.Send(Client, msg);
                        return;
                    }
                    RoleData role = arr[1] as RoleData;
                    string   code = WebServiceLib.RecoveryRoleWithRollBack(role);
                    if (code != true.ToString())
                    {
                        System.Resources.ResourceManager rm = LanguageResource.Language.ResourceManager;
                        string info = rm.GetString("Tip_RecoveryRoleStatue_" + code);
                        if (string.IsNullOrEmpty(info))
                        {
                            info = code;
                        }
                        msg.Data         = _coder.GetEncodingBytes(cd.FormID + "|" + id + "|" + info);
                        msg.msgsendstate = msgSendState.single;
                        _tcpsvr.Send(Client, msg);
                        return;
                    }
                    else
                    {
                        msg.Data         = _coder.GetEncodingBytes(cd.FormID + "|" + id + "|" + true.ToString());
                        msg.msgsendstate = msgSendState.single;
                        _tcpsvr.Send(Client, msg);
                    }
                    SendAlertNum(Client);
                    break;

                case msgCommand.SendEmailToRoles:
                    d = DataSerialize.GetObjectFromByte(msg.Data);
                    GSSModel.Request.ClientData clientdata = d as GSSModel.Request.ClientData;
                    GSSModel.SendEmailToRole    email      = clientdata.Data as GSSModel.SendEmailToRole;
                    //通过调用接口进行数据传输
                    clientdata.Message = WebServiceLib.SetRolesEmail(email);
                    clientdata.Data    = null;
                    MsgStruts reback = new MsgStruts()
                    {
                        command = msgCommand.SendEmailToRoles, msgsendstate = msgSendState.single
                    };
                    if (string.IsNullOrEmpty(clientdata.Message))
                    {
                        clientdata.Success = true;
                    }
                    reback.Data = DataSerialize.GetByteFromObject(clientdata);
                    _tcpsvr.Send(Client, reback);
                    SendAlertNum(Client);
                    break;

                case msgCommand.ActiveFallGoods:
                    d = DataSerialize.GetObjectFromByte(msg.Data);
                    GSSModel.Request.ClientData          request = d as GSSModel.Request.ClientData;
                    GSSModel.Request.ActiveFallGoodsData fall    = request.Data as GSSModel.Request.ActiveFallGoodsData;
                    request.Data     = null;
                    request.Message  = WebServiceLib.AddActiveFallConfig(fall);
                    request.Success  = true;
                    callBack.command = msgCommand.ActiveFallGoods;
                    callBack.Data    = DataSerialize.GetByteFromObject(request);
                    _tcpsvr.Send(Client, callBack);
                    SendAlertNum(Client);
                    break;

                case msgCommand.CreateTaskContainerLogic:    //这是对于工单数据流程优化新增的传递方式
                    string.Format(" class:[{0}], command:[{1}]", typeof(ServerHandle).Name, msgCommand.CreateTaskContainerLogic);
                    d              = DataSerialize.GetObjectFromByte(msg.Data);
                    msg.Data       = null;
                    fromClientData = d as GSSModel.Request.ClientData;
                    try
                    {
                        SwitchDo(fromClientData);
                    }
                    catch (Exception ex)
                    {
                        ex.ToString().ErrorLogger();
                        fromClientData.Success = false;
                        fromClientData.Message = ex.Message;
                    }
                    msg.Data = DataSerialize.GetByteFromObject(fromClientData);
                    _tcpsvr.Send(Client, msg);
                    SendAlertNum(Client);
                    break;

                default:
                    break;
                }
            }
            catch (System.Exception ex)
            {
                ex.Message.ErrorLogger();
                msgStr = _coder.GetEncodingString(msg.Data, msg.Data.Length);
                ShareData.Log.Info(msgStr);
                ShareData.Log.Warn(ex);
                msg.Data = _coder.GetEncodingBytes("0");
                _tcpsvr.Send(Client, msg);
            }
        }
示例#12
0
 /// <summary>
 /// 更新数据(存储过程方式)
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public int Edit(GSSModel.Tasks model)
 {
     return(dal.EditTaskLog(model));
 }
        /// <summary>
        /// 提交工单(同步)
        /// </summary>
        private bool CommitTaskSyn()
        {
            string   Title     = "";
            string   Note      = rboxNote.Text;
            int      From      = SystemConfig.AppID;//客服中心
            int      VipLevel  = int.Parse(cboxVIP.SelectedValue.ToString());
            DateTime?LimitTime = GetLimitTime();
            int      LimitType = int.Parse(cboxLimitTime.SelectedValue.ToString());
            int?     Type      = _tasktype;                           //角色异常
            int      State     = SystemConfig.DefaultWorkOrderStatue; //等待处理
            int      GameName  = SystemConfig.GameID;                 //寻龙记

            string GUserID      = TrimNull(_drguser.Cells[0].Value);
            string GUserName    = TrimNull(_drguser.Cells[1].Value);
            string GBigZoneName = TrimNull(_drguser.Cells[2].Value);
            string GameZone     = "";
            string GRoleID      = "";
            string GRoleName    = "";

            if (_drrole != null)
            {
                GameZone  = TrimNull(_drrole.Cells[2].Value);
                GRoleID   = TrimNull(_drrole.Cells[0].Value);
                GRoleName = TrimNull(_drrole.Cells[1].Value);
            }

            string   Telphone       = tboxTelphone.Text;
            string   gpeoplename    = tboxGPeopleName.Text;
            int?     DutyMan        = null;
            int?     PreDutyMan     = null;
            int      CreatMan       = int.Parse(ShareData.UserID);
            DateTime CreatTime      = DateTime.Now;
            int      EditMan        = int.Parse(ShareData.UserID);
            DateTime EditTime       = DateTime.Now;
            string   URInfo         = lblURinfo.Tag as string;
            bool     CUserName      = ckboxCUserName.Checked;
            bool     CPSWProtect    = ckboxCPSWProtect.Checked;
            bool     CPersonID      = ckboxCPersonID.Checked;
            string   COther         = tboxCOther.Text;
            string   OLastLoginTime = tboxOLastLoginTime.Text;
            bool     OCanRestor     = ckboxOCanRestor.Checked;
            string   OAlwaysPlace   = tboxOAlwaysPlace.Text;
            int      Rowtype        = 0;

            string strErr = "";

            if (ckboxCOther.Checked && COther.Length == 0)
            {
                strErr += LanguageResource.Language.GbVerifyItems + ">" + LanguageResource.Language.Tip_OtherInfoNoEmpty + "!\n";
            }
            //if (Telphone.Trim().Length == 0)
            //{
            //    strErr += "联系电话不能为空!\n";
            //}
            //else if (!WinUtil.IsTelphone(Telphone) && !WinUtil.IsMobile(Telphone))
            //{
            //    strErr += LanguageResource.Language.LblTelFormIsError+"!\n(格式:010-88886666或13912341234)\n";
            //}
            if (Note.Trim().Length == 0)
            {
                strErr += LanguageResource.Language.Tip_RemarkNoEmpty + "!\n";
            }

            if (URInfo.Trim().Length == 0)
            {
                strErr += LanguageResource.Language.Tip_CreateWorkNeedUserAndRoleInfo + "!\\n";
            }


            if (strErr != "")
            {
                MsgBox.Show(strErr, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }

            ComitDoControl(false);

            GSSModel.Tasks model = new GSSModel.Tasks();
            model.F_Title          = Title;
            model.F_Note           = Note;
            model.F_From           = From;
            model.F_VipLevel       = VipLevel;
            model.F_LimitType      = LimitType;
            model.F_LimitTime      = LimitTime;
            model.F_Type           = Type;
            model.F_State          = State;
            model.F_GameName       = GameName;
            model.F_GameBigZone    = GBigZoneName;
            model.F_GameZone       = GameZone;
            model.F_GUserID        = GUserID;
            model.F_GUserName      = GUserName;
            model.F_GRoleID        = GRoleID;
            model.F_GRoleName      = GRoleName;
            model.F_Telphone       = Telphone;
            model.F_GPeopleName    = gpeoplename;
            model.F_DutyMan        = DutyMan;
            model.F_PreDutyMan     = PreDutyMan;
            model.F_CreatMan       = CreatMan;
            model.F_CreatTime      = CreatTime;
            model.F_EditMan        = EditMan;
            model.F_EditTime       = EditTime;
            model.F_URInfo         = URInfo;
            model.F_Rowtype        = Rowtype;
            model.F_CUserName      = CUserName;
            model.F_CPSWProtect    = CPSWProtect;
            model.F_CPersonID      = CPersonID;
            model.F_COther         = COther;
            model.F_OLastLoginTime = OLastLoginTime;
            model.F_OCanRestor     = OCanRestor;
            model.F_OAlwaysPlace   = OAlwaysPlace;

            string backStr = _clienthandle.AddTaskSyn(model);

            ComitDoControl(true);
            if (backStr == "0")
            {
                if (!ckboxDonow.Checked)
                {
                    MsgBox.Show(LanguageResource.Language.Tip_WorkOrderCreateFailure, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MsgBox.Show(LanguageResource.Language.Tip_WorkOrderCreateFailureWithTool, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                return(false);
            }
            else
            {
                if (!ckboxDonow.Checked)
                {
                    MsgBox.Show(LanguageResource.Language.Tip_WorkOrderCreateSucc + "!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                _taskid = backStr;
                return(true);
            }
        }
        Tasks getTaskModel()
        {
            string   Title     = "";
            string   Note      = rboxNote.Text;
            int      From      = SystemConfig.AppID;//客服中心
            int      VipLevel  = int.Parse(cboxVIP.SelectedValue.ToString());
            DateTime?LimitTime = GetLimitTime();
            int      LimitType = int.Parse(cboxLimitTime.SelectedValue.ToString());
            int?     Type      = _tasktype;                           //角色异常
            int      State     = SystemConfig.DefaultWorkOrderStatue; //等待处理
            int      GameName  = SystemConfig.GameID;                 //寻龙记

            string GUserID      = TrimNull(_drguser.Cells[0].Value);
            string GUserName    = TrimNull(_drguser.Cells[1].Value);
            string GBigZoneName = TrimNull(_drguser.Cells[2].Value);
            string GameZone     = "";
            string GRoleID      = "";
            string GRoleName    = "";

            if (_drrole != null)
            {
                GameZone  = TrimNull(_drrole.Cells[2].Value);
                GRoleID   = TrimNull(_drrole.Cells[0].Value);
                GRoleName = TrimNull(_drrole.Cells[1].Value);
            }

            string   Telphone       = tboxTelphone.Text;
            int?     DutyMan        = null;
            int?     PreDutyMan     = null;
            int      CreatMan       = int.Parse(ShareData.UserID);
            DateTime CreatTime      = DateTime.Now;
            int      EditMan        = int.Parse(ShareData.UserID);
            DateTime EditTime       = DateTime.Now;
            string   URInfo         = lblURinfo.Tag as string;
            string   gpeoplename    = tboxGPeopleName.Text;
            bool     CUserName      = ckboxCUserName.Checked;
            bool     CPSWProtect    = ckboxCPSWProtect.Checked;
            bool     CPersonID      = ckboxCPersonID.Checked;
            string   COther         = tboxCOther.Text;
            string   OLastLoginTime = tboxOLastLoginTime.Text;
            bool     OCanRestor     = ckboxOCanRestor.Checked;
            string   OAlwaysPlace   = tboxOAlwaysPlace.Text;
            int      Rowtype        = 0;



            GSSModel.Tasks model = new GSSModel.Tasks();
            model.F_Title          = Title;
            model.F_Note           = Note;
            model.F_From           = From;
            model.F_VipLevel       = VipLevel;
            model.F_LimitType      = LimitType;
            model.F_LimitTime      = LimitTime;
            model.F_Type           = Type;
            model.F_State          = State;
            model.F_GameName       = GameName;
            model.F_GameBigZone    = GBigZoneName;
            model.F_GameZone       = GameZone;
            model.F_GUserID        = GUserID;
            model.F_GUserName      = GUserName;
            model.F_GRoleID        = GRoleID;
            model.F_GRoleName      = GRoleName;
            model.F_Telphone       = Telphone;
            model.F_GPeopleName    = gpeoplename;
            model.F_DutyMan        = DutyMan;
            model.F_PreDutyMan     = PreDutyMan;
            model.F_CreatMan       = CreatMan;
            model.F_CreatTime      = CreatTime;
            model.F_EditMan        = EditMan;
            model.F_EditTime       = EditTime;
            model.F_URInfo         = URInfo;
            model.F_Rowtype        = Rowtype;
            model.F_CUserName      = CUserName;
            model.F_CPSWProtect    = CPSWProtect;
            model.F_CPersonID      = CPersonID;
            model.F_COther         = COther;
            model.F_OLastLoginTime = OLastLoginTime;
            model.F_OCanRestor     = OCanRestor;
            model.F_OAlwaysPlace   = OAlwaysPlace;
            return(model);
        }
        private void btnDosure_Click(object sender, EventArgs e)
        {
            if (rtboxNote.Text.Trim().Length == 0)
            {
                MsgBox.Show("工具使用备注不能为空!", LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            try
            {
                ComitDoControl(false);
                GSSModel.Tasks model = new GSSModel.Tasks();
                model.F_GRoleID     = _model.F_GRoleID;
                model.F_GUserID     = _model.F_GUserID;
                model.F_GameBigZone = ClientCache.GetBigZoneGameID(_model.F_GameBigZone);
                string bigzoneCFID = ClientCache.GetGameConfigID(_model.F_GameBigZone);
                model.F_GameZone = ClientCache.GetZoneGameID(bigzoneCFID, _model.F_GameZone);

                GSSBLL.Tasks bll        = ClientRemoting.Tasks();
                int          codeResult = bll.GSSTool_RoleRecover(model);

                string info = "";
                if (codeResult == 0)
                {
                    info = "操作执行成功";
                }
                else if (codeResult == 1801)
                {
                    info = "用户在该战区下已经有3个角色";
                }
                else if (codeResult == 1800)
                {
                    info = "删除表中无此角色";
                }
                else
                {
                    info = "操作执行失败";
                }

                GSSModel.Tasks task = new GSSModel.Tasks();
                task.F_ID        = _model.F_ID;
                task.F_EditMan   = int.Parse(ShareData.UserID);
                task.F_EditTime  = DateTime.Now;
                task.F_TToolUsed = true;
                task.F_TUseData  = string.Format("角色恢复工具 \n{0} \n{1}", lblUR.Text, info);
                task.F_Note      = rtboxNote.Text;
                _isToolUsed      = true;
                bll.Edit(task);

                MsgBox.Show(info, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Information);

                if (codeResult == 0)
                {
                    this.Close();
                }
            }
            catch (System.Exception ex)
            {
                ShareData.Log.Warn(ex);
                MsgBox.Show(ex.Message, LanguageResource.Language.Tip_Tip, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            finally
            {
                ComitDoControl(true);
            }
        }