1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 16:52:55 +08:00

Add compatibility with old server build

This commit is contained in:
smoogipoo 2021-02-19 13:57:04 +09:00
parent 183a481a34
commit c0e0bd4f42

View File

@ -94,6 +94,10 @@ namespace osu.Game.Online.Multiplayer
[Resolved] [Resolved]
private RulesetStore rulesets { get; set; } = null!; private RulesetStore rulesets { get; set; } = null!;
// Only exists for compatibility with old osu-server-spectator build.
// Todo: Can be removed on 2021/02/26.
private long defaultPlaylistItemId;
private Room? apiRoom; private Room? apiRoom;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
@ -141,6 +145,7 @@ namespace osu.Game.Online.Multiplayer
{ {
Room = joinedRoom; Room = joinedRoom;
apiRoom = room; apiRoom = room;
defaultPlaylistItemId = apiRoom.Playlist.FirstOrDefault()?.ID ?? 0;
}, cancellationSource.Token); }, cancellationSource.Token);
// Update room settings. // Update room settings.
@ -553,7 +558,7 @@ namespace osu.Game.Online.Multiplayer
void updateItem(PlaylistItem item) void updateItem(PlaylistItem item)
{ {
item.ID = settings.PlaylistItemId; item.ID = settings.PlaylistItemId == 0 ? defaultPlaylistItemId : settings.PlaylistItemId;
item.Beatmap.Value = beatmap; item.Beatmap.Value = beatmap;
item.Ruleset.Value = ruleset.RulesetInfo; item.Ruleset.Value = ruleset.RulesetInfo;
item.RequiredMods.Clear(); item.RequiredMods.Clear();