mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 13:37:25 +08:00
Rename APIPlaylistItem -> MultiplayerPlaylistItem
This commit is contained in:
parent
5a1036a96a
commit
f743a3647f
@ -111,7 +111,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
/// Signals that an item has been added to the playlist.
|
||||
/// </summary>
|
||||
/// <param name="item">The added item.</param>
|
||||
Task PlaylistItemAdded(APIPlaylistItem item);
|
||||
Task PlaylistItemAdded(MultiplayerPlaylistItem item);
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
/// <param name="item">The changed item.</param>
|
||||
Task PlaylistItemChanged(APIPlaylistItem item);
|
||||
Task PlaylistItemChanged(MultiplayerPlaylistItem item);
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
/// Adds an item to the playlist.
|
||||
/// </summary>
|
||||
/// <param name="item">The item to add.</param>
|
||||
Task AddPlaylistItem(APIPlaylistItem item);
|
||||
Task AddPlaylistItem(MultiplayerPlaylistItem item);
|
||||
|
||||
/// <summary>
|
||||
/// Removes an item from the playlist.
|
||||
|
@ -309,7 +309,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
|
||||
public abstract Task RequestAllPlaylistItems();
|
||||
|
||||
public abstract Task AddPlaylistItem(APIPlaylistItem item);
|
||||
public abstract Task AddPlaylistItem(MultiplayerPlaylistItem item);
|
||||
|
||||
public abstract Task RemovePlaylistItem(long playlistItemId);
|
||||
|
||||
@ -603,7 +603,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task PlaylistItemAdded(APIPlaylistItem item)
|
||||
public async Task PlaylistItemAdded(MultiplayerPlaylistItem item)
|
||||
{
|
||||
if (Room == null)
|
||||
return;
|
||||
@ -642,7 +642,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task PlaylistItemChanged(APIPlaylistItem item)
|
||||
public async Task PlaylistItemChanged(MultiplayerPlaylistItem item)
|
||||
{
|
||||
if (Room == null)
|
||||
return;
|
||||
@ -703,7 +703,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
CurrentMatchPlayingItem.Value = APIRoom.Playlist.SingleOrDefault(p => p.ID == settings.PlaylistItemId);
|
||||
}, cancellationToken);
|
||||
|
||||
private async Task<PlaylistItem> createPlaylistItem(APIPlaylistItem item)
|
||||
private async Task<PlaylistItem> createPlaylistItem(MultiplayerPlaylistItem item)
|
||||
{
|
||||
var set = await GetOnlineBeatmapSet(item.BeatmapID).ConfigureAwait(false);
|
||||
|
||||
|
@ -63,9 +63,9 @@ namespace osu.Game.Online.Multiplayer
|
||||
connection.On<MatchRoomState>(nameof(IMultiplayerClient.MatchRoomStateChanged), ((IMultiplayerClient)this).MatchRoomStateChanged);
|
||||
connection.On<int, MatchUserState>(nameof(IMultiplayerClient.MatchUserStateChanged), ((IMultiplayerClient)this).MatchUserStateChanged);
|
||||
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<APIPlaylistItem>(nameof(IMultiplayerClient.PlaylistItemChanged), ((IMultiplayerClient)this).PlaylistItemChanged);
|
||||
connection.On<MultiplayerPlaylistItem>(nameof(IMultiplayerClient.PlaylistItemChanged), ((IMultiplayerClient)this).PlaylistItemChanged);
|
||||
};
|
||||
|
||||
IsConnected.BindTo(connector.IsConnected);
|
||||
@ -155,12 +155,12 @@ namespace osu.Game.Online.Multiplayer
|
||||
public override Task RequestAllPlaylistItems()
|
||||
{
|
||||
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)
|
||||
return Task.CompletedTask;
|
||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Online.Rooms
|
||||
{
|
||||
[Serializable]
|
||||
[MessagePackObject]
|
||||
public class APIPlaylistItem
|
||||
public class MultiplayerPlaylistItem
|
||||
{
|
||||
[Key(0)]
|
||||
public long ID { get; set; }
|
||||
@ -39,11 +39,11 @@ namespace osu.Game.Online.Rooms
|
||||
[Key(7)]
|
||||
public bool Expired { get; set; }
|
||||
|
||||
public APIPlaylistItem()
|
||||
public MultiplayerPlaylistItem()
|
||||
{
|
||||
}
|
||||
|
||||
public APIPlaylistItem(PlaylistItem item)
|
||||
public MultiplayerPlaylistItem(PlaylistItem item)
|
||||
{
|
||||
ID = item.ID;
|
||||
BeatmapID = item.BeatmapID;
|
@ -56,7 +56,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
{
|
||||
loadingLayer.Show();
|
||||
|
||||
client.AddPlaylistItem(new APIPlaylistItem
|
||||
client.AddPlaylistItem(new MultiplayerPlaylistItem
|
||||
{
|
||||
BeatmapID = item.BeatmapID,
|
||||
BeatmapChecksum = item.Beatmap.Value.MD5Hash,
|
||||
|
@ -41,9 +41,9 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
[Resolved]
|
||||
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 APIPlaylistItem? currentItem;
|
||||
private MultiplayerPlaylistItem? currentItem;
|
||||
|
||||
public TestMultiplayerClient(TestMultiplayerRoomManager roomManager)
|
||||
{
|
||||
@ -162,7 +162,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
if (password != apiRoom.Password.Value)
|
||||
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)
|
||||
{
|
||||
@ -300,7 +300,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
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(APIRoom != null);
|
||||
@ -425,7 +425,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
Debug.Assert(APIRoom != null);
|
||||
Debug.Assert(currentItem != null);
|
||||
|
||||
var newItem = new APIPlaylistItem
|
||||
var newItem = new MultiplayerPlaylistItem
|
||||
{
|
||||
ID = playlistItems.Last().ID + 1,
|
||||
BeatmapID = currentItem.BeatmapID,
|
||||
|
Loading…
Reference in New Issue
Block a user