Files
sbox-public/engine/Sandbox.Menu/MenuUtility.Streamer.cs
Garry Newman 62feec4b64 Twitch Api (#5016)
Engine: reworks Twitch IRC parsing/client + Streamer event surface (viewers roster, chat/sub/gift/raid messages) and removes older/broken Twitch API features.

Menu/Editor: adds service linking/stream-connect UI (new Services modal; pause/game modal + editor title button) gated by a project setting.

Services/utilities: introduces helper APIs for linking/listing services; adds unit tests for the IRC parser and subscription tier parsing.
2026-06-06 21:46:13 +01:00

43 lines
959 B
C#

using Sandbox.Engine;
using Sandbox.Modals;
namespace Sandbox;
public static partial class MenuUtility
{
public static class Streaming
{
/// <summary>
/// Returns true if the stream is active
/// </summary>
public static bool IsActive => Sandbox.Engine.Streamer.IsActive;
/// <summary>
/// Init a stream service
/// </summary>
public static async Task<bool> Connect( string serviceName )
{
return await Sandbox.Engine.Streamer.Init( serviceName );
}
/// <summary>
/// Disconnect from streaming service
/// </summary>
public static void Disconnect( string serviceName )
{
Sandbox.Engine.Streamer.Shutdown( serviceName );
}
/// <summary>
/// Open the service connector modal, which allows the player to link/unlink third-party services like Twitch.
/// </summary>
public static void OpenModal()
{
using ( IMenuDll.Current.PushScope() )
{
IModalSystem.Current.ServiceConnector();
}
}
}
}