// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; using System.Threading.Tasks; using osu.Game.Online.API; using osu.Game.Online.Rooms; namespace osu.Game.Online.Multiplayer { /// /// 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(int userId); /// /// As the host, kick another user from the room. /// /// The user to kick.. /// A user other than the current host is attempting to kick a user. /// If the user is not in a room. Task KickUser(int 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); /// /// Change the local user's availability state of the current beatmap set in joined room. /// /// The proposed new beatmap availability state. Task ChangeBeatmapAvailability(BeatmapAvailability newBeatmapAvailability); /// /// Change the local user's mods in the currently joined room. /// /// The proposed new mods, excluding any required by the room itself. Task ChangeUserMods(IEnumerable newMods); /// /// Send a match type specific request. /// /// The request to send. Task SendMatchRequest(MatchUserRequest request); /// /// 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(); /// /// Adds an item to the playlist. /// /// The item to add. Task AddPlaylistItem(MultiplayerPlaylistItem item); } }