public string DoUpadatePwd() { string Pwd = Request["PWD"]; string APwd = Request["APwd"]; if (string.IsNullOrEmpty(Pwd.Trim())) { return("请输入密码!"); } if (!DevRegHel.RegPwd(Pwd.Trim())) { return("密码输入错误!"); } if (Pwd.Trim() != APwd.Trim()) { return("两次输入的密码不一致!"); } int UserId = BBRequest.GetUserId(); int Type = (int)Session["Type"]; if (UserId > 0) { GameUser gu = gum.GetGameUser(UserId); gu.PWD = DESEncrypt.Md5(Pwd, 32); gum.UpdateUser(gu); vdcm.DelValiDateCode(UserId, Type); } else { return("您的验证已过期!"); } return(null); }
public string DoTg() { GameUser gu = new GameUser(); string UserName = Request["UserName"].Trim(); string Pwd = Request["PWD"].Trim(); if (!DevRegHel.RegName(UserName)) { return("您输入的用户名不可用!"); } if (!DevRegHel.RegPwd(Pwd)) { return("您输入的密码不可用!"); } if (alm.IsLock(BBRequest.GetIP())) { return("您暂时不能注册!"); } try { string Action = Request["Action"]; int Source = 0; int RegGame = 0; Games g = new Games(); if (string.IsNullOrEmpty(Action)) { return("缺少参数!"); } else if (alm.IsLock(Action) || alm.IsLock(BBRequest.GetIP())) { return("参数错误!"); } else { int s = 0; string[] a = DESEncrypt.Decrypt(Action).Split('|'); string b = a[0]; string c = a[1]; if (int.TryParse(a[0], out s) && int.TryParse(a[1], out s)) { gu = gum.GetGameUser(int.Parse(a[0])); if (gu != null) { if (gu.IsSpreader > 0) { Source = int.Parse(a[0]); RegGame = int.Parse(a[1]); g = gm.GetGame(RegGame); if (!(g.tjqf > 0)) { return("游戏还未设置推荐服务器!"); } } else { return("参数错误!"); } } } } gu = new GameUser(0, Request["UserName"], DESEncrypt.Md5(Request["PWD"], 32), "", "0", "", "", "", "" , "", "", "", "1", Source, "", 0, 0, 0, 0, 0, 0, DateTime.Now, DateTime.Now, 0, 0, 0, 0, BBRequest.GetIP(), "", RegGame, "", ""); if (Session["annalID"] != null) { string annalID = Session["annalID"].ToString().Trim(); if (!string.IsNullOrEmpty(annalID)) { gu.annalID = annalID; gu.From_Url = "BengBeng"; string SelUrl = "http://www.bengbeng.com/reannal.php?adID=2618&annalID=" + annalID + "&idCode=" + gu.UserName + "&doukey=" + DESEncrypt.Md5("2618" + annalID + gu.UserName + "06bd24c6124b2dd7", 32); string SleRes = Utils.GetWebPageContent(SelUrl); Dictionary <string, string> Jd = Common.Json.JsonToArray(SleRes); if (Jd["result"] != "1") { return(Jd["message"]); } } else { return("缺少参数!"); } } if (gum.AddUser(gu)) { int Id = gum.GetGameUser(UserName).Id; sysmsg sm = new sysmsg(); sm.title = "注册成功消息"; sm.type = 2; sm.userid = Id; sm.fromid = 0; sm.msg = "恭喜您成功注册5577游戏账号,您可凭借此账号登录5577游戏旗下任何一款游戏,祝您游戏愉快。如果您在游戏过程中遇到任何问题,欢迎您致电客服咨询。"; smm.AddSysMsg(sm); Session[Keys.SESSION_USER] = Id; Session.Timeout = 120; GameServer gs = new ServersMananger().GetGameServer(g.tjqf); return(g.GameNo + "|" + gs.QuFu); } else { return("注册失败!"); } } catch (Exception ex) { gu.IsLock = 1; gu.UserDesc = "此用户为注册失败用户!失败原因:" + ex.Message; gum.UpdateUser(gu); //gum.DelGameUser(UserName); return("注册失败!错误:" + ex.Message); } }
public string AddUnderSpreader() { GameUser gu = new GameUser(); string UserName = Request["UserName"].Trim(); string Pwd = Request["PWD"].Trim(); int UserId = BBRequest.GetUserId(); if (UserId > 0) { GameUser Spreader = gum.GetGameUser(UserId); if (Spreader.IsSpreader > 1) { } else { return("您不是推广团长,不能添加推广员!"); } } else { return("您还未登陆,不能添加推广员!"); } if (!DevRegHel.RegName(UserName)) { return("您输入的用户名不可用!"); } if (!DevRegHel.RegPwd(Pwd)) { return("您输入的密码不可用!"); } if (alm.IsLock(BBRequest.GetIP())) { return("您暂时不能注册!"); } gu = new GameUser(0, Request["UserName"], DESEncrypt.Md5(Request["PWD"], 32), "", "0", "", "", "", "" , "", "", "", "1", UserId, "", 0, 0, 0, 0, 1, 0, DateTime.Now, DateTime.Now, 0, 0, 0, 0, BBRequest.GetIP(), "", 0, "", ""); try { if (gum.AddUser(gu)) { int Id = gum.GetGameUser(UserName).Id; sysmsg sm = new sysmsg(); sm.title = "注册成功消息"; sm.type = 2; sm.userid = Id; sm.fromid = 0; sm.msg = "恭喜您成功注册5577游戏账号,您可凭借此账号登录5577游戏旗下任何一款游戏,祝您游戏愉快。如果您在游戏过程中遇到任何问题,欢迎您致电客服咨询。"; smm.AddSysMsg(sm); //Session[Keys.SESSION_USER] = Id; //Session.Timeout = 120; //validatecode vdc = new validatecode(); //vdcm.DelValiDateCode(Id, 1); //vdc.type = 1; //vdc.userid = Id; //vdc.sendtime = DateTime.Now; //vdc.code = Guid.NewGuid().ToString() + DateTime.Now.Minute + DateTime.Now.Millisecond; //vdc.email = gu.Email.Trim(); //vdcm.AddValiDateCode(vdc); //string ucode = DESEncrypt.encryptstring1(vdc.userid.ToString()); //string tcode = DESEncrypt.encryptstring1(vdc.type.ToString()); //string scode = vdc.code.ToString(); //string vicode = vdc.sendtime.ToString("yyyy-MM-ddHH:mm:ss"); return("True"); } else { return("注册失败!"); } } catch (Exception ex) { gu.IsLock = 1; gu.UserDesc = "此用户为注册失败用户!失败原因:" + ex.Message; gum.UpdateUser(gu); //gum.DelGameUser(UserName); return("注册失败!错误:" + ex.Message); } }
public string DoReg() { GameUser gu = new GameUser(); string UserName = Request["UserName"].Trim(); string Pwd = Request["PWD"].Trim(); string Card = Request["Card"].Trim(); string Email = Request["Email"].Trim(); string Code = Request["Code"].Trim(); if (!DevRegHel.RegName(UserName)) { return("您输入的用户名不可用!"); } if (!DevRegHel.RegPwd(Pwd)) { return("您输入的密码不可用!"); } if (!DevRegHel.RegCard(Card)) { return("您输入的身份证不可用!"); } if (!DevRegHel.RegEmail(Email)) { return("您输入的邮箱不可用!"); } if (gum.IsGameUser(UserName)) { return("您输入的用户名已被注册!"); } if (Session[Keys.SESSION_CODE] == null) { return("验证码已过期,请刷新验证码!"); } if (Session[Keys.SESSION_CODE].ToString().ToUpper() != Code.ToUpper()) { return("您输入的验证码不正确!"); } if (Request["Ck"].Trim() != "on") { return("请务必确认您已经阅读服务条款!"); } if (alm.IsLock(BBRequest.GetIP())) { return("您暂时不能注册!"); } if (gum.ExitEmail(Request["Email"])) { return("您的邮箱已经注册过!"); } gu = new GameUser(0, Request["UserName"], DESEncrypt.Md5(Request["PWD"], 32), "", Request["Sex"], "", "", Request["RealName"], Request["Email"] , "", Request["Birthday"], Request["Card"], "1", 0, "", 0, 0, 0, 0, 0, 0, DateTime.Now, DateTime.Now, 0, 0, 0, 0, BBRequest.GetIP(), "", 0, "", ""); try { if (gum.AddUser(gu)) { int Id = gum.GetGameUser(UserName).Id; sysmsg sm = new sysmsg(); sm.title = "注册成功消息"; sm.type = 2; sm.userid = Id; sm.fromid = 0; sm.msg = "恭喜您成功注册5577游戏账号,您可凭借此账号登录5577游戏旗下任何一款游戏,祝您游戏愉快。如果您在游戏过程中遇到任何问题,欢迎您致电客服咨询。"; smm.AddSysMsg(sm); Session[Keys.SESSION_USER] = Id; Session.Timeout = 120; validatecode vdc = new validatecode(); vdcm.DelValiDateCode(Id, 1); vdc.type = 1; vdc.userid = Id; vdc.sendtime = DateTime.Now; vdc.code = Guid.NewGuid().ToString() + DateTime.Now.Minute + DateTime.Now.Millisecond; vdc.email = gu.Email.Trim(); vdcm.AddValiDateCode(vdc); //string ucode = DESEncrypt.encryptstring1(vdc.userid.ToString()); //string tcode = DESEncrypt.encryptstring1(vdc.type.ToString()); //string scode = vdc.code.ToString(); //string vicode = vdc.sendtime.ToString("yyyy-MM-ddHH:mm:ss"); return("True"); } else { return("注册失败!"); } } catch (Exception ex) { gu.IsLock = 1; gu.UserDesc = "此用户为注册失败用户!失败原因:" + ex.Message; gum.UpdateUser(gu); //gum.DelGameUser(UserName); return("注册失败!错误:" + ex.Message); } }