From 2f703090ef1996c34eb4db392a894f015cdb0130 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Fri, 1 Nov 2019 21:49:50 +0300 Subject: [PATCH] Update API with latest web changes --- .../Visual/Online/TestSceneRankingsTables.cs | 6 +++--- .../Online/API/Requests/GetCountriesResponse.cs | 15 +++++++++++++++ .../API/Requests/GetCountryRankingsRequest.cs | 3 +-- .../Online/API/Requests/GetRankingsRequest.cs | 3 +-- .../Online/API/Requests/GetUserRankingsRequest.cs | 3 +-- osu.Game/Online/API/Requests/GetUsersResponse.cs | 2 +- 6 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 osu.Game/Online/API/Requests/GetCountriesResponse.cs diff --git a/osu.Game.Tests/Visual/Online/TestSceneRankingsTables.cs b/osu.Game.Tests/Visual/Online/TestSceneRankingsTables.cs index 08a6da734f..49656900cc 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneRankingsTables.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneRankingsTables.cs @@ -77,7 +77,7 @@ namespace osu.Game.Tests.Visual.Online { var table = new CountriesTable(page) { - Rankings = rankings, + Rankings = rankings.Countries, }; LoadComponentAsync(table, t => @@ -104,7 +104,7 @@ namespace osu.Game.Tests.Visual.Online { var table = new PerformanceTable(page) { - Rankings = rankings, + Rankings = rankings.Users, }; LoadComponentAsync(table, t => @@ -131,7 +131,7 @@ namespace osu.Game.Tests.Visual.Online { var table = new ScoresTable(page) { - Rankings = rankings, + Rankings = rankings.Users, }; LoadComponentAsync(table, t => diff --git a/osu.Game/Online/API/Requests/GetCountriesResponse.cs b/osu.Game/Online/API/Requests/GetCountriesResponse.cs new file mode 100644 index 0000000000..7b65c6fadd --- /dev/null +++ b/osu.Game/Online/API/Requests/GetCountriesResponse.cs @@ -0,0 +1,15 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Collections.Generic; +using Newtonsoft.Json; +using osu.Game.Online.API.Requests.Responses; + +namespace osu.Game.Online.API.Requests +{ + public class GetCountriesResponse : ResponseWithCursor + { + [JsonProperty("ranking")] + public List Countries; + } +} diff --git a/osu.Game/Online/API/Requests/GetCountryRankingsRequest.cs b/osu.Game/Online/API/Requests/GetCountryRankingsRequest.cs index 3bd772732f..d8a1198627 100644 --- a/osu.Game/Online/API/Requests/GetCountryRankingsRequest.cs +++ b/osu.Game/Online/API/Requests/GetCountryRankingsRequest.cs @@ -1,12 +1,11 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osu.Game.Online.API.Requests.Responses; using osu.Game.Rulesets; namespace osu.Game.Online.API.Requests { - public class GetCountryRankingsRequest : GetRankingsRequest + public class GetCountryRankingsRequest : GetRankingsRequest { public GetCountryRankingsRequest(RulesetInfo ruleset, int page = 1) : base(ruleset, page) diff --git a/osu.Game/Online/API/Requests/GetRankingsRequest.cs b/osu.Game/Online/API/Requests/GetRankingsRequest.cs index efaaa2cb40..941691c4c1 100644 --- a/osu.Game/Online/API/Requests/GetRankingsRequest.cs +++ b/osu.Game/Online/API/Requests/GetRankingsRequest.cs @@ -3,11 +3,10 @@ using osu.Framework.IO.Network; using osu.Game.Rulesets; -using System.Collections.Generic; namespace osu.Game.Online.API.Requests { - public abstract class GetRankingsRequest : APIRequest> + public abstract class GetRankingsRequest : APIRequest { private readonly RulesetInfo ruleset; private readonly int page; diff --git a/osu.Game/Online/API/Requests/GetUserRankingsRequest.cs b/osu.Game/Online/API/Requests/GetUserRankingsRequest.cs index bbba6a210d..9c3eba9fdc 100644 --- a/osu.Game/Online/API/Requests/GetUserRankingsRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserRankingsRequest.cs @@ -2,12 +2,11 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.IO.Network; -using osu.Game.Online.API.Requests.Responses; using osu.Game.Rulesets; namespace osu.Game.Online.API.Requests { - public class GetUserRankingsRequest : GetRankingsRequest + public class GetUserRankingsRequest : GetRankingsRequest { private readonly string country; private readonly UserRankingsType type; diff --git a/osu.Game/Online/API/Requests/GetUsersResponse.cs b/osu.Game/Online/API/Requests/GetUsersResponse.cs index 860785875a..c60bc71096 100644 --- a/osu.Game/Online/API/Requests/GetUsersResponse.cs +++ b/osu.Game/Online/API/Requests/GetUsersResponse.cs @@ -10,6 +10,6 @@ namespace osu.Game.Online.API.Requests public class GetUsersResponse : ResponseWithCursor { [JsonProperty("ranking")] - public List Users; + public List Users; } }