using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using Facepunch.Steamworks.Data; namespace Facepunch.Steamworks { /// /// Functions that provide information about Steam Remote Play sessions, streaming your game content to another computer or to a Steam Link app or hardware. /// public class SteamRemotePlay : SteamClientClass { internal static ISteamRemotePlay Internal => Interface as ISteamRemotePlay; internal override void InitializeInterface( bool server ) { SetInterface( server, new ISteamRemotePlay( server ) ); InstallEvents( server ); } internal void InstallEvents( bool server ) { Dispatch.Install( x => OnSessionConnected?.Invoke( x.SessionID ), server ); Dispatch.Install( x => OnSessionDisconnected?.Invoke( x.SessionID ), server ); } /// /// Called when a session is connected /// public static event Action OnSessionConnected; /// /// Called when a session becomes disconnected /// public static event Action OnSessionDisconnected; /// /// Get the number of currently connected Steam Remote Play sessions /// public static int SessionCount => (int) Internal.GetSessionCount(); /// /// Get the currently connected Steam Remote Play session ID at the specified index. /// IsValid will return false if it's out of bounds /// public static RemotePlaySession GetSession( int index ) => (RemotePlaySession) Internal.GetSessionID( index ).Value; /// /// Invite a friend to Remote Play Together /// This returns false if the invite can't be sent /// public static bool SendInvite( SteamId steamid ) => Internal.BSendRemotePlayTogetherInvite( steamid ); } }