Exemple #1
0
        public void GetServers(HttpContext context)
        {
            int GameId             = int.Parse(context.Request["GameId"]);
            List <GameServer> list = new List <GameServer>();

            list = sm.GetServersByGame(GameId);
            string JsonStr = Json.ListToJson(list);

            context.Response.Write(JsonStr);
        }
Exemple #2
0
        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());
        }
Exemple #3
0
        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"));
            }
        }
Exemple #4
0
        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"));
            }
        }
Exemple #5
0
        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());
        }
Exemple #6
0
        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\">&gt; 登录器地址 </a>";
            return(View("~/Views/GameCenter/GameServer.cshtml"));
        }
Exemple #7
0
        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"));
            }
        }