1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 07:47:25 +08:00
osu-lazer/osu.Game/Online/Spectator/ISpectatorServer.cs
2020-10-22 17:48:15 +09:00

42 lines
1.5 KiB
C#

using System.Threading.Tasks;
namespace osu.Game.Online.Spectator
{
/// <summary>
/// An interface defining the spectator server instance.
/// </summary>
public interface ISpectatorServer
{
/// <summary>
/// Signal the start of a new play session.
/// </summary>
/// <param name="state">The state of gameplay.</param>
Task BeginPlaySession(SpectatorState state);
/// <summary>
/// Send a bundle of frame data for the current play session.
/// </summary>
/// <param name="data">The frame data.</param>
Task SendFrameData(FrameDataBundle data);
/// <summary>
/// Signal the end of a play session.
/// </summary>
/// <param name="state">The state of gameplay.</param>
Task EndPlaySession(SpectatorState state);
/// <summary>
/// Request spectating data for the specified user. May be called on multiple users and offline users.
/// For offline users, a subscription will be created and data will begin streaming on next play.
/// </summary>
/// <param name="userId">The user to subscribe to.</param>
Task StartWatchingUser(string userId);
/// <summary>
/// Stop requesting spectating data for the specified user. Unsubscribes from receiving further data.
/// </summary>
/// <param name="userId">The user to unsubscribe from.</param>
Task EndWatchingUser(string userId);
}
}