mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Initial implementation of MultiplayerPlaylist
This commit is contained in:
@ -33,11 +33,13 @@ namespace osu.Game.Online.Multiplayer
|
||||
public event Action? RoomUpdated;
|
||||
|
||||
public event Action<MultiplayerRoomUser>? UserJoined;
|
||||
|
||||
public event Action<MultiplayerRoomUser>? UserLeft;
|
||||
|
||||
public event Action<MultiplayerRoomUser>? UserKicked;
|
||||
|
||||
public event Action<MultiplayerPlaylistItem>? ItemAdded;
|
||||
public event Action<long>? ItemRemoved;
|
||||
public event Action<MultiplayerPlaylistItem>? ItemChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when the multiplayer server requests the current beatmap to be loaded into play.
|
||||
/// </summary>
|
||||
@ -619,6 +621,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
Room.Playlist.Add(item);
|
||||
APIRoom.Playlist.Add(playlistItem);
|
||||
|
||||
ItemAdded?.Invoke(item);
|
||||
RoomUpdated?.Invoke();
|
||||
});
|
||||
}
|
||||
@ -638,6 +641,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
Room.Playlist.Remove(Room.Playlist.Single(existing => existing.ID == playlistItemId));
|
||||
APIRoom.Playlist.RemoveAll(existing => existing.ID == playlistItemId);
|
||||
|
||||
ItemRemoved?.Invoke(playlistItemId);
|
||||
RoomUpdated?.Invoke();
|
||||
});
|
||||
|
||||
@ -668,6 +672,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
if (CurrentMatchPlayingItem.Value?.ID == playlistItem.ID)
|
||||
CurrentMatchPlayingItem.Value = playlistItem;
|
||||
|
||||
ItemChanged?.Invoke(item);
|
||||
RoomUpdated?.Invoke();
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user