1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 11:02:54 +08:00

Rename APIPlaylistItem -> MultiplayerPlaylistItem

This commit is contained in:
Dan Balasescu 2021-11-15 23:14:27 +09:00
parent 5a1036a96a
commit f743a3647f
7 changed files with 21 additions and 21 deletions

View File

@ -111,7 +111,7 @@ namespace osu.Game.Online.Multiplayer
/// Signals that an item has been added to the playlist. /// Signals that an item has been added to the playlist.
/// </summary> /// </summary>
/// <param name="item">The added item.</param> /// <param name="item">The added item.</param>
Task PlaylistItemAdded(APIPlaylistItem item); Task PlaylistItemAdded(MultiplayerPlaylistItem item);
/// <summary> /// <summary>
/// Signals that an item has been removed from the playlist. /// Signals that an item has been removed from the playlist.
@ -123,6 +123,6 @@ namespace osu.Game.Online.Multiplayer
/// Signals that an item has been changed in the playlist. /// Signals that an item has been changed in the playlist.
/// </summary> /// </summary>
/// <param name="item">The changed item.</param> /// <param name="item">The changed item.</param>
Task PlaylistItemChanged(APIPlaylistItem item); Task PlaylistItemChanged(MultiplayerPlaylistItem item);
} }
} }

View File

@ -86,7 +86,7 @@ namespace osu.Game.Online.Multiplayer
/// Adds an item to the playlist. /// Adds an item to the playlist.
/// </summary> /// </summary>
/// <param name="item">The item to add.</param> /// <param name="item">The item to add.</param>
Task AddPlaylistItem(APIPlaylistItem item); Task AddPlaylistItem(MultiplayerPlaylistItem item);
/// <summary> /// <summary>
/// Removes an item from the playlist. /// Removes an item from the playlist.

View File

