Merge branch 'master' into remove-countries-json

This commit is contained in:
Dean Herbert
2022-07-18 16:38:53 +09:00
46 changed files with 187 additions and 139 deletions

View File

@ -23,7 +23,7 @@ namespace osu.Game.Tournament.Models
/// The player's country.
/// </summary>
[JsonProperty("country_code")]
public Country Country { get; set; }
public CountryCode CountryCode { get; set; }
/// <summary>
/// The player's global rank, or null if not available.
@ -41,7 +41,7 @@ namespace osu.Game.Tournament.Models
{
Id = OnlineID,
Username = Username,
Country = Country,
CountryCode = CountryCode,
CoverUrl = CoverUrl,
};

View File

@ -21,6 +21,7 @@ using osu.Game.Online.API.Requests.Responses;
using osu.Game.Tournament.IO;
using osu.Game.Tournament.IPC;
using osu.Game.Tournament.Models;
using osu.Game.Users;
using osuTK.Input;
namespace osu.Game.Tournament
@ -187,7 +188,7 @@ namespace osu.Game.Tournament
var playersRequiringPopulation = ladder.Teams
.SelectMany(t => t.Players)
.Where(p => string.IsNullOrEmpty(p.Username)
|| p.Country == default
|| p.CountryCode == CountryCode.Unknown
|| p.Rank == null).ToList();
if (playersRequiringPopulation.Count == 0)
@ -290,7 +291,7 @@ namespace osu.Game.Tournament
user.Username = res.Username;
user.CoverUrl = res.CoverUrl;
user.Country = res.Country;
user.CountryCode = res.CountryCode;
user.Rank = res.Statistics?.GlobalRank;
success?.Invoke();