// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using System.Collections.Generic; using System.Threading.Tasks; using osu.Game.Online.API; using osu.Game.Online.Rooms; namespace osu.Game.Online.Multiplayer { /// /// An interface defining a multiplayer client instance. /// public interface IMultiplayerClient { /// /// Signals that the room has changed state. /// /// The state of the room. Task RoomStateChanged(MultiplayerRoomState state); /// /// Signals that a user has joined the room. /// /// The user. Task UserJoined(MultiplayerRoomUser user); /// /// Signals that a user has left the room. /// /// The user. Task UserLeft(MultiplayerRoomUser user); /// /// Signals that a user has been kicked from the room. /// /// /// This will also be sent to the user that was kicked. /// /// The user. Task UserKicked(MultiplayerRoomUser user); /// /// Signals that a user has been invited into a multiplayer room. /// /// Id of user that invited the player. /// Id of the room the user got invited to. /// Password to join the room. Task Invited(int invitedBy, long roomID, string password); /// /// Signal that the host of the room has changed. /// /// The user ID of the new host. Task HostChanged(int userId); /// /// Signals that the settings for this room have changed. /// /// The updated room settings. Task SettingsChanged(MultiplayerRoomSettings newSettings); /// /// Signals that a user in this room changed their state. /// /// The ID of the user performing a state change. /// The new state of the user. Task UserStateChanged(int userId, MultiplayerUserState state); /// /// Signals that the match type state has changed for a user in this room. /// /// The ID of the user performing a state change. /// The new state of the user. Task MatchUserStateChanged(int userId, MatchUserState state); /// /// Signals that the match type state has changed for this room. /// /// The new state of the room. Task MatchRoomStateChanged(MatchRoomState state); /// /// Send a match type specific request. /// /// The event to handle. Task MatchEvent(MatchServerEvent e); /// /// Signals that a user in this room changed their beatmap availability state. /// /// The ID of the user whose beatmap availability state has changed. /// The new beatmap availability state of the user. Task UserBeatmapAvailabilityChanged(int userId, BeatmapAvailability beatmapAvailability); /// /// Signals that a user in this room changed their local mods. /// /// The ID of the user whose mods have changed. /// The user's new local mods. Task UserModsChanged(int userId, IEnumerable mods); /// /// Signals that the match is starting and the loading of gameplay should be started. This will *only* be sent to clients which are to begin loading at this point. /// Task LoadRequested(); /// /// Signals that loading of gameplay is to be aborted. /// Task LoadAborted(); /// /// Signals that gameplay has started. /// All users in the or states should begin gameplay as soon as possible. /// Task GameplayStarted(); /// /// Signals that the match has ended, all players have finished and results are ready to be displayed. /// Task ResultsReady(); /// /// Signals that an item has been added to the playlist. /// /// The added item. Task PlaylistItemAdded(MultiplayerPlaylistItem item); /// /// Signals that an item has been removed from the playlist. /// /// The removed item. Task PlaylistItemRemoved(long playlistItemId); /// /// Signals that an item has been changed in the playlist. /// /// The changed item. Task PlaylistItemChanged(MultiplayerPlaylistItem item); } }