예제 #1
0
        public GameUserInfo GetGameUserInfo()
        {
            GamesManager gm       = new GamesManager();
            int          GameId   = Convert.ToInt32(Request["GameId"]);
            int          UserId   = Convert.ToInt32(Request["UserId"]);
            int          ServerId = Convert.ToInt32(Request["ServerId"]);

            GameUserInfo gui = gm.GetGameUserInfo(GameId, UserId, ServerId);

            return(gui);
        }
예제 #2
0
        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("验证失败!");
            }
        }
예제 #3
0
        /// <summary>
        /// 获取用户角色等级信息
        /// </summary>
        /// <returns></returns>
        public ActionResult PromoUserInfo()
        {
            int                 GameId       = int.Parse(Request ["GameId"]);
            int                 ServerId     = int.Parse(Request["ServerId"]);
            List <int>          ListUser     = gum.GetSpreadUserByBengBeng(GameId, "BengBeng");
            List <GameUserInfo> ListUserInfo = new List <GameUserInfo>();

            foreach (int user in ListUser.Take(15))
            {
                GameUserInfo gui = new GameUserInfo();
                gui = gm.GetGameUserInfo(GameId, user, ServerId);
                if (gui.Message == "Success")
                {
                    ListUserInfo.Add(gui);
                }
            }
            ViewData["listUser"] = ListUserInfo;
            ViewData["GameId"]   = GameId;
            ViewData["ServerId"] = ServerId;
            return(View());
        }
예제 #4
0
        public string PayMoneyOrderHtml(DataTable dt, int gameId, int serverId)
        {
            string htmlStr = "";
            int    i       = 1;

            try
            {
                foreach (DataRow row in dt.Rows)
                {
                    string       source   = row["sourcename"].ToString() == "" ? "用户注册" : row["sourcename"].ToString();
                    GameUserInfo gui      = gm.GetGameUserInfo(gameId, int.Parse(row["userid"].ToString()), serverId);
                    string       userInfo = Utils.ConvertUnicodeStringToChinese(gui.UserName) + "[" + gui.Level + "级]";
                    //string userInfo = gui.UserName + "[" + gui.Level + "级]";
                    //htmlStr += "<tr><td>" + i++ + "</td><td>" + row["username"] + "</td><td>" + row["sumMoney"] + "</td><td>" + source + "</td></tr>";
                    htmlStr += "<tr><td>" + i++ + "</td><td>" + row["username"] + "</td><td>" + userInfo + "</td><td>" + row["sumMoney"] + "</td><td>" + source + "</td></tr>";
                }
            }
            catch (Exception)
            {
                htmlStr = "查询角色失败;";
            }
            return(htmlStr);
        }
예제 #5
0
        public void GetAllSpreadPay(HttpContext context)
        {
            int           PageSize = int.Parse(context.Request["PageSize"]);
            int           PageNum  = int.Parse(context.Request["PageNum"]);
            int           UserId   = UserId = BBRequest.GetUserId();
            string        WhereStr = context.Request["WhereStr"];
            List <Orders> list     = new List <Orders>();

            list = om.GetAllSpreadPay(PageSize, PageNum, UserId, WhereStr);
            string HtmlStr = "";

            foreach (Orders o in list)
            {
                HtmlStr += "<tr><td>" + o.UserName + "</td><td>" + o.PayTime + "</td><td>" + o.GameName + "-" + o.ServerName + "</td><td>" + gm.GetGameUserInfo(o.GameId, gum.GetGameUser(o.UserName).Id, o.ServerId).UserName + "</td><td>" + o.PayMoney + "</td></tr>";
            }
            context.Response.Write(HtmlStr);
        }