mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 18:23:04 +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>
|
||||
/// <param name="playlistItemId">The item to remove.</param>
|
||||
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();
|
||||
|
||||
public abstract Task InvitePlayer(int userId);
|
||||
|
||||
/// <summary>
|
||||
/// Change the current <see cref="MultiplayerRoom"/> settings.
|
||||
/// </summary>
|
||||
|
@ -106,6 +106,16 @@ namespace osu.Game.Online.Multiplayer
|
||||
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)
|
||||
{
|
||||
if (!IsConnected.Value)
|
||||
|
Loading…
Reference in New Issue
Block a user