コード例 #1
0
        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>&nbsp;" + gs.Name + "</li></a>";
                }
            }
            ViewData["LoginOnline"] = LoginOnline;
            return(View());
        }
コード例 #2
0
ファイル: Function.ashx.cs プロジェクト: Zane0816/5577yx
        public void GetNewsServer(HttpContext context)
        {
            List <GameServer> list = new List <GameServer>();

            list = sm.GetNewsServer(6);
            string HtmlStr = "";
            string Style   = "style=\"background-color: #FFF4E1\"";

            foreach (GameServer gs in list)
            {
                Games g = new Games();
                g        = gm.GetGame(gs.GameId);
                HtmlStr += "<tr><td " + Style + ">&nbsp;</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>";
            }
            context.Response.Write(HtmlStr);
        }
コード例 #3
0
        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());
        }