// 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(); /// /// As the host of a room, aborts an on-going match. /// Task AbortMatch(); /// /// Aborts an ongoing gameplay load. /// Task AbortGameplay(); /// /// Adds an item to the playlist. /// /// The item to add. Task AddPlaylistItem(MultiplayerPlaylistItem item); /// /// Edits an existing playlist item with new values. /// /// The item to edit, containing new properties. Must have an ID. Task EditPlaylistItem(MultiplayerPlaylistItem item); /// /// Removes an item from the playlist. /// /// The item to remove. Task RemovePlaylistItem(long playlistItemId); /// /// Invites a player to the current room. /// /// The user to invite. /// The user has blocked or has been blocked by the invited user. /// The invited user does not accept private messages. Task InvitePlayer(int userId); } }