mirror of
https://github.com/ppy/osu.git
synced 2026-05-22 10:30:00 +08:00
Fix playlist leaderboard provider potentially inserting local user in wrong order
Due to `Perform` being used from a BDL method in conjunction with `Success` (which is scheduled to the *update* thread), there was a chance that the order of execution would be not quite as intended. To rectify, let's not use `Success` and just continue with synchronous flow.
This commit is contained in:
@@ -37,7 +37,11 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
var scoresToShow = new List<GameplayLeaderboardScore>();
|
||||
|
||||
var scoresRequest = new IndexPlaylistScoresRequest(room.RoomID!.Value, playlistItem.ID);
|
||||
scoresRequest.Success += response =>
|
||||
api.Perform(scoresRequest);
|
||||
|
||||
var response = scoresRequest.Response;
|
||||
|
||||
if (response != null)
|
||||
{
|
||||
isPartial = response.Scores.Count < response.TotalScores;
|
||||
|
||||
@@ -50,8 +54,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
|
||||
if (response.UserScore != null && response.Scores.All(s => s.ID != response.UserScore.ID))
|
||||
scoresToShow.Add(new GameplayLeaderboardScore(response.UserScore, tracked: false, GameplayLeaderboardScore.ComboDisplayMode.Highest));
|
||||
};
|
||||
api.Perform(scoresRequest);
|
||||
}
|
||||
|
||||
if (gameplayState != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user