@ -309,7 +309,7 @@ namespace osu.Game.Online.Multiplayer
public abstract Task RequestAllPlaylistItems(); public abstract Task RequestAllPlaylistItems();
public abstract Task AddPlaylistItem(APIPlaylistItem item); public abstract Task AddPlaylistItem(MultiplayerPlaylistItem item);
public abstract Task RemovePlaylistItem(long playlistItemId); public abstract Task RemovePlaylistItem(long playlistItemId);
@ -603,7 +603,7 @@ namespace osu.Game.Online.Multiplayer
return Task.CompletedTask; return Task.CompletedTask;
} }
public async Task PlaylistItemAdded(APIPlaylistItem item) public async Task PlaylistItemAdded(MultiplayerPlaylistItem item)
{ {
if (Room == null) if (Room == null)
return; return;
@ -642,7 +642,7 @@ namespace osu.Game.Online.Multiplayer
return Task.CompletedTask; return Task.CompletedTask;
} }
public async Task PlaylistItemChanged(APIPlaylistItem item) public async Task PlaylistItemChanged(MultiplayerPlaylistItem item)
{ {
if (Room == null) if (Room == null)
return; return;
@ -703,7 +703,7 @@ namespace osu.Game.Online.Multiplayer
CurrentMatchPlayingItem.Value = APIRoom.Playlist.SingleOrDefault(p => p.ID == settings.PlaylistItemId); CurrentMatchPlayingItem.Value = APIRoom.Playlist.SingleOrDefault(p => p.ID == settings.PlaylistItemId);
}, cancellationToken); }, cancellationToken);
private async Task<PlaylistItem> createPlaylistItem(APIPlaylistItem item) private async Task<PlaylistItem> createPlaylistItem(MultiplayerPlaylistItem item)
{ {
var set = await GetOnlineBeatmapSet(item.BeatmapID).ConfigureAwait(false); var set = await GetOnlineBeatmapSet(item.BeatmapID).ConfigureAwait(false);

View File

@ -63,9 +63,9 @@ namespace osu.Game.Online.Multiplayer
connection.On<MatchRoomState>(nameof(IMultiplayerClient.MatchRoomStateChanged), ((IMultiplayerClient)this).MatchRoomStateChanged); connection.On<MatchRoomState>(nameof(IMultiplayerClient.MatchRoomStateChanged), ((IMultiplayerClient)this).MatchRoomStateChanged);
connection.On<int, MatchUserState>(nameof(IMultiplayerClient.MatchUserStateChanged), ((IMultiplayerClient)this).MatchUserStateChanged); connection.On<int, MatchUserState>(nameof(IMultiplayerClient.MatchUserStateChanged), ((IMultiplayerClient)this).MatchUserStateChanged);
connection.On<MatchServerEvent>(nameof(IMultiplayerClient.MatchEvent), ((IMultiplayerClient)this).MatchEvent); connection.On<MatchServerEvent>(nameof(IMultiplayerClient.MatchEvent), ((IMultiplayerClient)this).MatchEvent);
connection.On<APIPlaylistItem>(nameof(IMultiplayerClient.PlaylistItemAdded), ((IMultiplayerClient)this).PlaylistItemAdded); connection.On<MultiplayerPlaylistItem>(nameof(IMultiplayerClient.PlaylistItemAdded), ((IMultiplayerClient)this).PlaylistItemAdded);
connection.On<long>(nameof(IMultiplayerClient.PlaylistItemRemoved), ((IMultiplayerClient)this).PlaylistItemRemoved); connection.On<long>(nameof(IMultiplayerClient.PlaylistItemRemoved), ((IMultiplayerClient)this).PlaylistItemRemoved);
connection.On<APIPlaylistItem>(nameof(IMultiplayerClient.PlaylistItemChanged), ((IMultiplayerClient)this).PlaylistItemChanged); connection.On<MultiplayerPlaylistItem>(nameof(IMultiplayerClient.PlaylistItemChanged), ((IMultiplayerClient)this).PlaylistItemChanged);
}; };
IsConnected.BindTo(connector.IsConnected); IsConnected.BindTo(connector.IsConnected);
@ -155,12 +155,12 @@ namespace osu.Game.Online.Multiplayer
public override Task RequestAllPlaylistItems() public override Task RequestAllPlaylistItems()
{ {
if (!IsConnected.Value) if (!IsConnected.Value)
return Task.FromResult(Array.Empty<APIPlaylistItem>()); return Task.FromResult(Array.Empty<MultiplayerPlaylistItem>());
return connection.InvokeAsync<APIPlaylistItem[]>(nameof(IMultiplayerServer.RequestAllPlaylistItems)); return connection.InvokeAsync<MultiplayerPlaylistItem[]>(nameof(IMultiplayerServer.RequestAllPlaylistItems));
} }
public override Task AddPlaylistItem(APIPlaylistItem item) public override Task AddPlaylistItem(MultiplayerPlaylistItem item)
{ {
if (!IsConnected.Value) if (!IsConnected.Value)
return Task.CompletedTask; return Task.CompletedTask;

View File

@ -13,7 +13,7 @@ namespace osu.Game.Online.Rooms
{ {
[Serializable] [Serializable]
[MessagePackObject] [MessagePackObject]
public class APIPlaylistItem public class MultiplayerPlaylistItem
{ {
[Key(0)] [Key(0)]
public long ID { get; set; } public long ID { get; set; }
@ -39,11 +39,11 @@ namespace osu.Game.Online.Rooms
[Key(7)] [Key(7)]
public bool Expired { get; set; } public bool Expired { get; set; }
public APIPlaylistItem() public MultiplayerPlaylistItem()
{ {
} }
public APIPlaylistItem(PlaylistItem item) public MultiplayerPlaylistItem(PlaylistItem item)
{ {
ID = item.ID; ID = item.ID;
BeatmapID = item.BeatmapID; BeatmapID = item.BeatmapID;

View File

@ -56,7 +56,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
{ {
loadingLayer.Show(); loadingLayer.Show();
client.AddPlaylistItem(new APIPlaylistItem client.AddPlaylistItem(new MultiplayerPlaylistItem
{ {
BeatmapID = item.BeatmapID, BeatmapID = item.BeatmapID,
BeatmapChecksum = item.Beatmap.Value.MD5Hash, BeatmapChecksum = item.Beatmap.Value.MD5Hash,

View File

@ -41,9 +41,9 @@ namespace osu.Game.Tests.Visual.Multiplayer
[Resolved] [Resolved]
private BeatmapManager beatmaps { get; set; } = null!; private BeatmapManager beatmaps { get; set; } = null!;
private readonly List<APIPlaylistItem> playlistItems = new List<APIPlaylistItem>(); private readonly List<MultiplayerPlaylistItem> playlistItems = new List<MultiplayerPlaylistItem>();
private readonly TestMultiplayerRoomManager roomManager; private readonly TestMultiplayerRoomManager roomManager;
private APIPlaylistItem? currentItem; private MultiplayerPlaylistItem? currentItem;
public TestMultiplayerClient(TestMultiplayerRoomManager roomManager) public TestMultiplayerClient(TestMultiplayerRoomManager roomManager)
{ {
@ -162,7 +162,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
if (password != apiRoom.Password.Value) if (password != apiRoom.Password.Value)
throw new InvalidOperationException("Invalid password."); throw new InvalidOperationException("Invalid password.");
playlistItems.AddRange(apiRoom.Playlist.Select(i => new APIPlaylistItem(i))); playlistItems.AddRange(apiRoom.Playlist.Select(i => new MultiplayerPlaylistItem(i)));
var localUser = new MultiplayerRoomUser(api.LocalUser.Value.Id) var localUser = new MultiplayerRoomUser(api.LocalUser.Value.Id)
{ {
@ -300,7 +300,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
await ((IMultiplayerClient)this).PlaylistItemAdded(item).ConfigureAwait(false); await ((IMultiplayerClient)this).PlaylistItemAdded(item).ConfigureAwait(false);
} }
public override async Task AddPlaylistItem(APIPlaylistItem item) public override async Task AddPlaylistItem(MultiplayerPlaylistItem item)
{ {
Debug.Assert(Room != null); Debug.Assert(Room != null);
Debug.Assert(APIRoom != null); Debug.Assert(APIRoom != null);
@ -425,7 +425,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
Debug.Assert(APIRoom != null); Debug.Assert(APIRoom != null);
Debug.Assert(currentItem != null); Debug.Assert(currentItem != null);
var newItem = new APIPlaylistItem var newItem = new MultiplayerPlaylistItem
{ {
ID = playlistItems.Last().ID + 1, ID = playlistItems.Last().ID + 1,
BeatmapID = currentItem.BeatmapID, BeatmapID = currentItem.BeatmapID,