コード例 #1
0
ファイル: Account.aspx.cs プロジェクト: itai192/Taki-Online
 protected void FriendValidator_ServerValidate(object source, ServerValidateEventArgs args)
 {
     if (!BLL_Helper.UserExists(args.Value))
     {
         args.IsValid = false;
     }
 }
コード例 #2
0
ファイル: Summery.aspx.cs プロジェクト: itai192/Taki-Online
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["User"] == null)
            {
                Response.Redirect("~/Home.aspx");
            }
            User user = (User)Session["User"];

            try
            {
                if (!user.IsUserInGame(int.Parse(Request.QueryString["GameID"])))
                {
                    Response.Redirect("~/Home.aspx");
                }
            }
            catch
            {
                Response.Redirect("~/Home.aspx");
            }
            int             gameID = int.Parse(Request.QueryString["GameID"]);
            UserStatsInGame stats  = user.statsInGame(gameID);

            XpChangeLbl.Text      = AddPlusIfPositive(stats.xpChanged);
            EloChangeLbl.Text     = AddPlusIfPositive(stats.eloChanged);
            SummeryTbl.DataSource = BLL_Helper.FindUserStatsInGame(gameID);
            SummeryTbl.DataBind();
        }
コード例 #3
0
ファイル: Manager.aspx.cs プロジェクト: itai192/Taki-Online
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["User"] == null)
            {
                Response.Redirect("~/Home.aspx");
            }
            User user = (User)Session["User"];

            if (user.type != UserType.Manager)
            {
                Response.Redirect("~/Home.aspx");
            }
            OnilneLbl.Text        = Application["Users Online"].ToString();
            VisitorsTodayLbl.Text = Application["Visitors Today"].ToString();
            UserAmount.Text       = BLL_Helper.GetUserAmount().ToString();
            List <int> games = BLL_Helper.GamesPlayedInMonth();

            for (int i = 0; i < games.Count; i++)
            {
                GamesInDates.Series[0].Points.AddXY(DateTime.Today.AddDays(-i), games[i]);
            }
            List <Rank> ranks = BLL_Helper.GetAllRanks();

            foreach (Rank rank in ranks)
            {
                int amount = BLL_Helper.GetAllUsersInRankThisSeason(rank.ID).Count;
                LeagueDistrobution.Series[0].Points.AddXY(rank.name, amount);
            }
        }
コード例 #4
0
ファイル: Account.aspx.cs プロジェクト: itai192/Taki-Online
        protected void UserSearchBind()
        {
            List <User> results = BLL_Helper.SearchUser(ViewState["SearchTerm"].ToString());

            results.Remove(user);
            UserSearch.DataSource = results;
            UserSearch.DataBind();
        }
コード例 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         RanksDropDown.DataSource = BLL_Helper.GetAllRanks();
         RanksDropDown.DataBind();
     }
     Leaderboard.DataSource = BLL_Helper.GetAllPlayersInRankThisSeasonDataTable(int.Parse(RanksDropDown.SelectedValue));
     Leaderboard.DataBind();
 }
コード例 #6
0
        public List <WSUser> GetFriends()
        {
            if (Session["User"] == null)
            {
                return(null);
            }
            User user = (User)Session["User"];

            return(UserListToWSUserList(BLL_Helper.UserListFromUsernameList(user.AcceptedFriends)));
        }
コード例 #7
0
ファイル: Account.aspx.cs プロジェクト: itai192/Taki-Online
 protected void Page_LoadComplete(object sender, EventArgs e)
 {
     UsernameLbl.Text           = user.username;
     ProfilePicture.pictureName = user.picture;
     FriendRequests.DataSource  = BLL_Helper.UserListFromUsernameList(user.UnopenedFriendRequests);
     FriendRequests.DataBind();
     Friends.DataSource = BLL_Helper.UserListFromUsernameList(user.AcceptedFriends);
     Friends.DataBind();
     GameInvites.DataSource = user.activeGameInvites;
     GameInvites.DataBind();
 }
コード例 #8
0
        public void StartNewSeason(object sender, ElapsedEventArgs e)
        {
            Season      s     = new Season(DateTime.Now, DateTime.Now.AddDays(60));
            List <User> users = BLL_Helper.GetAllUsers();

            foreach (User u in users)
            {
                u.SeasonStartRank(s.SeasonID, currentSeason.SeasonID);
            }
            currentSeason = s;
        }
コード例 #9
0
        public List <WSRank> GetAllRanks()
        {
            List <WSRank> ret   = new List <WSRank>();
            List <Rank>   ranks = BLL_Helper.GetAllRanks();

            foreach (Rank rank in ranks)
            {
                ret.Add(new WSRank(rank));
            }
            return(RankListToWSRankList(BLL_Helper.GetAllRanks()));
        }
コード例 #10
0
 protected void Update()
 {
     room.UpdateRoom();
     GameNameLbl.Text = room.gameName;
     if (room.status == GameStatus.AlreadyStarted)
     {
         Response.Redirect("~/Game.aspx");
     }
     Players.DataSource = BLL_Helper.UserListFromUsernameList(room.users);
     Players.DataBind();
     FriendsToInvite.DataSource = BLL_Helper.UserListFromUsernameList(user.AcceptedFriends);
     FriendsToInvite.DataBind();
 }
コード例 #11
0
        public void SetSeasonTimer()
        {
            if (SeasonTimer != null)
            {
                SeasonTimer.Dispose();
                SeasonTimer = null;
            }
            currentSeason = BLL_Helper.GetCurrentSeason();
            TimeSpan timeToWait = currentSeason.EndDate - DateTime.Now;

            if (timeToWait.TotalMilliseconds > int.MaxValue)
            {
                SeasonTimer           = new Timer(int.MaxValue);
                SeasonTimer.AutoReset = false;
                SeasonTimer.Elapsed  += ResetTimer;
            }
            else
            {
                SeasonTimer           = new Timer(timeToWait.TotalMilliseconds);
                SeasonTimer.AutoReset = false;
                SeasonTimer.Elapsed  += StartNewSeason;
            }
        }
コード例 #12
0
 public List <WSUser> GetAllUsersInRank(WSRank rank)
 {
     return(UserListToWSUserList(BLL_Helper.GetAllUsersInRankThisSeason(rank.ID)));;
 }
コード例 #13
0
 protected void Page_LoadComplete()
 {
     Games.DataSource = BLL_Helper.SearchStartingGameRoom(searchTerm);
     Games.DataBind();
 }