/// <summary> /// 太古遮天查询接口 /// </summary> /// <param name="UserId">用户Id</param> /// <param name="ServerId">服务器Id</param> /// <returns>返回查询结果</returns> public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 Sign = DESEncrypt.Md5(gc.SelectTicket + gu.UserName + gc.AgentId + gs.QuFu + tstamp, 32); //获取验证码 string SelUrl = "http://" + gc.ExistCom + "/api/v1/mc/getRoleInfo.php?agentName=" + gc.AgentId + "&serverID=" + gs.QuFu + "&accountName=" + gu.UserName + "&stamp=" + tstamp + "&sign=" + Sign; string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 try { JArray jo = (JArray)JsonConvert.DeserializeObject(SelResult); for (int i = 0; i < jo.Count; i++) { JObject obj = (JObject)jo[i]; if ((int)obj["level"] > gui.Level) { gui.Id = obj["roleID"].ToString(); gui.UserId = gu.UserName; gui.UserName = Utils.UrlDecode(obj["roleName"].ToString()); gui.Level = (int)obj["level"]; gui.ServerName = gs.Name; gui.Money = os.GetOrderInfo(gu.UserName); gui.Message = "Success"; } } } catch (Exception) { gui.UserName = "******"; gui.Message = "查询失败!查询不到用户信息!"; } return(gui); }
public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 Sign = DESEncrypt.Md5(gc.SelectTicket + "pid" + gc.AgentId + "sid" + gs.QuFu + "time" + tstamp + "uid" + gu.UserName, 32).ToUpper(); //获取验证码 string SelUrl = "http://" + gc.ExistCom + "?pid=" + gc.AgentId + "&sid=" + gs.QuFu + "&time=" + tstamp + "&uid=" + gu.UserName + "&sign=" + Sign; string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 try { switch (SelResult) { case "-1": gui.Message = "查询失败!内部错误!"; break; case "-100": gui.Message = "查询失败!参数错误!"; break; case "-200": gui.Message = "查询失败!系统错误!"; break; case "-300": gui.Message = "查询失败!验证失败!"; break; case "-400": gui.Message = "查询失败!请求超时!"; break; case "-500": gui.Message = "查询失败!数据操作失败!"; break; case "-600": gui.Message = "查询失败!帐号无效!"; break; case "-700": gui.Message = "查询失败!充值服务器不存在!"; break; case "-1406": gui.Message = "查询失败!角色不存在!"; break; case "-11000": gui.Message = "查询失败!非法访问的IP!"; break; case "100": gui.Message = "查询失败!平台请求参数错误!"; break; case "700": case "555": gui.Message = "查询失败!平台不存在!"; break; case "556": gui.Message = "查询失败!内部分析错误!"; break; case "300": gui.Message = "查询失败!平台验证失败!"; break; default: Dictionary <string, string> Jd = Json.JsonToArray(SelResult); gui = new GameUserInfo(Jd["userid"], gu.UserName, Utils.ConvertUnicodeStringToChinese(Jd["rolename"]), int.Parse(Jd["level"]), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); break; } } catch (Exception) { gui.UserName = "******"; gui.Message = "查询失败!查询不到用户信息!"; } return(gui); }
/// <summary> /// 大将军查询接口 /// </summary> /// <param name="UserId">用户Id</param> /// <param name="ServerId">服务器Id</param> /// <returns>返回查询结果</returns> public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 string url = string.Format("op_id={0}&sid={1}&game_id={2}&accounts={3}&time={4}", gc.AgentId, gs.ServerNo, 7, gu.UserName, tstamp); //获取验证字符串 Base64Protector bp = new Base64Protector(); Auth = bp.Base64Code(url); //获取验证码 Sign = DESEncrypt.Md5(Auth + gc.SelectTicket, 32); //获取验证参数 string SelUrl = "http://" + gc.ExistCom + "?auth=" + Auth + "&verify=" + Sign; //获取查询地址 string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 try { SelResult = SelResult.Substring(0, SelResult.IndexOf('}')); //处理返回结果 SelResult = SelResult.Replace(SelResult.Substring(0, SelResult.LastIndexOf('{') + 1), ""); string[] b = SelResult.Split(','); gui = new GameUserInfo(b[0].Substring(12), gu.UserName, b[8].Substring(12).Replace("\"", ""), int.Parse(b[2].Substring(8).Replace("\"", "")), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); } catch (Exception) { gui.UserName = "******"; gui.Message = "error"; } return(gui); }
/// <summary> /// 神将三国查询接口 /// </summary> /// <param name="UserId"></param> /// <param name="ServerId"></param> /// <returns></returns> public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户信 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 Sign = DESEncrypt.Md5(gu.UserName + tstamp + gc.SelectTicket, 32); //获取验证参数 string SelUrl = "http://" + gs.ServerNo + "." + gc.ExistCom + "?username="******"&time=" + tstamp + "&flag=" + Sign; string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 try { switch (SelResult) { case "-1": gui.Message = "参数不全!"; break; case "-2": gui.Message = "验证失败或角色不存在"; break; default: SelResult = SelResult.Substring(0, SelResult.IndexOf('}')); //处理返回结果 SelResult = SelResult.Replace(SelResult.Substring(0, SelResult.LastIndexOf('{') + 1), ""); string[] b = SelResult.Split(','); gui = new GameUserInfo(b[0].Substring(9), gu.UserName, b[6].Substring(11).Replace("\"", ""), int.Parse(b[4].Substring(8).Replace("\"", "")), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); break; } } catch (Exception) { gui.Message = "Error"; } return(gui); }
/// <summary> /// 天界查询接口 /// </summary> /// <param name="UserId">用户Id</param> /// <param name="ServerId">服务器Id</param> /// <returns>放回查询结果</returns> public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户信 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 Sign = DESEncrypt.Md5("secret_key" + "api_key" + gc.AgentId + "server_id" + gs.ServerNo + "timestamp" + tstamp + "user_id" + gu.UserName, 32); //获取验证参数 string SelUrl = "http://" + gc.ExistCom + "?api_key=" + gc.AgentId + "&user_id=" + gu.UserName + "&server_id=" + gs.ServerNo + "timestamp" + tstamp + "&sign=" + Sign; string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 try { switch (SelResult) { case "ERROR_-1": gui.Message = "系统内部错误!"; break; case "ERROR_-100": gui.Message = "传入参数不符合规则!"; break; case "ERROR_-200": gui.Message = "系统错误!"; break; case "ERROR_-500": gui.Message = "数据库操作失误!"; break; case "ERROR_-1406": gui.Message = "角色不存在!"; break; case "ERROR_-1814": gui.Message = "超过方法最大调用次数!"; break; case "ERROR_-11000": gui.Message = "非法IP访问"; break; default: gui = new GameUserInfo(gu.Id.ToString(), gu.UserName, SelResult, 0, gs.Name, os.GetOrderInfo(gu.UserName), "Success"); break; } } catch (Exception) { gui.Message = "Error"; } return(gui); }
/// <summary> /// 女神联盟查询接口 /// </summary> /// <param name="UserId">用户Id</param> /// <param name="ServerId">服务器Id</param> /// <returns>返回查询结果</returns> public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 string url = string.Format("op_id={0}&sid={1}&game_id={2}&accounts={3}&time={4}", gc.AgentId, gs.ServerNo, 31, gu.UserName, tstamp); //获取验证字符串 Base64Protector bp = new Base64Protector(); Auth = bp.Base64Code(url); //获取验证码 Sign = DESEncrypt.Md5(Auth + gc.SelectTicket, 32); //获取验证参数 string SelUrl = "http://" + gc.ExistCom + "?auth=" + Auth + "&verify=" + Sign; //获取查询地址 try { string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 Dictionary <string, string> Jd = Json.JsonToArray(SelResult); if (Jd.ContainsKey("status")) { switch (Jd["status"]) //对充值结果进行解析 { case "1": gui.Message = "查询失败!错误原因:商家错误或者不存在!"; break; case "2": gui.Message = "查询失败!错误原因:服务器不存在!"; break; case "3": gui.Message = "查询失败!错误原因:游戏不存在!"; break; case "4": gui.Message = "查询失败!错误原因:无效时间戳!"; break; case "5": gui.Message = "查询失败!错误原因:检验码错误!"; break; case "6": gui.Message = "查询失败!错误原因:缺少参数!"; break; case "8": gui.Message = "查询失败!错误原因:角色不存在!"; break; case "10": gui.Message = "查询失败!错误原因:方法名字错误!"; break; case "11": gui.Message = "查询失败!错误原因:非法IP!"; break; case "100": gui.Message = "查询失败!错误原因:未知原因!"; break; } } else { gui = new GameUserInfo(gu.Id.ToString(), gu.UserName, Utils.ConvertUnicodeStringToChinese(Jd["role_name"]), int.Parse(Jd["level"]), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); } } catch (Exception ex) { gui.UserName = "******"; gui.Message = "查询失败!错误原因:" + ex.Message; } return(gui); }
/// <summary> /// 盗魂传角色查询接口 /// </summary> /// <param name="UserId">用户Id</param> /// <param name="ServerId">服务器Id</param> /// <returns>返回查询结果</returns> public Model.GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 //获取验证码 Sign = DESEncrypt.Md5(gc.AgentId + "|" + tstamp + "|" + gc.SelectTicket, 32); //获取验证参数 string SelUrl = "http://" + gc.ExistCom + "?type=character&ptid=" + gc.AgentId + "&tt=" + tstamp + "&account=" + gu.UserName + "&sign=" + Sign + ""; //获取查询地址 string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 try { SelResult = SelResult.Substring(0, SelResult.IndexOf('}')); //处理返回结果 SelResult = SelResult.Replace(SelResult.Substring(0, SelResult.LastIndexOf('{') + 1), ""); string[] b = SelResult.Split(','); gui = new GameUserInfo(b[0].Substring(14), gu.UserName, b[3].Substring(16).Replace("\'", ""), b[12].Substring(8) == "null" ? 0 : int.Parse(b[12].Substring(8)), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); } catch (Exception) { gui.UserName = "******"; gui.Message = "error"; } return(gui); }
/// <summary> /// 最无极查询接口 /// </summary> /// <param name="UserId">用户Id</param> /// <param name="ServerId">服务器Id</param> /// <returns>返回查询结果</returns> public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 Sign = DESEncrypt.Md5(gs.QuFu + gu.Id + tstamp + gc.SelectTicket, 32); //获取验证码 string SelUrl = "http://" + gc.ExistCom + "?user_id=" + gu.Id + "&server_id=" + gs.QuFu + "&time=" + tstamp + "&sign=" + Sign; try { string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 Dictionary <string, string> Jd = Json.JsonToArray(SelResult); gui = new GameUserInfo(Jd["id"], gu.UserName, Utils.ConvertUnicodeStringToChinese(Jd["name"]), int.Parse(Jd["level"]), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); } catch (Exception) { gui.UserName = "******"; gui.Message = "查询失败!查询不到用户信息!"; } return(gui); }
/// <summary> /// 楚汉传奇查询接口 /// </summary> /// <param name="UserId">用户Id</param> /// <param name="ServerId">服务器Id</param> /// <returns>放回用户信息</returns> public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 Sign = DESEncrypt.Md5("from=" + gc.AgentId + "game=chuhan" + "server=" + gs.ServerNo + "user_id=" + gu.UserName + "t=" + tstamp + "transfer_secret_signature=" + gc.SelectTicket, 32); //获取验证码 string SelUrl = "http://" + gc.ExistCom + "?from=" + gc.AgentId + "&game=chuhan&server=" + gs.ServerNo + "&user_id=" + gu.UserName + "&t=" + tstamp + "&signature=" + Sign; string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 try { SelResult = SelResult.Substring(0, SelResult.IndexOf('}')); //处理返回结果 SelResult = SelResult.Replace(SelResult.Substring(0, SelResult.LastIndexOf('{') + 1), ""); string[] b = SelResult.Split(','); gui = new GameUserInfo(b[6].Substring(9), gu.UserName, b[7].Substring(11).Replace("\"", ""), int.Parse(b[4].Substring(8)), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); } catch (Exception) { gui.UserName = "******"; gui.Message = "查询失败!查询不到用户信息!"; } return(gui); }
public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 Sign = DESEncrypt.Md5(gu.UserName + tstamp + gc.SelectTicket + gs.QuFu, 32); //获取验证参数 string SelUrl = "http://" + gs.ServerNo + "." + gc.ExistCom + "?uid=" + gu.UserName; //获取查询地址 string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 try { XmlDocument MyXml = new XmlDocument(); MyXml.LoadXml(SelResult); XmlNode ShowList = MyXml.DocumentElement; Dictionary <string, string> list = new Dictionary <string, string>(); foreach (XmlNode item in ShowList.Attributes) { list.Add(item.Name, item.InnerText); } gui = new GameUserInfo(list["player_id"], gu.UserName, Utils.ConvertUnicodeStringToChinese(list["playername"]), int.Parse(list["lv"]), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); } catch (Exception) { gui.UserName = "******"; gui.Message = "error"; } return(gui); }
/// <summary> /// 武尊查询接口 /// </summary> /// <param name="UserId">用户Id</param> /// <param name="ServerId">服务器Id</param> /// <returns>返回查询结果</returns> public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 Sign = DESEncrypt.Md5(gu.UserName + gc.SelectTicket, 32); //获取验证参数 string SelUrl = "http://" + gs.ServerNo + "." + gc.ExistCom + "?username="******"&verify=" + Sign; //获取查询地址 string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 try { switch (SelResult) { case "-1": gui.UserName = "******"; gui.Message = "缺少参数!"; break; case "-2": gui.UserName = "******"; gui.Message = "验证参数错误!"; break; case "0": gui.UserName = "******"; gui.Message = "账号下未找到角色!"; break; default: SelResult = SelResult.Substring(0, SelResult.IndexOf('}')); //处理返回结果 SelResult = SelResult.Replace(SelResult.Substring(0, SelResult.LastIndexOf('{') + 1), ""); string[] b = SelResult.Split(','); gui = new GameUserInfo(gu.Id.ToString(), gu.UserName, Utils.UrlDecode(b[0].Substring(10).Replace("\"", "")), int.Parse(b[1].Substring(5).Replace("\"", "")), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); break; } } catch (Exception) { gui.UserName = "******"; gui.Message = "查询失败!"; } return(gui); }
/// <summary> /// 热血海贼王查询接口 /// </summary> /// <param name="UserId">用户Id</param> /// <param name="ServerId">服务器Id</param> /// <returns>返回查询结果</returns> public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户信 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 Sign = DESEncrypt.Md5("get_player_info_" + tstamp + "_" + gc.SelectTicket, 32); //获取验证参数 string SelUrl = "http://" + gs.ServerNo + "." + gc.ExistCom + "?server_id=" + gs.ServerNo + "&time=" + tstamp + "&sign=" + Sign + "&format=xml&qids=" + gu.Id + ""; string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 try { Dictionary <string, string> list = XmlHelper.ReadXml2(SelResult); //解析返回结果 gui = new GameUserInfo(list["qid"], gu.UserName, list["name"], int.Parse(list["level"]), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); } catch (Exception) { gui.Message = "查询失败!查询不到用户信息!"; } return(gui); }
/// <summary> /// 绝代双骄查询接口 /// </summary> /// <param name="UserId">用户Id</param> /// <param name="ServerId">服务器Id</param> /// <returns>返回查询结果</returns> public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户信 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 Sign = DESEncrypt.Md5("uid=" + gu.Id + "&uname=" + gu.UserName + "&serverid=" + gs.ServerNo + "&type=" + gc.AgentId + "&key=" + gc.SelectTicket, 32); //获取验证参数 string SelUrl = "http://" + gc.ExistCom + "?uid=" + gu.Id + "&uname=" + gu.UserName + "&serverid=" + gs.ServerNo + "&type=" + gc.AgentId + "&sign=" + Sign; string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 try { SelResult = SelResult.Substring(0, SelResult.IndexOf('}')); //处理返回结果 SelResult = SelResult.Replace(SelResult.Substring(0, SelResult.LastIndexOf('{') + 1), ""); string[] b = SelResult.Split(','); switch (b[0].Substring(9).Replace("\"", "")) { case "601": gui.Message = "查询失败!缺少用户!"; break; case "602": gui.Message = "查询失败!缺少用户名!"; break; case "603": gui.Message = "查询失败!服务器编号不存在!"; break; case "604": gui.Message = "查询失败!缺少运营商标识!"; break; case "606": gui.Message = "查询失败!缺少验证参数!"; break; case "607": gui.Message = "查询失败!非法的访问IP!"; break; case "608": gui.Message = "查询失败!验证失败!"; break; case "609": gui.Message = "查询失败!用户不存在!"; break; case "610": gui.Message = "查询失败!角色不存在!"; break; default: string a = b[0].Replace("\\\"", ""); gui = new GameUserInfo(b[0].Replace("\\\"", "").Substring(7), gu.UserName, Utils.ConvertUnicodeStringToChinese(b[2].Replace("\\\\\"", "").Substring(6)), int.Parse(b[3].Replace("\\\"", "").Substring(6)), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); break; } } catch (Exception) { gui.Message = "查询失败!查询不到用户信息!"; } return(gui); }
/// <summary> /// 仙侠傲世查询接口 /// </summary> /// <param name="UserId">用户Id</param> /// <param name="ServerId">服务器Id</param> /// <returns>返回查询结果</returns> public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 Sign = DESEncrypt.Md5(gu.UserName + tstamp + DESEncrypt.Md5(gc.SelectTicket, 32), 32); //获取验证码 string SelUrl = "http://" + gs.ServerNo + "." + gc.ExistCom + "/api/check_role.php?account=" + gu.UserName + "&time=" + tstamp + "&flag=" + Sign + "&server_id=" + gs.ServerNo; try { string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 switch (SelResult) { case "-1": gui.Message = "查询失败!参数不全!"; break; case "-2": gui.Message = "查询失败!验证失败!"; break; case "-3": gui.Message = "查询失败!用户不存在!"; break; default: Dictionary <string, string> Jd = Json.JsonToArray(SelResult); gui = new GameUserInfo(Jd["role_id"], gu.UserName, Utils.ConvertUnicodeStringToChinese(Jd["role_name"]), int.Parse(Jd["level"]), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); break; } } catch (Exception) { gui.UserName = "******"; gui.Message = "查询失败!查询不到用户信息!"; } return(gui); }
/// <summary> /// 一剑轩辕查询接口 /// </summary> /// <param name="UserId">用户Id</param> /// <param name="ServerId">服务器Id</param> /// <returns>返回查询结果</returns> public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 Sign = DESEncrypt.Md5(gu.UserName + "|" + tstamp + "|" + gs.QuFu + "|" + gc.SelectTicket, 32); //获取验证参数 string SelUrl = "http://" + gs.ServerNo + "." + gc.ExistCom + "?accname=" + gu.UserName + "&ts=" + tstamp + "&serverid=" + gs.QuFu + "&sign=" + Sign; //获取查询地址 string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 try { Dictionary <string, string> Jd = Json.JsonToArray(SelResult); gui = new GameUserInfo(Jd["role_id"], gu.UserName, Jd["role_name"], int.Parse(Jd["lv"]), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); } catch (Exception) { gui.UserName = "******"; gui.Message = "error"; } return(gui); }
/// <summary> /// 天行剑查询接口 /// </summary> /// <param name="UserId">用户Id</param> /// <param name="ServerId">服务器Id</param> /// <returns>返回查询结果</returns> public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 Sign = DESEncrypt.Md5(gu.UserName + tstamp + gc.SelectTicket, 32); //获取验证参数 string SelUrl = "http://" + gs.ServerNo + "." + gc.ExistCom + "?username="******"&time=" + tstamp + "&flag=" + Sign; //获取查询地址 string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 try { switch (SelResult) { case "0": gui.Message = "查询失败!未知错误!"; break; case "2": gui.Message = "查询失败!用户不存在!"; break; case "3": gui.Message = "查询失败!非法访问IP!"; break; case "4": gui.Message = "查询失败!参数错误!"; break; case "5": gui.Message = "查询失败!验证失败!"; break; default: SelResult = SelResult.Substring(0, SelResult.IndexOf('}')); //处理返回结果 SelResult = SelResult.Replace(SelResult.Substring(0, SelResult.LastIndexOf('{') + 1), ""); string[] b = SelResult.Split(','); gui = new GameUserInfo(b[0].Substring(5).Replace("\"", ""), gu.UserName, Utils.ConvertUnicodeStringToChinese(b[1].Substring(12).Replace("\"", "")), int.Parse(b[3].Substring(8).Replace("\"", "")), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); break; } } catch (Exception) { gui.UserName = "******"; gui.Message = "查询失败!查询不到用户信息!"; } return(gui); }
/// <summary> /// 街机三国查询接口 /// </summary> /// <param name="UserId">用户Id</param> /// <param name="ServerId">服务器Id</param> /// <returns>返回查询结果</returns> public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 Sign = DESEncrypt.Md5(gu.Id + gc.AgentId + tstamp + gs.ServerNo + gc.LoginTicket, 32); //获取验证参数 string SelUrl = "http://" + gc.ExistCom + "?user="******"&platform=" + gc.AgentId + "&time=" + tstamp + "&server_id=" + gs.ServerNo + "&sign=" + Sign + ""; try { string SelResult = Utils.GetWebPageContent(SelUrl); //获取查询结果 switch (SelResult) //对查询结果进行解析 { case "1": gui.Message = "查询失败!用户参数错误!"; break; case "2": gui.Message = "查询失败!服务器不存在!"; break; case "3": gui.Message = "查询失败!用户不存在!"; break; case "4": gui.Message = "查询失败!验证参数错误!"; break; case "5": gui.Message = "查询失败!无效的请求!"; break; case "6": gui.Message = "查询失败!请求超时!"; break; case "7": gui.Message = "查询失败!无效的平台标识!"; break; default: SelResult = SelResult.Substring(0, SelResult.IndexOf('}')); //处理返回结果 SelResult = SelResult.Replace(SelResult.Substring(0, SelResult.LastIndexOf('{') + 1), ""); string[] b = SelResult.Split(','); gui = new GameUserInfo(b[0].Substring(7).Replace("\"", ""), gu.UserName, Utils.ConvertUnicodeStringToChinese(b[1].Substring(11).Replace("\"", "")), int.Parse(b[2].Substring(8).Replace("\"", "")), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); break; } } catch (Exception) { gui.Message = "查询失败!查询不到用户信息!"; } return(gui); }
/// <summary> /// 烈焰用户查询接口 /// </summary> /// <param name="UserId">用户Id</param> /// <param name="ServerId">服务器Id</param> /// <returns>查询结果</returns> public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 Sign = DESEncrypt.Md5(gu.UserName + "." + tstamp + "." + gc.SelectTicket, 32); //获取验证码 string SelUrl = "http://" + gs.ServerNo + "." + gc.ExistCom + "?id=" + gu.UserName + "&time=" + tstamp + "&sign=" + Sign; string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 try { SelResult = SelResult.Substring(0, SelResult.IndexOf('}')); //处理返回结果 SelResult = SelResult.Replace(SelResult.Substring(0, SelResult.LastIndexOf('{') + 1), ""); string[] b = SelResult.Split(','); gui = new GameUserInfo(gu.Id.ToString(), gu.UserName, Utils.ConvertUnicodeStringToChinese(b[0].Substring(7).Replace("\"", "")), int.Parse(b[1].Substring(8).Replace("\"", "")), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); } catch (Exception) { gui.Message = "error"; } return(gui); }
/// <summary> /// 斗破乾坤查询接口 /// </summary> /// <param name="UserId">用户Id</param> /// <param name="ServerId">服务器Id</param> /// <returns>返回查询结果</returns> public GameUserInfo Sel(int UserId, int ServerId) { gu = gus.GetGameUser(UserId); //获取查询用户 gs = gss.GetGameServer(ServerId); //获取查询用户所在区服 tstamp = Utils.GetTimeSpan(); //获取时间戳 GameUserInfo gui = new GameUserInfo(); //定义返回查询结果信息 Sign = DESEncrypt.Md5("account=" + gu.UserName + "&action=playerinfo&agent=" + gc.AgentId + "&serverid=" + gs.ServerNo + "&time=" + tstamp + "&" + gc.SelectTicket, 32); //获取验证参数 string SelUrl = "http://" + gs.ServerNo + "." + gc.ExistCom + "?account=" + gu.UserName + "&action=playerinfo&agent=" + gc.AgentId + "&serverid=" + gs.ServerNo + "&time=" + tstamp + "&token=" + Sign + ""; //获取查询地址 string SelResult = Utils.GetWebPageContent(SelUrl); //获取返回结果 try { switch (SelResult) { case "-501": gui.Message = "查询账号数量超过限制"; break; case "-207": gui.Message = "无效玩家账号"; break; default: SelResult = SelResult.Substring(0, SelResult.IndexOf('}')); //处理返回结果 SelResult = SelResult.Replace(SelResult.Substring(0, SelResult.LastIndexOf('{') + 1), ""); string[] b = SelResult.Split(','); switch (b[0].Substring(7)) { case "-101": gui.Message = "查询失败!无效访问!"; break; case "-102": gui.Message = "查询失败!验证失败!"; break; case "-209": gui.Message = "查询失败!无效参数!"; break; case "-401": gui.Message = "查询失败!链接超时!"; break; case "-304": gui.Message = "查询失败!IP限制!"; break; default: gui = new GameUserInfo(gu.Id.ToString(), gu.UserName, b[1].Substring(7).Replace("\"", ""), int.Parse(b[0].Substring(8).Replace("\"", "")), gs.Name, os.GetOrderInfo(gu.UserName), "Success"); break; } break; } } catch (Exception) { gui.UserName = "******"; gui.Message = "查询失败!查询不到用户信息!"; } return(gui); }