Merge branch 'master' into custom-ipc-location

This commit is contained in:
Bartłomiej Dach
2020-06-13 13:41:59 +02:00
135 changed files with 2600 additions and 582 deletions

View File

@ -36,6 +36,7 @@ namespace osu.Game.Tournament.IPC
private int lastBeatmapId;
private ScheduledDelegate scheduled;
private GetBeatmapRequest beatmapLookupRequest;
public StableInfo StableInfo { get; private set; }
@ -86,6 +87,8 @@ namespace osu.Game.Tournament.IPC
if (lastBeatmapId != beatmapId)
{
beatmapLookupRequest?.Cancel();
lastBeatmapId = beatmapId;
var existing = ladder.CurrentMatch.Value?.Round.Value?.Beatmaps.FirstOrDefault(b => b.ID == beatmapId && b.BeatmapInfo != null);
@ -94,9 +97,9 @@ namespace osu.Game.Tournament.IPC
Beatmap.Value = existing.BeatmapInfo;
else
{
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId });
req.Success += b => Beatmap.Value = b.ToBeatmap(Rulesets);
API.Queue(req);
beatmapLookupRequest = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId });
beatmapLookupRequest.Success += b => Beatmap.Value = b.ToBeatmap(Rulesets);
API.Queue(beatmapLookupRequest);
}
}