diff --git a/osu.Game/Online/API/Requests/GetUserRequest.cs b/osu.Game/Online/API/Requests/GetUserRequest.cs index 2fd1ee5efc..2e3e7b01c8 100644 --- a/osu.Game/Online/API/Requests/GetUserRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserRequest.cs @@ -7,9 +7,9 @@ namespace osu.Game.Online.API.Requests { public class GetUserRequest : APIRequest { - private int? userId; + private long? userId; - public GetUserRequest(int? userId = null) + public GetUserRequest(long? userId = null) { this.userId = userId; } diff --git a/osu.Game/Users/User.cs b/osu.Game/Users/User.cs index 93933c8fe9..ffe18dcfdb 100644 --- a/osu.Game/Users/User.cs +++ b/osu.Game/Users/User.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 System; using Newtonsoft.Json; using osu.Framework.Configuration; @@ -11,17 +12,20 @@ namespace osu.Game.Users [JsonProperty(@"id")] public long Id = 1; + [JsonProperty(@"joinDate")] + public string JoinDate; + [JsonProperty(@"username")] public string Username; - [JsonProperty(@"country_code")] - public string CountryCode; - [JsonProperty(@"country")] public Country Country; public Bindable Status = new Bindable(); + [JsonProperty(@"age")] + public int Age; + //public Team Team; [JsonProperty(@"profile_colour")] @@ -47,5 +51,74 @@ namespace osu.Game.Users [JsonProperty(@"id")] public int? Id; } + + [JsonProperty(@"isAdmin")] + public bool IsAdmin; + + [JsonProperty(@"isSupporter")] + public bool IsSupporter; + + [JsonProperty(@"isGMT")] + public bool IsGMT; + + [JsonProperty(@"isQAT")] + public bool IsQAT; + + [JsonProperty(@"isBNG")] + public bool IsBNG; + + [JsonProperty(@"is_active")] + public bool Active; + + [JsonProperty(@"interests")] + public string Intrerests; + + [JsonProperty(@"occupation")] + public string Occupation; + + [JsonProperty(@"title")] + public string Title; + + [JsonProperty(@"location")] + public string Location; + + [JsonProperty(@"lastvisit")] + public DateTimeOffset LastVisit; + + [JsonProperty(@"twitter")] + public string Twitter; + + [JsonProperty(@"lastfm")] + public string Lastfm; + + [JsonProperty(@"skype")] + public string Skype; + + [JsonProperty(@"website")] + public string Website; + + [JsonProperty(@"playstyle")] + public string[] PlayStyle; + + [JsonProperty(@"playmode")] + public string PlayMode; + + [JsonProperty(@"profileOrder")] + public string[] ProfileOrder; + + [JsonProperty(@"kudosu")] + public KudosuCount Kudosu; + + public class KudosuCount + { + [JsonProperty(@"total")] + public int Total; + + [JsonProperty(@"available")] + public int Available; + } + + [JsonProperty(@"defaultStatistics")] + public UserStatistics Statistics; } } diff --git a/osu.Game/Users/UserStatistics.cs b/osu.Game/Users/UserStatistics.cs new file mode 100644 index 0000000000..22c5c5cbcc --- /dev/null +++ b/osu.Game/Users/UserStatistics.cs @@ -0,0 +1,64 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using Newtonsoft.Json; + +namespace osu.Game.Users +{ + public class UserStatistics + { + [JsonProperty(@"level")] + public LevelInfo Level; + + public class LevelInfo + { + [JsonProperty(@"current")] + public int Current; + + [JsonProperty(@"progress")] + public int Progress; + } + + [JsonProperty(@"pp")] + public decimal PP; + + [JsonProperty(@"pp_rank")] + public int Rank; + + [JsonProperty(@"ranked_score")] + public long RankedScore; + + [JsonProperty(@"hit_accuracy")] + public decimal Accuracy; + + [JsonProperty(@"play_count")] + public int PlayCount; + + [JsonProperty(@"total_score")] + public long TotalScore; + + [JsonProperty(@"total_hits")] + public int TotalHits; + + [JsonProperty(@"maximum_combo")] + public int MaxCombo; + + [JsonProperty(@"replays_watched_by_others")] + public int ReplayWatched; + + [JsonProperty(@"grade_counts")] + public Grades GradesCount; + + public class Grades + { + [JsonProperty(@"ss")] + public int SS; + + [JsonProperty(@"s")] + public int S; + + [JsonProperty(@"a")] + public int A; + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index c554ee751b..79d066461b 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -471,6 +471,7 @@ +