1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:47:24 +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) if (string.IsNullOrEmpty(p.Username) || p.Statistics == null)
{ {
PopulateUser(p); PopulateUser(p, immediate: true);
addedInfo = true; addedInfo = true;
} }
} }
@ -211,12 +211,14 @@ namespace osu.Game.Tournament
return addedInfo; 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); var req = new GetUserRequest(user.Id, Ruleset.Value);
req.Success += res => req.Success += res =>
{ {
user.Id = res.Id;
user.Username = res.Username; user.Username = res.Username;
user.Statistics = res.Statistics; user.Statistics = res.Statistics;
user.Country = res.Country; user.Country = res.Country;
@ -231,6 +233,9 @@ namespace osu.Game.Tournament
failure?.Invoke(); failure?.Invoke();
}; };
if (immediate)
API.Perform(req);
else
API.Queue(req); API.Queue(req);
} }