Example #1
0
        public static async Task <List <UserRecent.UserRecent> > GetUserRecentByUseridAsync(ulong userid, GameMode gameMode = GameMode.Standard, int limit = 10)
        {
            string mode    = UserMode.ToString(gameMode);
            string request = await GetAsync($"{GET_USER_RECENT_URL}{API_KEY_PARAMETER}{ApiKey}{USER_PARAMETER}{userid}{mode}{LIMIT_PARAMETER}{limit}");

            return(JsonConvert.DeserializeObject <List <UserRecent.UserRecent> >(request));
        }
Example #2
0
        public static async Task <List <Scores> > GetScoresAsync(ulong beatmapid, GameMode gameMode = GameMode.Standard, int limit = 50)
        {
            string mode    = UserMode.ToString(gameMode);
            string request = await GetAsync($"{GET_SCORES_URL}{API_KEY_PARAMETER}{ApiKey}{mode}{LIMIT_PARAMETER}{limit}{BEATMAP_PARAMETER}{beatmapid}");

            return(JsonConvert.DeserializeObject <List <Scores> >(request));
        }
Example #3
0
        public static async Task <List <Beatmaps> > GetBeatmapsAsync(ulong id, BeatmapType bmType = BeatmapType.ByBeatmap, GameMode gameMode = GameMode.Standard, int limit = 500)
        {
            string mode    = UserMode.ToString(gameMode);
            string type    = Beatmap.ToString(bmType);
            string request = await GetAsync($"{GET_BEATMAPS_URL}{API_KEY_PARAMETER}{ApiKey}{type}{id}{LIMIT_PARAMETER}{limit}{mode}");

            return(JsonConvert.DeserializeObject <List <Beatmaps> >(request));
        }
Example #4
0
        public static async Task <Users> GetUserByIdAsync(ulong userid, GameMode gameMode = GameMode.Standard)
        {
            string mode    = UserMode.ToString(gameMode);
            string request = await GetAsync($"{GET_USER_URL}{API_KEY_PARAMETER}{ApiKey}{USER_PARAMETER}{userid}{mode}");

            List <Users> r = JsonConvert.DeserializeObject <List <Users> >(request);

            return(r.Count > 0 ? r[0] : null);
        }
Example #5
0
        public static async Task <Replay> GetReplayByUseridAsync(ulong beatmapid, ulong userid, GameMode gameMode = GameMode.Standard)
        {
            string mode    = UserMode.ToString(gameMode);
            string request = await GetAsync($"{GET_REPLAY_URL}{API_KEY_PARAMETER}{ApiKey}{mode}{BEATMAP_PARAMETER}{beatmapid}{USER_PARAMETER}{userid}");

            List <Replay> r = JsonConvert.DeserializeObject <List <Replay> >(request);

            return(r.Count > 0 ? r[0] : null);
        }
Example #6
0
        public static async Task <Scores> GetScoreByUsernameAsync(ulong beatmapid, string username, GameMode gameMode = GameMode.Standard)
        {
            string mode    = UserMode.ToString(gameMode);
            string request = await GetAsync($"{GET_SCORES_URL}{API_KEY_PARAMETER}{ApiKey}{mode}{USER_PARAMETER}{username}{BEATMAP_PARAMETER}{beatmapid}");

            List <Scores> r = JsonConvert.DeserializeObject <List <Scores> >(request);

            return(r.Count > 0 ? r[0] : null);
        }
Example #7
0
        public static async Task <Beatmaps> GetBeatmapAsync(ulong beatmapId, BeatmapType bmType = BeatmapType.ByDifficulty, GameMode gameMode = GameMode.Standard)
        {
            string mode    = UserMode.ToString(gameMode);
            string type    = Beatmap.ToString(bmType);
            string request = await GetAsync($"{GET_BEATMAPS_URL}{API_KEY_PARAMETER}{ApiKey}{type}{beatmapId}{mode}");

            List <Beatmaps> r = JsonConvert.DeserializeObject <List <Beatmaps> >(request);

            return(r.Count > 0 ? r[0] : null);
        }
Example #8
0
 protected string GetModeForAttribute()
 {
     return(UserMode.ToString().ToUpperInvariant());
 }
Example #9
0
 public void Mode(UserMode usermode, string nick, bool isAdd)
 {
     if(isAdd)
         Send("MODE " + nick + "+" + usermode.ToString());
     else
         Send("MODE " + nick + "-" + usermode.ToString());
 }
Example #10
0
 public void SetUserMode(HttpResponseBase response, UserMode userMode)
 {
     HttpCookie modeCookie = new HttpCookie("CurrentMode", userMode.ToString());
     response.SetCookie(modeCookie);
 }