mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 21:52:55 +08:00
Add InvitePlayer
method to multiplayer server
This commit is contained in:
parent
d701a25969
commit
d19cdbdefb
@ -99,5 +99,12 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="playlistItemId">The item to remove.</param>
|
/// <param name="playlistItemId">The item to remove.</param>
|
||||||
Task RemovePlaylistItem(long playlistItemId);
|
Task RemovePlaylistItem(long playlistItemId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invites a player to the current room.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task InvitePlayer(int userId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -260,6 +260,8 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
|
|
||||||
protected abstract Task LeaveRoomInternal();
|
protected abstract Task LeaveRoomInternal();
|
||||||
|
|
||||||
|
public abstract Task InvitePlayer(int userId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Change the current <see cref="MultiplayerRoom"/> settings.
|
/// Change the current <see cref="MultiplayerRoom"/> settings.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -106,6 +106,16 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
return connection.InvokeAsync(nameof(IMultiplayerServer.LeaveRoom));
|
return connection.InvokeAsync(nameof(IMultiplayerServer.LeaveRoom));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override Task InvitePlayer(int userId)
|
||||||
|
{
|
||||||
|
if (!IsConnected.Value)
|
||||||
|
return Task.CompletedTask;
|
||||||
|
|
||||||
|
Debug.Assert(connection != null);
|
||||||
|
|
||||||
|
return connection.InvokeAsync(nameof(IMultiplayerServer.InvitePlayer), userId);
|
||||||
|
}
|
||||||
|
|
||||||
public override Task TransferHost(int userId)
|
public override Task TransferHost(int userId)
|
||||||
{
|
{
|
||||||
if (!IsConnected.Value)
|
if (!IsConnected.Value)
|
||||||
|
Loading…
Reference in New Issue
Block a user