diff --git a/osu.Game/Online/API/Requests/GetScoresRequest.cs b/osu.Game/Online/API/Requests/GetScoresRequest.cs index 3685d0b9e3..5e6bf1ea9f 100644 --- a/osu.Game/Online/API/Requests/GetScoresRequest.cs +++ b/osu.Game/Online/API/Requests/GetScoresRequest.cs @@ -21,19 +21,16 @@ namespace osu.Game.Online.API.Requests protected override WebRequest CreateWebRequest() { var req = base.CreateWebRequest(); - req.AddParameter(@"c", beatmap.Hash); - req.AddParameter(@"f", beatmap.Path); + //req.AddParameter(@"c", beatmap.Hash); + //req.AddParameter(@"f", beatmap.Path); return req; } - protected override string Target => @"beatmaps/scores"; + protected override string Target => $@"beatmaps/{beatmap.OnlineBeatmapID}/scores"; } public class GetScoresResponse { - [JsonProperty(@"beatmap")] - public BeatmapInfo Beatmap; - [JsonProperty(@"scores")] public IEnumerable Scores; } diff --git a/osu.Game/Rulesets/Scoring/Score.cs b/osu.Game/Rulesets/Scoring/Score.cs index cb7831b04a..a1ff983628 100644 --- a/osu.Game/Rulesets/Scoring/Score.cs +++ b/osu.Game/Rulesets/Scoring/Score.cs @@ -19,32 +19,24 @@ namespace osu.Game.Rulesets.Scoring [JsonProperty(@"score")] public double TotalScore { get; set; } - public double Accuracy { get; set; } - public double Health { get; set; } - [JsonProperty(@"maxcombo")] + [JsonProperty(@"accuracy")] + public double Accuracy { get; set; } + + public double Health { get; set; } = 1; + + [JsonProperty(@"combo")] public int MaxCombo { get; set; } + public int Combo { get; set; } + + [JsonProperty(@"mods")] + protected string[] ModStrings { get; set; } //todo: parse to Mod objects + public Mod[] Mods { get; set; } - private User user; - - public User User - { - get - { - return user ?? new User - { - Username = LegacyUsername, - Id = LegacyUserID - }; - } - - set - { - user = value; - } - } + [JsonProperty(@"user")] + public User User; [JsonProperty(@"replay_data")] public Replay Replay; @@ -54,13 +46,7 @@ namespace osu.Game.Rulesets.Scoring [JsonProperty(@"score_id")] public long OnlineScoreID; - [JsonProperty(@"username")] - public string LegacyUsername; - - [JsonProperty(@"user_id")] - public long LegacyUserID; - - [JsonProperty(@"date")] + [JsonProperty(@"created_at")] public DateTime Date; /// diff --git a/osu.Game/Screens/Play/SongProgressGraph.cs b/osu.Game/Screens/Play/SongProgressGraph.cs index 97f25e0a95..20548970e5 100644 --- a/osu.Game/Screens/Play/SongProgressGraph.cs +++ b/osu.Game/Screens/Play/SongProgressGraph.cs @@ -20,9 +20,12 @@ namespace osu.Game.Screens.Play const int granularity = 200; - var lastHit = ((objects.Last() as IHasEndTime)?.EndTime ?? objects.Last().StartTime) + 1; + var lastHit = (objects.Last() as IHasEndTime)?.EndTime ?? 0; - var interval = lastHit / granularity; + if (lastHit == 0) + lastHit = objects.Last().StartTime; + + var interval = (lastHit + 1) / granularity; var values = new int[granularity]; @@ -31,7 +34,7 @@ namespace osu.Game.Screens.Play IHasEndTime end = h as IHasEndTime; int startRange = (int)(h.StartTime / interval); - int endRange = (int)((end?.EndTime ?? h.StartTime) / interval); + int endRange = (int)((end?.EndTime > 0 ? end.EndTime : h.StartTime) / interval); for (int i = startRange; i <= endRange; i++) values[i]++; } diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 321067d18e..b211b781ae 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -204,7 +204,7 @@ namespace osu.Game.Screens.Select.Leaderboards Children = new Drawable[] { maxCombo = new ScoreComponentLabel(FontAwesome.fa_link, Score.MaxCombo.ToString()), - accuracy = new ScoreComponentLabel(FontAwesome.fa_crosshairs, string.Format(Score.Accuracy % 1 == 0 ? @"{0:0}" : @"{0:0.00}", Score.Accuracy)), + accuracy = new ScoreComponentLabel(FontAwesome.fa_crosshairs, string.Format(Score.Accuracy % 1 == 0 ? @"{0:P0}" : @"{0:P2}", Score.Accuracy)), }, }, }, diff --git a/osu.Game/Users/Country.cs b/osu.Game/Users/Country.cs index 960b452682..729629bdb8 100644 --- a/osu.Game/Users/Country.cs +++ b/osu.Game/Users/Country.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using Newtonsoft.Json; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -14,6 +15,7 @@ namespace osu.Game.Users /// /// The name of this country. /// + [JsonProperty(@"name")] public string FullName; /// @@ -24,6 +26,7 @@ namespace osu.Game.Users /// /// Two-letter flag acronym (ISO 3166 standard) /// + [JsonProperty(@"code")] public string FlagName; } diff --git a/osu.Game/Users/User.cs b/osu.Game/Users/User.cs index 6e1de7e3ac..35d791ef51 100644 --- a/osu.Game/Users/User.cs +++ b/osu.Game/Users/User.cs @@ -13,11 +13,33 @@ namespace osu.Game.Users [JsonProperty(@"username")] public string Username; + //[JsonProperty(@"country")] + [JsonIgnore] public Country Country; - public Team Team; + //public Team Team; [JsonProperty(@"colour")] public string Colour; + + [JsonProperty(@"avatarUrl")] + public string AvatarUrl; + + [JsonProperty(@"cover")] + public UserCover Cover; + + public class UserCover + { + [JsonProperty(@"customUrl")] + public string CustomUrl; + + [JsonProperty(@"url")] + public string Url; + + [JsonProperty(@"id")] + public int? Id; + } } + + }