// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Threading.Tasks; namespace osu.Game.Online.Spectator { /// /// An interface defining the spectator server instance. /// public interface ISpectatorServer { /// /// Signal the start of a new play session. /// /// The state of gameplay. Task BeginPlaySession(SpectatorState state); /// /// Send a bundle of frame data for the current play session. /// /// The frame data. Task SendFrameData(FrameDataBundle data); /// /// Signal the end of a play session. /// /// The state of gameplay. Task EndPlaySession(SpectatorState state); /// /// 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. /// /// The user to subscribe to. Task StartWatchingUser(int userId); /// /// Stop requesting spectating data for the specified user. Unsubscribes from receiving further data. /// /// The user to unsubscribe from. Task EndWatchingUser(int userId); } }