mirror of
https://github.com/ppy/osu
synced 2024-12-27 17:32:56 +00:00
Add event flow for receiving kick commands
This commit is contained in:
parent
d6352637d6
commit
d9a4f018e6
@ -31,6 +31,15 @@ namespace osu.Game.Online.Multiplayer
|
||||
/// <param name="user">The user.</param>
|
||||
Task UserLeft(MultiplayerRoomUser user);
|
||||
|
||||
/// <summary>
|
||||
/// Signals that a user has been kicked from the room.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This will also be sent to the user that was kicked.
|
||||
/// </remarks>
|
||||
/// <param name="user">The user.</param>
|
||||
Task UserKicked(MultiplayerRoomUser user);
|
||||
|
||||
/// <summary>
|
||||
/// Signal that the host of the room has changed.
|
||||
/// </summary>
|
||||
|
@ -389,6 +389,12 @@ namespace osu.Game.Online.Multiplayer
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
Task IMultiplayerClient.UserKicked(MultiplayerRoomUser user)
|
||||
{
|
||||
// TODO: also inform users of the kick operation.
|
||||
return ((IMultiplayerClient)this).UserLeft(user);
|
||||
}
|
||||
|
||||
Task IMultiplayerClient.HostChanged(int userId)
|
||||
{
|
||||
if (Room == null)
|
||||
|
@ -50,6 +50,7 @@ namespace osu.Game.Online.Multiplayer
|
||||
connection.On<MultiplayerRoomState>(nameof(IMultiplayerClient.RoomStateChanged), ((IMultiplayerClient)this).RoomStateChanged);
|
||||
connection.On<MultiplayerRoomUser>(nameof(IMultiplayerClient.UserJoined), ((IMultiplayerClient)this).UserJoined);
|
||||
connection.On<MultiplayerRoomUser>(nameof(IMultiplayerClient.UserLeft), ((IMultiplayerClient)this).UserLeft);
|
||||
connection.On<MultiplayerRoomUser>(nameof(IMultiplayerClient.UserKicked), ((IMultiplayerClient)this).UserKicked);
|
||||
connection.On<int>(nameof(IMultiplayerClient.HostChanged), ((IMultiplayerClient)this).HostChanged);
|
||||
connection.On<MultiplayerRoomSettings>(nameof(IMultiplayerClient.SettingsChanged), ((IMultiplayerClient)this).SettingsChanged);
|
||||
connection.On<int, MultiplayerUserState>(nameof(IMultiplayerClient.UserStateChanged), ((IMultiplayerClient)this).UserStateChanged);
|
||||
|
Loading…
Reference in New Issue
Block a user