mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 13:33:03 +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:
commit
19a2ef1148
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user