mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 06:03:08 +08:00
Merge pull request #15432 from peppy/fix-beatmap-availability-potentially-wrong
Fix multiplayer potentially getting incorrect beatmap availability state after changing beatmaps
This commit is contained in:
commit
fe9b8f3274
@ -53,7 +53,10 @@ namespace osu.Game.Online.Rooms
|
|||||||
downloadTracker?.RemoveAndDisposeImmediately();
|
downloadTracker?.RemoveAndDisposeImmediately();
|
||||||
|
|
||||||
downloadTracker = new BeatmapDownloadTracker(item.NewValue.Beatmap.Value.BeatmapSet);
|
downloadTracker = new BeatmapDownloadTracker(item.NewValue.Beatmap.Value.BeatmapSet);
|
||||||
downloadTracker.State.BindValueChanged(_ => updateAvailability());
|
|
||||||
|
AddInternal(downloadTracker);
|
||||||
|
|
||||||
|
downloadTracker.State.BindValueChanged(_ => updateAvailability(), true);
|
||||||
downloadTracker.Progress.BindValueChanged(_ =>
|
downloadTracker.Progress.BindValueChanged(_ =>
|
||||||
{
|
{
|
||||||
if (downloadTracker.State.Value != DownloadState.Downloading)
|
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.
|
// we don't want to flood the network with this, so rate limit how often we send progress updates.
|
||||||
if (progressUpdate?.Completed != false)
|
if (progressUpdate?.Completed != false)
|
||||||
progressUpdate = Scheduler.AddDelayed(updateAvailability, progressUpdate == null ? 0 : 500);
|
progressUpdate = Scheduler.AddDelayed(updateAvailability, progressUpdate == null ? 0 : 500);
|
||||||
});
|
}, true);
|
||||||
|
|
||||||
AddInternal(downloadTracker);
|
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user