diff --git a/osu.Game/Online/RealtimeMultiplayer/IMultiplayerLoungeServer.cs b/osu.Game/Online/RealtimeMultiplayer/IMultiplayerLoungeServer.cs new file mode 100644 index 0000000000..eecb61bcb0 --- /dev/null +++ b/osu.Game/Online/RealtimeMultiplayer/IMultiplayerLoungeServer.cs @@ -0,0 +1,20 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Threading.Tasks; + +namespace osu.Game.Online.RealtimeMultiplayer +{ + /// + /// Interface for an out-of-room multiplayer server. + /// + public interface IMultiplayerLoungeServer + { + /// + /// Request to join a multiplayer room. + /// + /// The databased room ID. + /// If the user is already in the requested (or another) room. + Task JoinRoom(long roomId); + } +} diff --git a/osu.Game/Online/RealtimeMultiplayer/IMultiplayerRoomServer.cs b/osu.Game/Online/RealtimeMultiplayer/IMultiplayerRoomServer.cs new file mode 100644 index 0000000000..f1b3daf7d3 --- /dev/null +++ b/osu.Game/Online/RealtimeMultiplayer/IMultiplayerRoomServer.cs @@ -0,0 +1,51 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System.Threading.Tasks; + +namespace osu.Game.Online.RealtimeMultiplayer +{ + /// + /// Interface for an in-room multiplayer server. + /// + public interface IMultiplayerRoomServer + { + /// + /// Request to leave the currently joined room. + /// + /// If the user is not in a room. + Task LeaveRoom(); + + /// + /// Transfer the host of the currently joined room to another user in the room. + /// + /// The new user which is to become host. + /// A user other than the current host is attempting to transfer host. + /// If the user is not in a room. + Task TransferHost(long userId); + + /// + /// As the host, update the settings of the currently joined room. + /// + /// The new settings to apply. + /// A user other than the current host is attempting to transfer host. + /// If the user is not in a room. + Task ChangeSettings(MultiplayerRoomSettings settings); + + /// + /// Change the local user state in the currently joined room. + /// + /// The proposed new state. + /// If the state change requested is not valid, given the previous state or room state. + /// If the user is not in a room. + Task ChangeState(MultiplayerUserState newState); + + /// + /// As the host of a room, start the match. + /// + /// A user other than the current host is attempting to start the game. + /// If the user is not in a room. + /// If an attempt to start the game occurs when the game's (or users') state disallows it. + Task StartMatch(); + } +} diff --git a/osu.Game/Online/RealtimeMultiplayer/IMultiplayerServer.cs b/osu.Game/Online/RealtimeMultiplayer/IMultiplayerServer.cs index e2e7b6b991..1d093af743 100644 --- a/osu.Game/Online/RealtimeMultiplayer/IMultiplayerServer.cs +++ b/osu.Game/Online/RealtimeMultiplayer/IMultiplayerServer.cs @@ -1,58 +1,12 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System.Threading.Tasks; - namespace osu.Game.Online.RealtimeMultiplayer { /// - /// An interface defining the spectator server instance. + /// An interface defining the multiplayer server instance. /// - public interface IMultiplayerServer + public interface IMultiplayerServer : IMultiplayerRoomServer, IMultiplayerLoungeServer { - /// - /// Request to join a multiplayer room. - /// - /// The databased room ID. - /// If the user is already in the requested (or another) room. - Task JoinRoom(long roomId); - - /// - /// Request to leave the currently joined room. - /// - /// If the user is not in a room. - Task LeaveRoom(); - - /// - /// Transfer the host of the currently joined room to another user in the room. - /// - /// The new user which is to become host. - /// A user other than the current host is attempting to transfer host. - /// If the user is not in a room. - Task TransferHost(long userId); - - /// - /// As the host, update the settings of the currently joined room. - /// - /// The new settings to apply. - /// A user other than the current host is attempting to transfer host. - /// If the user is not in a room. - Task ChangeSettings(MultiplayerRoomSettings settings); - - /// - /// Change the local user state in the currently joined room. - /// - /// The proposed new state. - /// If the state change requested is not valid, given the previous state or room state. - /// If the user is not in a room. - Task ChangeState(MultiplayerUserState newState); - - /// - /// As the host of a room, start the match. - /// - /// A user other than the current host is attempting to start the game. - /// If the user is not in a room. - /// If an attempt to start the game occurs when the game's (or users') state disallows it. - Task StartMatch(); } }