2020-12-04 09:18:41 +00:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
2020-12-04 06:34:31 +00:00
|
|
|
namespace osu.Game.Online.RealtimeMultiplayer
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// An interface defining the spectator server instance.
|
|
|
|
/// </summary>
|
|
|
|
public interface IMultiplayerServer
|
|
|
|
{
|
2020-12-04 09:18:41 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Request to join a multiplayer room.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="roomId">The databased room ID.</param>
|
2020-12-09 03:07:19 +00:00
|
|
|
/// <exception cref="AlreadyInRoomException">If the user is already in the requested (or another) room.</exception>
|
2020-12-08 07:15:58 +00:00
|
|
|
Task<MultiplayerRoom> JoinRoom(long roomId);
|
2020-12-04 09:18:41 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Request to leave the currently joined room.
|
|
|
|
/// </summary>
|
2020-12-09 03:05:50 +00:00
|
|
|
/// <exception cref="NotJoinedRoomException">If the user is not in a room.</exception>
|
2020-12-08 05:39:26 +00:00
|
|
|
Task LeaveRoom();
|
2020-12-08 07:32:45 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Transfer the host of the currently joined room to another user in the room.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="userId">The new user which is to become host.</param>
|
2020-12-08 10:06:08 +00:00
|
|
|
/// <exception cref="NotHostException">A user other than the current host is attempting to transfer host.</exception>
|
2020-12-09 03:05:50 +00:00
|
|
|
/// <exception cref="NotJoinedRoomException">If the user is not in a room.</exception>
|
2020-12-08 07:32:45 +00:00
|
|
|
Task TransferHost(long userId);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// As the host, update the settings of the currently joined room.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="settings">The new settings to apply.</param>
|
2020-12-09 03:05:50 +00:00
|
|
|
/// <exception cref="NotHostException">A user other than the current host is attempting to transfer host.</exception>
|
|
|
|
/// <exception cref="NotJoinedRoomException">If the user is not in a room.</exception>
|
2020-12-08 07:32:45 +00:00
|
|
|
Task ChangeSettings(MultiplayerRoomSettings settings);
|
2020-12-08 08:41:56 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Change the local user state in the currently joined room.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="newState">The proposed new state.</param>
|
2020-12-09 03:07:19 +00:00
|
|
|
/// <exception cref="InvalidStateChangeException">If the state change requested is not valid, given the previous state or room state.</exception>
|
2020-12-09 03:05:50 +00:00
|
|
|
/// <exception cref="NotJoinedRoomException">If the user is not in a room.</exception>
|
2020-12-08 08:41:56 +00:00
|
|
|
Task ChangeState(MultiplayerUserState newState);
|
2020-12-08 09:42:08 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// As the host of a room, start the match.
|
|
|
|
/// </summary>
|
2020-12-08 10:06:08 +00:00
|
|
|
/// <exception cref="NotHostException">A user other than the current host is attempting to start the game.</exception>
|
2020-12-09 03:05:50 +00:00
|
|
|
/// <exception cref="NotJoinedRoomException">If the user is not in a room.</exception>
|
2020-12-08 09:42:08 +00:00
|
|
|
Task StartMatch();
|
2020-12-04 06:34:31 +00:00
|
|
|
}
|
2020-12-08 07:32:45 +00:00
|
|
|
}
|