mirror of
https://github.com/osukey/osukey.git
synced 2025-07-28 13:50:01 +09:00
Fix many unnecessary requests being fired
This commit is contained in:
@ -27,6 +27,8 @@ namespace osu.Game.Tournament.IPC
|
|||||||
|
|
||||||
public readonly Bindable<LegacyMods> Mods = new Bindable<LegacyMods>();
|
public readonly Bindable<LegacyMods> Mods = new Bindable<LegacyMods>();
|
||||||
|
|
||||||
|
private int lastBeatmapId;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
@ -45,8 +47,9 @@ namespace osu.Game.Tournament.IPC
|
|||||||
var beatmapId = int.Parse(sr.ReadLine());
|
var beatmapId = int.Parse(sr.ReadLine());
|
||||||
var mods = int.Parse(sr.ReadLine());
|
var mods = int.Parse(sr.ReadLine());
|
||||||
|
|
||||||
if (Beatmap.Value?.OnlineBeatmapID != beatmapId)
|
if (lastBeatmapId != beatmapId)
|
||||||
{
|
{
|
||||||
|
lastBeatmapId = beatmapId;
|
||||||
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId });
|
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = beatmapId });
|
||||||
req.Success += b => Beatmap.Value = b.ToBeatmap(Rulesets);
|
req.Success += b => Beatmap.Value = b.ToBeatmap(Rulesets);
|
||||||
API.Queue(req);
|
API.Queue(req);
|
||||||
|
Reference in New Issue
Block a user