Beispiel #1
0
 public ActionResult Left()
 {
     int UserId = BBRequest.GetUserId();
     if (UserId > 0)
     {
         GameUser gu = gum.GetGameUser(UserId);
         ViewData["UserNameed"] = gu.UserName;
         ViewData["Money"] = gu.Money;
         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 += " <span ><a href=\"/" + g.GameNo + "/LoginGame?S=" + gs.QuFu + "\" target=\"_blank\">" + gm.GetGame(ol.GameId).Name + "-" + sm.GetGameServer(ol.ServerId).Name + " </a></span><br/>";
         }
         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();
 }
Beispiel #2
0
        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");
            }
        }
Beispiel #3
0
 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);
 }