public void UpdatePlayer(MoveModel move) { var playerId = Context.User.Identity.GetUserId(); var game = _gameManager.GetGame(playerId); game.UpdatePlayer(playerId, move, this); }
public void GetGetOnlineLog(HttpContext context) { List <OnlineLog> list = new List <OnlineLog>(); list = new OnlineLogManager().GetOnlineLog(GetUser(context).Id, 2); string HtmlStr = ""; foreach (OnlineLog ol in list) { Games g = gm.GetGame(ol.GameId); GameServer gs = sm.GetGameServer(ol.ServerId); HtmlStr += " <span ><a href=\"/" + g.GameNo + "/LoginGame?S=" + gs.QuFu + "\" target=\"_blank\">" + gm.GetGame(ol.GameId).Name + "-" + sm.GetGameServer(ol.ServerId).Name + " </a></span><br/>"; } context.Response.Write(HtmlStr); }
public void GetAllGift(HttpContext context) { int PageSize = int.Parse(context.Request["PageSize"]); int PageNum = int.Parse(context.Request["PageNum"]); string WhereStr = context.Request["WhereStr"].Replace("where", ""); DataTable dt = new DataTable(); dt = cm.GetCards(PageSize, PageNum, WhereStr, ""); string HtmlStr = ""; foreach (DataRow row in dt.Rows) { HtmlStr += "<div id=\"picl\"><ul><li><a href=\"/" + gm.GetGame((int)row["GameId"]).GameNo + "/Gift?G=" + row["Id"] + "\"><img src=\"" + row["Img"] + "\" width=\"190\" height=\"105\" title=\"" + row["CardName"] + "\"></a> <a class=\"orange_link\"href=\"/" + gm.GetGame((int)row["GameId"]).GameNo + "/Gift?G=" + row["Id"] + "\">领取</a> </li> </ul> </div>"; } context.Response.Write(HtmlStr); }
public ActionResult Index() { g = gm.GetGame("nslm"); List <GameServer> gsList = new List <GameServer>(); gsList = sm.GetServersByGame(g.Id); ViewData["ServersHtml"] = hh.ServersHtml(gsList); ViewData["GameNo"] = g.GameNo; ViewData["TjqfHref"] = "#"; ViewData["TjqfName"] = "暂无推荐区服"; ViewData["GameDes"] = g.GameDesc; if (g.tjqf > 0) { GameServer tjqf = sm.GetGameServer(g.tjqf); ViewData["TjqfHref"] = "/" + g.GameNo + "/LoginGame?S=" + tjqf.QuFu; ViewData["TjqfName"] = tjqf.Name; } ViewData["YqLink"] = hh.YqLinkHtml("20"); List <News> Newlist = new List <News>(); Newlist = nm.GetNews(7, 2, g.Id); string NewsHtml = ""; foreach (News n in Newlist) { NewsHtml += "<p><span class=\"date\">" + n.ReleaseTime + "</span><span class=\"leis\"><a href=\"#\">热点</a></span><a href=\"/NewsCenter/News?N=" + n.Id + "\" title=\"" + n.Title + "\" class=\"zw\">" + (n.Title.Length < 15 ? n.Title : n.Title.Substring(0, 15)) + "</a></p>"; } ViewData["News"] = NewsHtml; List <News> GGNewlist = new List <News>(); GGNewlist = nm.GetNews(7, 4, g.Id); string GGNewsHtml = ""; foreach (News n in GGNewlist) { GGNewsHtml += "<li><span class=\"date fr\">" + n.ReleaseTime + "</span>[公告]<a href=\"/NewsCenter/News?N=" + n.Id + "\" target=\"_self\"title=\"" + n.Title + "\">" + (n.Title.Length < 15 ? n.Title : n.Title.Substring(0, 15)) + "</strong></a></li>"; } ViewData["GGNews"] = GGNewsHtml; return(View()); }
public ActionResult News(int N) { News news = new News(); news = nm.GetNews(N); ViewData["NewsTitle"] = news.Title; ViewData["Game"] = gm.GetGame(news.GameId).Name; ViewData["Time"] = news.ReleaseTime; ViewData["NewsContent"] = news.NewsContent; return(View()); }
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 string GetNewServerHtml(List <GameServer> NewServerList) { string HtmlStr = ""; string Style = "style=\"background-color: #FFF4E1\""; foreach (GameServer gs in NewServerList) { Games g = new Games(); g = gm.GetGame(gs.GameId); HtmlStr += "<tr><td " + Style + "> </td><td " + Style + ">" + gs.StartTime.ToString("MM-dd") + "</td><td " + Style + ">" + gs.StartTime.ToString("HH:mm") + "</td><td class=\"name\" " + Style + "><a href=\"/" + g.GameNo + "/\" class=\"a2\" target=\"_blank\" title=\"" + gs.Name + "\">" + g.Name + "</a></td><td class=\"qu\" " + Style + "><span style=\"width: 50px; display: block; float: right; text-align: center; line-height: 15px; font-size: 12px\"><a href=\"/" + g.GameNo + "/LoginGame?S=" + gs.QuFu + "\" class=\"a1\"target=\"_blank\">" + gs.QuFu + "区</a></span></td></tr>"; } return(HtmlStr); }
private void GetNewGame() { if (_games.GameCount(GameLevel) > 0) // Are there games available? { _model = new GameModel(_games.GetGame(GameLevel)); // Yes, load a game in the model class StartButtonState = StartButtonStateEnum.Start; // Set the start button state to Start StatusMessage = "New game loaded. Click 'Start Game' button to begin."; } else // No games available, tell user. { StatusMessage = "No games available for the selected level. Please select another level."; } }
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() { g = gm.GetGame("xxas"); List <GameServer> gsList = new List <GameServer>(); gsList = sm.GetServersByGame(g.Id, 5); string ServerHtml = ""; foreach (GameServer gs in gsList) { ServerHtml += "<li><a href=\"/" + g.GameNo + "/LoginGame?S=" + gs.QuFu + "\"><span>" + gs.Name + "</span><span class=\"status\">火爆</span></a></li>"; } ViewData["ServersHtml"] = ServerHtml; ViewData["GameNo"] = g.GameNo; ViewData["TjqfHref"] = "#"; ViewData["TjqfName"] = "暂无推荐区服"; ViewData["GameDes"] = g.GameDesc; if (g.tjqf > 0) { GameServer tjqf = sm.GetGameServer(g.tjqf); ViewData["TjqfHref"] = "/" + g.GameNo + "/LoginGame?S=" + tjqf.QuFu; ViewData["TjqfName"] = tjqf.Name; } List <News> Newlist = new List <News>(); Newlist = nm.GetNews(5, 4, g.Id); string NewsHtml = ""; foreach (News n in Newlist) { NewsHtml += "<li><span class=\"date\">" + n.ReleaseTime.ToString("yyyy-MM-dd") + "</span><a href=\"/NewsCenter/News?N=" + n.Id + "\">[新闻]" + (n.Title.Length < 25 ? n.Title : n.Title.Substring(0, 25)) + "</a></li>"; } ViewData["News"] = NewsHtml; List <News> GGNewlist = new List <News>(); GGNewlist = nm.GetNews(5, 2, g.Id); string GGNewsHtml = ""; foreach (News n in GGNewlist) { GGNewsHtml += "<li><span class=\"date\">" + n.ReleaseTime.ToString("yyyy-MM-dd") + "</span><a href=\"/NewsCenter/News?N=" + n.Id + "\">[公告]" + (n.Title.Length < 25 ? n.Title : n.Title.Substring(0, 25)) + "</a></li>"; } ViewData["GGNews"] = GGNewsHtml; return(View()); }
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 Boolean AddLock() { if (Session[Keys.SESSION_ADMIN_INFO] == null) { return(false); } else { Master master = Session[Keys.SESSION_ADMIN_INFO] as Master; if (rcm.GetRoleCompetence(master.RoleId, 1341)) { string Lock = Request["LockInfo"]; string LockInfo = "Ip锁定"; try { int s = 0; string[] a = DESEncrypt.Decrypt(Lock).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])); Games g = gm.GetGame(int.Parse(a[1])); if (gu != null) { if (gu.IsSpreader > 0) { LockInfo = gu.UserName + "的" + g.Name + "链接"; } } } } catch (Exception) { } if (!string.IsNullOrEmpty(Lock) && !alm.IsLock(Lock)) { return(alm.AddLock(Lock, master.UserName, LockInfo)); } } } return(false); }
public ActionResult Left() { int UserId = BBRequest.GetUserId(); if (UserId > 0) { GameUser gu = gum.GetGameUser(UserId); ViewData["UserNameed"] = gu.UserName; ViewData["Money"] = gu.Money; ViewData["Photo"] = gu.Photo + ".jpg"; List <OnlineLog> Ollist = new List <OnlineLog>(); Ollist = new OnlineLogManager().GetOnlineLog(gu.Id, 2); string HtmlStr = ""; foreach (OnlineLog ol in Ollist) { Games g = gm.GetGame(ol.GameId); GameServer gs = sm.GetGameServer(ol.ServerId); HtmlStr += " <li ><a href=\"/" + g.GameNo + "/LoginGame?S=" + gs.QuFu + "\" target=\"_blank\" class=\"dub\"><span>" + sm.GetGameServer(ol.ServerId).Name + "</span><span class=\"g\">go</span></a>" + "<a class=\"n\" href=\"#\" target=\"_blank\">" + gm.GetGame(ol.GameId).Name + "</a></li>"; } ViewData["OnlineLogHtml"] = HtmlStr; ViewData["LoginStyle"] = "style=\"display: none;\""; } else { if (Utils.GetCookie("6qmgamesame") != "") { string value = Utils.GetCookie("6qmgamesame"); string UserName = DESEncrypt.DesDecrypt(value.Split('|')[0]); string PWD = DESEncrypt.DesDecrypt(value.Split('|')[1]); ViewData["UserName"] = UserName; ViewData["PWD"] = PWD; } ViewData["LoginedStyle"] = "style=\"display: none;\""; } List <GameServer> list = new List <GameServer>(); list = sm.GetNewsServer(6); ViewData["NewServerHtml"] = hh.GetNewServerHtml(list); return(PartialView()); }
public void CheckMoney(HttpContext context) { int GameId = int.Parse(context.Request["GameId"]); int Type = int.Parse(context.Request["Type"]); string SelMoney = context.Request["SelMoney"]; string TxtMoney = context.Request["TxTMoney"]; int PayType = int.Parse(context.Request["PayType"]); Games game = new Games(); GamesManager gm = new GamesManager(); game = gm.GetGame(GameId); float Money = string.IsNullOrEmpty(TxtMoney) ? float.Parse(SelMoney.Trim()) : float.Parse(TxtMoney.Trim()); float PayMoney = 0; switch (PayType) { case 7: PayMoney = Money / 10; break; case 5: case 9: PayMoney = Money * 0.8F; break; case 2: case 3: case 4: PayMoney = Money * 0.9F; break; default: PayMoney = Money; break; } string GameMoney = Type == 1 ? PayMoney * game.GameMoneyScale + "游戏币" : PayMoney * 10 + "平台币"; context.Response.Write(Money + "|" + GameMoney); }
public string GetNewServerHtml(List <GameServer> NewServerList) { //string Style = "style=\"background-color: #FFF4E1\""; //foreach (GameServer gs in NewServerList) //{ // Games g = new Games(); // g = gm.GetGame(gs.GameId); // HtmlStr += "<tr><td " + Style + "> </td><td " + Style + ">" + gs.StartTime.ToString("MM-dd") + "</td><td " + Style + ">" + gs.StartTime.ToString("HH:mm") + "</td><td class=\"name\" " + Style + "><a href=\"/" + g.GameNo + "/\" class=\"a2\" target=\"_blank\" title=\"" + gs.Name + "\">" + g.Name + "</a></td><td class=\"qu\" " + Style + "><span style=\"width: 50px; display: block; float: right; text-align: center; line-height: 15px; font-size: 12px\"><a href=\"/" + g.GameNo + "/LoginGame?S=" + gs.QuFu + "\" class=\"a1\"target=\"_blank\">" + gs.QuFu + "区</a></span></td></tr>"; //} string HtmlStr = ""; int i = 1; string c = ""; foreach (GameServer gs in NewServerList) { if (i == 1) { c = "class=\"num1\""; } else if (i == 2) { c = "class=\"num2\""; } else if (i == 3) { c = "class=\"num3\""; } else { c = ""; } Games g = new Games(); g = gm.GetGame(gs.GameId); HtmlStr += "<li><i " + c + ">" + i++ + "</i><span class=\"cl1\">" + gs.StartTime.ToString("MM-dd") + " " + gs.StartTime.ToString("HH") + "时</span><a href=\"/" + g.GameNo + "/LoginGame?S=" + gs.QuFu + "\" target=\"_blank\"><span>" + gs.Name + "</span>" + g.Name + "</a></li>"; } return(HtmlStr); }
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 ActionResult InitServers(string GameNo) { ViewData["GameCenterOn"] = "current "; g = gm.GetGame(GameNo); ViewData["Title"] = g.Name + "服务器列表"; ViewData["IndexHbImg"] = g.IndexHbImg; string NewsGG = ""; List <News> GGlist = new List <News>(); GGlist = nm.GetNews(5, 2, g.Id); foreach (News n in GGlist) { NewsGG += "<li><span style=\"margin: 20px;\"><a href=\"/NewsCenter/News?N=" + n.Id + "\" style=\"text-decoration: none;\">" + n.Title + "</a></span></li>"; } ViewData["NewsGG"] = NewsGG; string[] Str = g.GameProperty.Split('|'); ViewData["GameLx"] = Str[0]; ViewData["GameTz"] = Str[1]; ViewData["GameCzlx"] = Str[2]; ViewData["GameHm"] = Str[3]; ViewData["GameSfms"] = Str[4]; string ServerHtml = ""; string SelHtml = ""; gsList = sm.GetServersByGame(g.Id); for (int i = 0; i < Math.Ceiling(gsList.Count / 20f); i++) { SelHtml += " <a>" + (i * 20 + 1) + "-" + ((i + 1) * 20) + "</a>"; ServerHtml += "<div style=\"display: none\">"; for (int j = (i * 20); j <= ((20 * i + 19) >= gsList.Count ? gsList.Count - 1 : (20 * i + 19)); j++) { if (gsList[j].StartTime < DateTime.Now && gsList[j].State == 1) { gsList[j].State = 4; sm.UpdateServer(gsList[j]); } else if (gsList[j].StartTime > DateTime.Now && gsList[j].State != 1) { gsList[j].State = 1; sm.UpdateServer(gsList[j]); } switch (gsList[j].State) { case 1: ServerHtml += "<a class=\"li_jikai\">" + gsList[j].Name + "</a>"; break; case 2: ServerHtml += "<a class=\"li_weihu\">" + gsList[j].Name + "</a>"; break; case 3: ServerHtml += "<a class=\"li_liuchang\" href=\"/" + g.GameNo + "/LoginGame?S=" + gsList[j].QuFu + "\" target=\"_blank\">" + gsList[j].Name + "</a>"; break; case 4: ServerHtml += "<a class=\"li_hot\" href=\"/" + g.GameNo + "/LoginGame?S=" + gsList[j].QuFu + "\" target=\"_blank\">" + gsList[j].Name + "</a>"; break; default: break; } } ServerHtml += "</div>"; } ViewData["SelHtml"] = SelHtml; ViewData["ServerHtml"] = ServerHtml; string ZlHtml = ""; List <News> zlList = new List <News>(); zlList = nm.GetNews(200, 5, g.Id); foreach (News zl in zlList) { ZlHtml += "<li><a href=\"/NewsCenter/News?N=" + zl.Id + "\" target=\"_blank\">" + zl.Title + "</a></li>"; } ViewData["ZlHtml"] = ZlHtml; ViewData["Pic1"] = g.Pic1; ViewData["Pic2"] = g.Pic2; ViewData["Pic3"] = g.Pic3; ViewData["Pic4"] = g.Pic4; ViewData["GameCom"] = g.GameCom; ViewData["BBS"] = g.GameBBS; ViewData["game_url_hd"] = g.game_url_hd; ViewData["Dlq"] = string.IsNullOrEmpty(g.game_url_xzq) ? "" : "<a href=\"" + g.game_url_xzq + "\" class=\"dlq\" target=\"_blank\">> 登录器地址 </a>"; return(View("~/Views/GameCenter/GameServer.cshtml")); }
public ActionResult EditGame(int GameId) { 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, 11231)) { Games g = new Games(); g = gm.GetGame(GameId); ViewData["GameId"] = GameId; ViewData["GameNo"] = g.GameNo; ViewData["GameName"] = g.Name; ViewData["tjqf"] = g.tjqf; string[] Str = g.GameProperty.Split('|'); ViewData["GameLx"] = Str[0]; ViewData["GameTz"] = Str[1]; ViewData["GameCzlx"] = Str[2]; ViewData["GameHm"] = Str[3]; ViewData["GameSfms"] = Str[4]; ViewData["IsRed"] = g.Is_Red == 1 ? true : false; ViewData["IsHot"] = g.Is_Hot == 1 ? true : false; ViewData["IsLock"] = g.Is_Lock == 1 ? true : false; ViewData["SortId"] = g.Sort_Id; ViewData["GameMoneyScale"] = g.GameMoneyScale; ViewData["GameMoneyName"] = g.GameMoneyName; ViewData["GameCom"] = g.GameCom; ViewData["GameBBS"] = g.GameBBS; ViewData["NewHand"] = g.NewHand; ViewData["Pic1"] = g.Pic1; ViewData["Pic2"] = g.Pic2; ViewData["Pic3"] = g.Pic3; ViewData["Pic4"] = g.Pic4; ViewData["GameListImg"] = g.GameListImg; ViewData["IndexTjImg"] = g.IndexTjImg; ViewData["IndexHbImg"] = g.IndexHbImg; ViewData["IndexHdImg"] = g.IndexHdImg; ViewData["game_url_hd"] = g.game_url_hd; ViewData["NewHand"] = g.NewHand; ViewData["game_url_xzq"] = g.game_url_xzq; ViewData["GameDesc"] = g.GameDesc; GameConfig gc = new GameConfig(); gc = gcm.GetGameConfig(GameId); if (gc != null) { ViewData["AgentId"] = gc.AgentId; ViewData["LoginCom"] = gc.LoginCom; ViewData["PayCom"] = gc.PayCom; ViewData["ExistCom"] = gc.ExistCom; ViewData["LoginTicket"] = gc.LoginTicket; ViewData["PayTicket"] = gc.PayTicket; ViewData["SelectTicket"] = gc.SelectTicket; ViewData["FcmTicket"] = gc.FcmTicket; } ViewData["Function"] = "UpdateData('/Game/UpdateGame')"; return(View("Game")); } else { return(RedirectToAction("Login", "Admin")); } } }