2020-12-04 06:34:31 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2021-02-01 08:54:56 +00:00
|
|
|
using System.Collections.Generic;
|
2020-12-04 06:34:31 +00:00
|
|
|
using System.Threading.Tasks;
|
2021-02-01 08:54:56 +00:00
|
|
|
using osu.Game.Online.API;
|
2021-01-03 01:32:50 +00:00
|
|
|
using osu.Game.Online.Rooms;
|
2020-12-04 06:34:31 +00:00
|
|
|
|
2020-12-25 04:38:11 +00:00
|
|
|
namespace osu.Game.Online.Multiplayer
|
2020-12-04 06:34:31 +00:00
|
|
|
{
|
|
|
|
/// <summary>
|
2020-12-08 09:28:31 +00:00
|
|
|
/// An interface defining a multiplayer client instance.
|
2020-12-04 06:34:31 +00:00
|
|
|
/// </summary>
|
|
|
|
public interface IMultiplayerClient
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Signals that the room has changed state.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="state">The state of the room.</param>
|
|
|
|
Task RoomStateChanged(MultiplayerRoomState state);
|
2020-12-07 16:35:42 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Signals that a user has joined the room.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="user">The user.</param>
|
|
|
|
Task UserJoined(MultiplayerRoomUser user);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Signals that a user has left the room.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="user">The user.</param>
|
|
|
|
Task UserLeft(MultiplayerRoomUser user);
|
2020-12-08 05:33:38 +00:00
|
|
|
|
2020-12-08 08:03:44 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Signal that the host of the room has changed.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="userId">The user ID of the new host.</param>
|
2020-12-16 11:04:28 +00:00
|
|
|
Task HostChanged(int userId);
|
2020-12-08 08:03:44 +00:00
|
|
|
|
2020-12-08 05:33:38 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Signals that the settings for this room have changed.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="newSettings">The updated room settings.</param>
|
|
|
|
Task SettingsChanged(MultiplayerRoomSettings newSettings);
|
2020-12-08 08:41:56 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Signals that a user in this room changed their state.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="userId">The ID of the user performing a state change.</param>
|
|
|
|
/// <param name="state">The new state of the user.</param>
|
2020-12-16 11:04:28 +00:00
|
|
|
Task UserStateChanged(int userId, MultiplayerUserState state);
|
2020-12-08 09:42:08 +00:00
|
|
|
|
2021-07-21 09:59:02 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Signals that the match ruleset state has changed for a user in this room.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="userId">The ID of the user performing a state change.</param>
|
|
|
|
/// <param name="state">The new state of the user.</param>
|
|
|
|
Task MatchRulesetUserStateChanged(int userId, MatchRulesetUserState state);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Signals that the match ruleset state has changed for this room.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="state">The new state of the room.</param>
|
|
|
|
Task MatchRulesetRoomStateChanged(MatchRulesetRoomState state);
|
|
|
|
|
2021-01-03 01:32:50 +00:00
|
|
|
/// <summary>
|
2021-01-11 19:28:24 +00:00
|
|
|
/// Signals that a user in this room changed their beatmap availability state.
|
2021-01-03 01:32:50 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="userId">The ID of the user whose beatmap availability state has changed.</param>
|
|
|
|
/// <param name="beatmapAvailability">The new beatmap availability state of the user.</param>
|
|
|
|
Task UserBeatmapAvailabilityChanged(int userId, BeatmapAvailability beatmapAvailability);
|
|
|
|
|
2021-02-01 09:50:32 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Signals that a user in this room changed their local mods.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="userId">The ID of the user whose mods have changed.</param>
|
|
|
|
/// <param name="mods">The user's new local mods.</param>
|
2021-02-01 08:57:32 +00:00
|
|
|
Task UserModsChanged(int userId, IEnumerable<APIMod> mods);
|
2021-02-01 08:54:56 +00:00
|
|
|
|
2020-12-08 09:42:08 +00:00
|
|
|
/// <summary>
|
2020-12-08 10:44:22 +00:00
|
|
|
/// Signals that a match is to be started. This will *only* be sent to clients which are to begin loading at this point.
|
2020-12-08 09:42:08 +00:00
|
|
|
/// </summary>
|
|
|
|
Task LoadRequested();
|
|
|
|
|
|
|
|
/// <summary>
|
2020-12-09 03:03:52 +00:00
|
|
|
/// Signals that a match has started. All users in the <see cref="MultiplayerUserState.Loaded"/> state should begin gameplay as soon as possible.
|
2020-12-08 09:42:08 +00:00
|
|
|
/// </summary>
|
|
|
|
Task MatchStarted();
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Signals that the match has ended, all players have finished and results are ready to be displayed.
|
|
|
|
/// </summary>
|
|
|
|
Task ResultsReady();
|
2020-12-04 06:34:31 +00:00
|
|
|
}
|
|
|
|
}
|