1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:47:27 +08:00

Merge pull request #11799 from frenzibyte/fix-tournament-user-population

Fix multiple issues with user population in tournament client
This commit is contained in:
Dan Balasescu 2021-02-19 10:06:30 +09:00 committed by GitHub
commit 19a2ef1148
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,7 +152,7 @@ namespace osu.Game.Tournament
{
if (string.IsNullOrEmpty(p.Username) || p.Statistics == null)
{
PopulateUser(p);
PopulateUser(p, immediate: true);
addedInfo = true;
}
}
@ -211,12 +211,14 @@ namespace osu.Game.Tournament
return addedInfo;
}
public void PopulateUser(User user, Action success = null, Action failure = null)
public void PopulateUser(User user, Action success = null, Action failure = null, bool immediate = false)
{
var req = new GetUserRequest(user.Id, Ruleset.Value);
req.Success += res =>
{
user.Id = res.Id;
user.Username = res.Username;
user.Statistics = res.Statistics;
user.Country = res.Country;
@ -231,7 +233,10 @@ namespace osu.Game.Tournament
failure?.Invoke();
};
API.Queue(req);
if (immediate)
API.Perform(req);
else
API.Queue(req);
}
protected override void LoadComplete()