public string DoLogin() { string UserName = Request["UserName"].Trim(); string PWD = Request["PWD"].Trim(); string Code = Request["Code"].Trim(); if (string.IsNullOrEmpty(UserName)) { return("请输入用户名!"); } if (string.IsNullOrEmpty(PWD)) { return("请输入密码!"); } if (string.IsNullOrEmpty(Code)) { return("请输入验证码!"); } if (Session[Keys.SESSION_CODE] == null) { return("验证码已过期,请刷新验证码!"); } if (Code.ToLower() != Session[Keys.SESSION_CODE].ToString().ToLower()) { return("您输入的验证码不正确!"); } if (!gum.IsGameUser(UserName)) { return("您输入的用户不存在!"); } GameUser gu = new GameUser(); gu = gum.GetGameUser(UserName, DESEncrypt.Md5(PWD, 32)); if (gu == null) { return("您输入的用户或密码有误!"); } if (gu.IsLock == 1) { return("您输入的用户或密码有误!"); } if (alm.IsLock(BBRequest.GetIP())) { return("您输入的用户或密码有误!"); } Session[Keys.SESSION_USER] = gu.Id; Session.Timeout = 120; gum.UpdateLastLogin(gu.Id); if (Request["ck1"] == "on") { Utils.WriteCookie("6qmgamesame", DESEncrypt.DesEncrypt(UserName) + "|" + DESEncrypt.DesEncrypt(PWD), 10080); } else { Utils.WriteCookie("6qmgamesame", "", -10); } return("True"); }
public ActionResult Index() { try { string Action = Request["Action"]; string annalID = Request["annalID"]; if (string.IsNullOrEmpty(Action)) { return(Redirect("about:blank")); } else if (alm.IsLock(Action)) { return(Redirect("about:blank")); } else if (alm.IsLock(BBRequest.GetIP())) { return(Redirect("about:blank")); } 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)) { GameUser gu = new GameUser(); gu = gum.GetGameUser(int.Parse(a[0])); if (gu != null) { if (gu.IsSpreader > 0) { ViewData["Action"] = Action; } else { return(Redirect("about:blank")); } } } } if (!string.IsNullOrEmpty(annalID)) { Session["annalID"] = annalID; } } catch (Exception) { return(Redirect("about:blank")); } return(View("~/Views/SpreadCenter/Tg.cshtml")); }
public ActionResult Index() { ViewData["UserCenterOn"] = "current"; ViewData["YejiOn"] = "chosen"; int UserId = BBRequest.GetUserId(); if (UserId > 0) { GameUser gu = gum.GetGameUser(UserId); if (gu.IsSpreader > 0) { ViewData["Photo"] = gu.Photo; ViewData["SpreadCount"] = om.GetAllSpreadCount(UserId); ViewData["UserName"] = gu.UserName; ViewData["SpreadMoney"] = om.GetSumMoney(UserId, ""); ViewData["Style"] = "display:none"; if (gu.IsSpreader == 2) { ViewData["CaoZuo"] = "<th>操作</th>"; ViewData["Style"] = ""; } } else { return(RedirectToAction("Index", "Home")); } } else { return(RedirectToAction("Login", "SpreadCenter")); } return(View()); }
public ActionResult PromoDetial(int Id) { if (Session[Keys.SESSION_ADMIN_INFO] == null) { return(RedirectToAction("Login", "Admin")); } else { Master master = Session[Keys.SESSION_ADMIN_INFO] as Master; if (rcm.GetRoleCompetence(master.RoleId, 1261)) { GameUser gu = gum.GetGameUser(Id); if (gu.IsSpreader > 0) { ViewData["SpreadCount"] = om.GetAllSpreadCount(Id); ViewData["UserName"] = gu.UserName; ViewData["SpreadMoney"] = om.GetSumMoney(Id, ""); Session[Keys.SESSION_USER] = Id; } } else { return(RedirectToAction("Login", "Admin")); } } return(View()); }
private void UpdateUserSource(HttpContext context) { string Ud = context.Request["Ud"]; int UserId = int.Parse(context.Request["Id"]); GameUser gu = gum.GetGameUser(UserId); if (Ud == "U") { gu.IsSpreader = 1; } else { gu.IsSpreader = 0; } context.Response.Write(gum.UpdateUser(gu)); }
public ActionResult Lottery() { int UserId = BBRequest.GetUserId(); if (UserId > 0) { GameUser gu = gum.GetGameUser(UserId); ViewData["UserName"] = gu.UserName; ViewData["Points"] = gu.Points; ViewData["LotteryInfo"] = GetLotteryInfo(); return(View()); } else { return(RedirectToAction("Login", "Home")); } }
public ActionResult EidtUser(int Id) { if (Session[Keys.SESSION_ADMIN_INFO] == null) { return(RedirectToAction("Login", "Admin")); } else { Master master = Session[Keys.SESSION_ADMIN_INFO] as Master; if (rcm.GetRoleCompetence(master.RoleId, 1311)) { GameUser gu = gum.GetGameUser(Id); ViewData["UserId"] = gu.Id; ViewData["UserName"] = gu.UserName; ViewData["Sex"] = gu.Sex == "0" ? "男" : "女"; ViewData["Phone"] = gu.Phone; ViewData["RealName"] = gu.RealName; ViewData["Email"] = gu.Email; ViewData["QQ"] = gu.QQ; ViewData["Cards"] = gu.Cards; ViewData["IsSpreader"] = gu.IsSpreader; ViewData["GradeId"] = gu.GradeId; ViewData["Money"] = gu.Money; ViewData["GameMoney"] = gu.GameMoney; ViewData["Points"] = gu.Points; ViewData["BirthDay"] = gu.BirthDay; ViewData["Source"] = gu.Source > 0 ? gum.GetGameUser(gu.Source).UserName : "******"; ViewData["RegGame"] = gu.RegGame; ViewData["AddTime"] = gu.AddTime; ViewData["LastLoginTime"] = gu.LastLoginTime; ViewData["Ip"] = gu.Ip; ViewData["IsValiDate"] = gu.IsValiDate == 1 ? "已验证" : "未验证"; ViewData["IsLock"] = gu.IsLock == 1 ? "锁定" : "正常"; ViewData["UserDesc"] = gu.UserDesc; return(View("GameUser")); } else { return(RedirectToAction("Login", "Admin")); } } }
public ActionResult WdServers() { int UserId = BBRequest.GetUserId(); g = gm.GetGame("jstm"); if (UserId > 0) { GameUser gu = new GameUser(); gu = gum.GetGameUser(UserId); ViewData["UserName"] = gu.UserName; ViewData["TjqfHref"] = "#"; ViewData["TjqfName"] = "暂无"; ViewData["LLHref"] = "#"; ViewData["LLName"] = "最近没有玩游戏哦"; OnlineLog ol = new OnlineLog(); ol = new OnlineLogManager().GetLastLogin(UserId, g.Id); if (ol != null) { GameServer Llqf = sm.GetGameServer(ol.ServerId); ViewData["LLHref"] = "client://loadgame|http://www.5577yx.com/" + g.GameNo + "/LoginGame?S=" + Llqf.QuFu; ViewData["LLName"] = Llqf.Name; } if (g.tjqf > 0) { GameServer tjqf = sm.GetGameServer(g.tjqf); ViewData["TjqfHref"] = "client://loadgame|http://www.5577yx.com/" + g.GameNo + "/LoginGame?S=" + tjqf.QuFu; ViewData["TjqfName"] = tjqf.Name; } List <GameServer> gsList = new List <GameServer>(); gsList = sm.GetServersByGame(g.Id); string ServerHtml = ""; List <GameServer> serverList = new List <GameServer>(); foreach (GameServer gs in gsList) { if (gs.State == 3 || gs.State == 4) { serverList.Add(gs); //<li><div class="tpb"><a class="btn" href="http://www.5577yx.com/" + @g. + "/LoginGame?S=" + gs.QuFu + "\" target=\"_self\">" + gs.Name" onclick="gotoPlay('89','s86_86')" title="双线86区">[双线86区]</a></div></li> ServerHtml += "<li><div class=\"tpb\"><a class=\"btn\" href=\"http://www.5577yx.com/" + g.GameNo + "/LoginGame?S=" + gs.QuFu + "\" target=\"_self\">" + "[" + gs.Name + "]" + "</a></div></li>"; } } ViewData["gsHtml"] = ServerHtml; // ViewData["serverList"] = serverList; Utils.WriteCookie2("miniloader", "1", "5577yx.com"); return(View()); } else { return(RedirectToAction("Wd")); } }
public ActionResult WdServers() { int UserId = BBRequest.GetUserId(); g = gm.GetGame("ahxx"); if (UserId > 0) { GameUser gu = new GameUser(); gu = gum.GetGameUser(UserId); ViewData["UserName"] = gu.UserName; ViewData["TjqfHref"] = "#"; ViewData["TjqfName"] = "暂无"; ViewData["LLHref"] = "#"; ViewData["LLName"] = "最近没有玩游戏哦"; OnlineLog ol = new OnlineLog(); ol = new OnlineLogManager().GetLastLogin(UserId, g.Id); if (ol != null) { GameServer Llqf = sm.GetGameServer(ol.ServerId); ViewData["LLHref"] = "client://loadgame|http://www.5577yx.com/" + g.GameNo + "/LoginGame?S=" + Llqf.QuFu; ViewData["LLName"] = Llqf.Name; } if (g.tjqf > 0) { GameServer tjqf = sm.GetGameServer(g.tjqf); ViewData["TjqfHref"] = "client://loadgame|http://www.5577yx.com/" + g.GameNo + "/LoginGame?S=" + tjqf.QuFu; ViewData["TjqfName"] = tjqf.Name; } List <GameServer> gsList = new List <GameServer>(); gsList = sm.GetServersByGame(g.Id); //string ServerHtml = ""; List <GameServer> serverList = new List <GameServer>(); foreach (GameServer gs in gsList) { if (gs.State == 3 || gs.State == 4) { serverList.Add(gs); //ServerHtml += "<a href=\"client://loadgame|http://www.5577yx.com/" + g.GameNo + "/LoginGame?S=" + gs.QuFu + "\" target=\"_self\">" + gs.Name + "</a>"; } } //ViewData["gsHtml"] = ServerHtml; ViewData["serverList"] = serverList; Utils.WriteCookie2("miniloader", "1", "5577yx.com"); return(View()); } else { return(RedirectToAction("Wd")); } }
public string BengbengSel() { string UserName = Request["idCode"]; string GameNo = Request["GameNo"]; string Code = Request["Code"]; if (Code == DESEncrypt.Md5(UserName + GameNo + "717915FEC23F46D5", 32)) { try { GameUser gu = gum.GetGameUser(UserName); Games game = gm.GetGame(GameNo); List <string> list = olm.GetServerList(game.Id, gu.Id.ToString()); GameUserInfo gui = new GameUserInfo(); GameServer gs = new GameServer(); foreach (string server in list) { GameUserInfo gui2 = gm.GetGameUserInfo(game.Id, gu.Id, int.Parse(server)); if (gui2.Level > gui.Level) { gui = gui2; gs = sm.GetGameServer(int.Parse(server)); } } if (gui.Level > 0) { string Status = "0"; if (!string.IsNullOrEmpty(gu.annalID) && gu.From_Url == "BengBeng") { Status = "1"; } string Res = "{\"Result\":{\"Status\":\"" + Status + "\",\"UserID\":\"" + gu.Id + "\",\"UserName\":\"" + gu.UserName + "\",\"UserServer\":\"" + gs.QuFu + "\",\"ServerName\":\"" + gui.ServerName + "\",\"UserRole\":\"" + gui.UserName + "\",\"UserLevel\":\"" + gui.Level + "\",\"ChongZhi\":\"" + gui.Money + "\"}}"; return(Res); } else { return("没有等级大于0的角色!"); } } catch (Exception ex) { return("查询异常:" + ex.Message); } } else { return("验证失败!"); } }
public ActionResult Index() { ViewData["MyInfoOn"] = "ch_son_p_cur"; ViewData["UserInfoON"] = "ch_id_cur"; ViewData["menu1On"] = "pay_menu_cur1"; ViewData["menu2On"] = "reddot"; ViewData["menu3On"] = "reddot"; int UserId = BBRequest.GetUserId(); if (UserId > 0) { GameUser gu = gum.GetGameUser(UserId); ViewData["Photo"] = gu.Photo; ViewData["UserName"] = gu.UserName; ViewData["Money"] = gu.Money; ViewData["FlMoney"] = gu.RebateMoney; ViewData["vip"] = gu.GradeId > 0 ? "vip1_12.jpg" : "vip11_0.jpg"; if (gu.IsSpreader <= 0) { ViewData["IsSpread"] = "display:none"; } List <GameServer> NewServerlist = new List <GameServer>(); NewServerlist = sm.GetNewsServer(6); ViewData["NewServerHtml"] = hh.GetNewServerHtml(NewServerlist); ViewData["MsgCount"] = smm.GetSysMsgCount(gu.Id); } else { return(RedirectToAction("Login", "Home")); } string LoginOnline = ""; List <OnlineLog> list = new List <OnlineLog>(); list = olm.GetOnlineLog(UserId, 4); foreach (OnlineLog ol in list) { Games g = new Games(); g = gm.GetGame(ol.GameId); GameServer gs = new GameServer(); gs = sm.GetGameServer(ol.ServerId); if (gs != null) { LoginOnline += "<a href=\"/" + g.GameNo + "/LoginGame?S=" + gs.QuFu + "\" target=\"_blank\"><li><img src=\"" + gs.Img + "\"><br><span class=\"span_lanse\">" + g.Name + "</span> " + gs.Name + "</li></a>"; } } ViewData["LoginOnline"] = LoginOnline; return(View()); }
public void GetDataCount(HttpContext context, string Code) { string WhereStr = context.Request["WhereStr"]; int UserId = BBRequest.GetUserId(); GameUser gu = new GameUser(); switch (Code) { case "News": context.Response.Write(nm.GetNewsCount(WhereStr)); break; case "Game": context.Response.Write(gm.GetGamesCount(WhereStr)); break; case "Server": context.Response.Write(sm.GetServerCount(WhereStr)); break; case "Card": context.Response.Write(cm.GetCardCount(WhereStr)); break; case "Order": context.Response.Write(om.GetOrderCount(WhereStr)); break; case "SourceChange": context.Response.Write(scm.GetSourceChangeCount(WhereStr)); break; case "GameUser": context.Response.Write(gum.GetGameUserCount(WhereStr)); break; case "MasterLog": context.Response.Write(mm.GetMasterLogCount(WhereStr)); break; case "Links": context.Response.Write(lm.GetLinksCount(WhereStr)); break; case "CardLog": context.Response.Write(cm.GetCardLogCount(WhereStr)); break; case "Master": context.Response.Write(mm.GetMasterCount(WhereStr)); break; case "SysMsg": context.Response.Write(smm.GetSysMsgCount(BBRequest.GetUserId())); break; case "PayHistory1": gu = gum.GetGameUser(UserId); WhereStr = "where UserName='******'"; context.Response.Write(om.GetOrderCount(WhereStr)); break; case "PayHistory2": gu = gum.GetGameUser(UserId); WhereStr = "where UserName='******' and State=2"; context.Response.Write(om.GetOrderCount(WhereStr)); break; case "InitSpread": string[] re = WhereStr.Split('|'); string Coded = context.Request["Code"]; if (re.Length == 4) { context.Response.Write(om.GetSpreadCount(int.Parse(re[3]), false)); } else { if (Coded == "All") { context.Response.Write(om.GetSpreadCount(UserId, false)); } else { context.Response.Write(om.GetSpreadCount(UserId, true)); } } break; case "SpreadPay": context.Response.Write(om.GetSpreadPayCount(UserId, WhereStr)); break; case "SpreadGame": context.Response.Write(om.GetSpreadGameCount(UserId, WhereStr)); break; case "GetMasterRoleCount": context.Response.Write(mm.GetMasterRoleCount(WhereStr)); break; case "GetLockCount": context.Response.Write(Lkm.GetAllLockCount(WhereStr)); break; default: break; } }
public void MakeOrder(HttpContext context) { int Type = int.Parse(context.Request["Type"]); int GameId = int.Parse(context.Request["GameId"]); int ServerId = int.Parse(context.Request["ServerId"]); string SelMoney = context.Request["SelMoney"]; string TxtMoney = context.Request["TxtMoney"]; string UserName = context.Request["UserName"].Trim(); string Bank = context.Request["Bank"]; int PayType = int.Parse(context.Request["PayType"]); Orders order = new Orders(); OrderManager om = new OrderManager(); GameUserManager gum = new GameUserManager(); GamesManager gm = new GamesManager(); GameUser gu = new GameUser(); try { gu = gum.GetGameUser((int)context.Session[Keys.SESSION_USER]); } catch (Exception) { if (PayType == 7) { context.Response.Write("/Home/Login"); return; } } float PayMoney = 0; string OrderCode = Type == 1 ? "G" : "P"; try { if (!string.IsNullOrEmpty(TxtMoney)) { PayMoney = float.Parse(TxtMoney.Trim()); } else { PayMoney = float.Parse(SelMoney); } order = om.GetOrder(OrderCode, GameId.ToString(), ServerId, Type, PayType, UserName, PayMoney, gu.UserName); if (PayType == 7) { if (om.AddOrder(order)) { string Result = gm.PayManager(order.OrderNo); context.Response.Write("您的订单" + order.OrderNo + "已经处理。处理结果:" + Result + "|Error"); return; } else { context.Response.Write("添加订单失败!|Error"); return; } } else { if (om.AddOrder(order)) { context.Response.Write("/PayCenter/PayOrder?Order=" + DESEncrypt.encryptstring1(order.OrderNo) + "&Bank=" + Bank + "|Success"); } else { context.Response.Write("添加订单失败!|Error"); return; } } } catch (Exception e) { context.Response.Write(e.Message + "|Error"); return; } }
public ActionResult WdServers() { int UserId = BBRequest.GetUserId(); g = gm.GetGame("nslm"); if (UserId > 0) { GameUser gu = new GameUser(); gu = gum.GetGameUser(UserId); ViewData["UserName"] = gu.UserName; ViewData["TjqfHref"] = "#"; ViewData["TjqfName"] = "暂无推荐区服"; ViewData["LLHref"] = "#"; ViewData["LLName"] = "暂无记录"; OnlineLog ol = new OnlineLog(); ol = new OnlineLogManager().GetLastLogin(UserId, g.Id); if (ol != null) { GameServer Llqf = sm.GetGameServer(ol.ServerId); ViewData["LLHref"] = "/" + g.GameNo + "/LoginGame?S=" + Llqf.QuFu; ViewData["LLName"] = Llqf.Name; } if (g.tjqf > 0) { GameServer tjqf = sm.GetGameServer(g.tjqf); ViewData["TjqfHref"] = "/" + g.GameNo + "/LoginGame?S=" + tjqf.QuFu; ViewData["TjqfName"] = tjqf.Name; } List <GameServer> gsList = new List <GameServer>(); gsList = sm.GetServersByGame(g.Id); string ServerHtml = ""; foreach (GameServer gs in gsList) { switch (gs.State) { case 1: ServerHtml += "<li><a class=\"s2\"><span>" + gs.Name + "</span>即将开启</a></li>"; break; case 2: ServerHtml += "<li><a class=\"s1\"><span>" + gs.Name + "</span>停服维护</a></li>"; break; case 3: ServerHtml += "<li><a href=\"/" + g.GameNo + "/LoginGame?S=" + gs.QuFu + "\" target=\"_game\" class=\"s6\"><span>" + gs.Name + "</span>流畅</a></li>"; break; case 4: ServerHtml += "<li><a href=\"/" + g.GameNo + "/LoginGame?S=" + gs.QuFu + "\" target=\"_game\" class=\"s4\"><span>" + gs.Name + "</span>火爆</a></li>"; break; default: break; } } ViewData["gsHtml"] = ServerHtml; Utils.WriteCookie2("miniloader", "1", "5577yx.com"); return(View()); } else { return(RedirectToAction("Wd")); } }
public ActionResult LoginGame(string GameNo, int Qf) { g = gm.GetGame(GameNo); GameServer gs = new GameServer(); gs = sm.GetGameServer(g.Id, Qf); ViewData["Title"] = "5577yx-" + g.Name; ViewData["ServerName"] = g.Name + "-" + gs.Name; ViewData["GameNo"] = g.GameNo; ViewData["Qf"] = Qf; if (gs.State == 1 && gs.StartTime < DateTime.Now) { gs.State = 4; sm.UpdateServer(gs); } if (gs.State != 1 && gs.StartTime > DateTime.Now) { gs.State = 1; sm.UpdateServer(gs); } if (gs.State == 1 && gs.StartTime > DateTime.Now) { TimeSpan ts = gs.StartTime - DateTime.Now; ViewData["TimeSpan"] = ts.TotalMilliseconds; } if (gs.State == 1 || gs.State == 2) { ViewData["State"] = gs.State; return(View("~/Views/GameCenter/LoginGame.cshtml")); } int UserId = BBRequest.GetUserId(); if (UserId > 0) { ViewData["LoginUrl"] = gm.LoginUrl(g.Id, UserId, gs.Id, 0); gum.UpdateLastLogin(UserId); OnlineLog ol = new OnlineLog(0, UserId, g.Id, gs.Id, DateTime.Now, 0, 0); new OnlineLogManager().AddOnlineLog(ol); } else { if (Utils.GetCookie("6qmgamesame") != "") { string value = Utils.GetCookie("6qmgamesame"); string UserName = DESEncrypt.DesDecrypt(value.Split('|')[0]); string PWD = DESEncrypt.DesDecrypt(value.Split('|')[1]); GameUser gu = gum.GetGameUser(UserName, DESEncrypt.Md5(PWD, 32)); if (gu != null) { BBRequest.WriteUserId(gu.Id); gum.UpdateLastLogin(gu.Id); ViewData["LoginUrl"] = gm.LoginUrl(g.Id, gu.Id, gs.Id, 0); OnlineLog ol = new OnlineLog(0, gu.Id, g.Id, gs.Id, DateTime.Now, 0, 0); new OnlineLogManager().AddOnlineLog(ol); } else { return(RedirectToAction("Login", "Home")); } } else { return(RedirectToAction("Login", "Home")); } } return(View("~/Views/GameCenter/LoginGame.cshtml")); }
public ActionResult WdServers() { int UserId = BBRequest.GetUserId(); if (UserId > 0) { GameUser gu = new GameUser(); gu = gum.GetGameUser(UserId); ViewData["UserName"] = gu.UserName; ViewData["TjqfHref"] = "#"; ViewData["TjqfName"] = "暂无推荐区服"; ViewData["LLHref"] = "#"; ViewData["LLName"] = "暂无记录"; OnlineLog ol = new OnlineLog(); ol = new OnlineLogManager().GetLastLogin(UserId, g.Id); if (ol != null) { GameServer Llqf = sm.GetGameServer(ol.ServerId); if (Llqf.State == 1 || Llqf.State == 2) { ViewData["LLHref"] = "#"; } else { ViewData["LLHref"] = gm.LoginUrl(g.Id, UserId, Llqf.Id, 1); } ViewData["LLName"] = Llqf.Name; } if (g.tjqf > 0) { GameServer tjqf = sm.GetGameServer(g.tjqf); ViewData["TjqfHref"] = gm.LoginUrl(g.Id, UserId, tjqf.Id, 1); ViewData["TjqfName"] = tjqf.Name; } List <GameServer> gsList = new List <GameServer>(); gsList = sm.GetServersByGame(g.Id); string ServerHtml = ""; foreach (GameServer gs in gsList) { switch (gs.State) { case 1: ServerHtml += "<a><span class=\"yellow\"></span>" + gs.Name + "</a>"; break; case 2: ServerHtml += "<a><span class=\"gray\"></span>" + gs.Name + "</a>"; break; case 3: ServerHtml += "<a href=\"" + gm.LoginUrl(g.Id, UserId, gs.Id, 1) + "\"><span class=\"green\"></span>" + gs.Name + "</a>"; break; case 4: ServerHtml += "<a href=\"" + gm.LoginUrl(g.Id, UserId, gs.Id, 1) + "\"><span class=\"red\"></span>" + gs.Name + "</a>"; break; default: break; } } ViewData["gsHtml"] = ServerHtml; return(View()); } else { return(RedirectToAction("Wd")); } }