Merge branch 'master' into i-ruleset-store

This commit is contained in:
Bartłomiej Dach
2021-12-04 15:05:39 +01:00
78 changed files with 1033 additions and 284 deletions

View File

@ -32,12 +32,36 @@ namespace osu.Game.Online.Multiplayer
/// </summary>
public event Action? RoomUpdated;
/// <summary>
/// Invoked when a new user joins the room.
/// </summary>
public event Action<MultiplayerRoomUser>? UserJoined;
/// <summary>
/// Invoked when a user leaves the room of their own accord.
/// </summary>
public event Action<MultiplayerRoomUser>? UserLeft;
/// <summary>
/// Invoked when a user was kicked from the room forcefully.
/// </summary>
public event Action<MultiplayerRoomUser>? UserKicked;
/// <summary>
/// Invoked when a new item is added to the playlist.
/// </summary>
public event Action<MultiplayerPlaylistItem>? ItemAdded;
/// <summary>
/// Invoked when a playlist item is removed from the playlist. The provided <c>long</c> is the playlist's item ID.
/// </summary>
public event Action<long>? ItemRemoved;
/// <summary>
/// Invoked when a playlist item's details change.
/// </summary>
public event Action<MultiplayerPlaylistItem>? ItemChanged;
/// <summary>
/// Invoked when the multiplayer server requests the current beatmap to be loaded into play.
/// </summary>
@ -617,6 +641,7 @@ namespace osu.Game.Online.Multiplayer
Room.Playlist.Add(item);
APIRoom.Playlist.Add(playlistItem);
ItemAdded?.Invoke(item);
RoomUpdated?.Invoke();
});
}
@ -636,6 +661,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();
});
@ -666,6 +692,7 @@ namespace osu.Game.Online.Multiplayer
if (CurrentMatchPlayingItem.Value?.ID == playlistItem.ID)
CurrentMatchPlayingItem.Value = playlistItem;
ItemChanged?.Invoke(item);
RoomUpdated?.Invoke();
});
}
@ -717,7 +744,9 @@ namespace osu.Game.Online.Multiplayer
OwnerID = item.OwnerID,
Beatmap = { Value = apiBeatmap },
Ruleset = { Value = ruleset },
Expired = item.Expired
Expired = item.Expired,
PlaylistOrder = item.PlaylistOrder,
PlayedAt = item.PlayedAt
};
playlistItem.RequiredMods.AddRange(item.RequiredMods.Select(m => m.ToMod(rulesetInstance)));