Example #1
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);
            }
        }
Example #2
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);
            }
        }