From 85037dfb700518a67a6236cc3ddf9d6a1df11f75 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Nov 2021 04:32:21 +0900 Subject: [PATCH] Fix multiplayer potentially getting incorrect beatmap availability state after changing beatmaps --- .../Online/Rooms/OnlinePlayBeatmapAvailabilityTracker.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game/Online/Rooms/OnlinePlayBeatmapAvailabilityTracker.cs b/osu.Game/Online/Rooms/OnlinePlayBeatmapAvailabilityTracker.cs index 6cd735af23..a642e283f9 100644 --- a/osu.Game/Online/Rooms/OnlinePlayBeatmapAvailabilityTracker.cs +++ b/osu.Game/Online/Rooms/OnlinePlayBeatmapAvailabilityTracker.cs @@ -53,7 +53,10 @@ namespace osu.Game.Online.Rooms downloadTracker?.RemoveAndDisposeImmediately(); downloadTracker = new BeatmapDownloadTracker(item.NewValue.Beatmap.Value.BeatmapSet); - downloadTracker.State.BindValueChanged(_ => updateAvailability()); + + AddInternal(downloadTracker); + + downloadTracker.State.BindValueChanged(_ => updateAvailability(), true); downloadTracker.Progress.BindValueChanged(_ => { if (downloadTracker.State.Value != DownloadState.Downloading) @@ -63,9 +66,7 @@ namespace osu.Game.Online.Rooms // we don't want to flood the network with this, so rate limit how often we send progress updates. if (progressUpdate?.Completed != false) progressUpdate = Scheduler.AddDelayed(updateAvailability, progressUpdate == null ? 0 : 500); - }); - - AddInternal(downloadTracker); + }, true); }, true); }