feat: initialize existing development playout PCs
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Net;
|
||||
using MBN_STOCK_WEBVIEW.Core.Playout;
|
||||
using MBN_STOCK_WEBVIEW.Core.Playout.Scenes;
|
||||
using MBN_STOCK_WEBVIEW.Playout.Interop;
|
||||
using MBN_STOCK_WEBVIEW.Playout.Runtime;
|
||||
|
||||
@@ -125,6 +126,52 @@ internal sealed record ValidatedPlayoutOptions(
|
||||
throw Invalid(nameof(options.TestSceneAllowlist));
|
||||
}
|
||||
|
||||
if (options.DevelopmentLiveBootstrapApplied)
|
||||
{
|
||||
if (options.Mode != PlayoutMode.Live)
|
||||
{
|
||||
throw Invalid(nameof(options.Mode));
|
||||
}
|
||||
|
||||
if (!IsLiteralLoopback(host))
|
||||
{
|
||||
throw Invalid(nameof(options.Host));
|
||||
}
|
||||
|
||||
string? expectedSceneDirectory;
|
||||
try
|
||||
{
|
||||
expectedSceneDirectory = string.IsNullOrWhiteSpace(
|
||||
options.DevelopmentLiveExecutableSceneDirectory)
|
||||
? null
|
||||
: Path.TrimEndingDirectorySeparator(Path.GetFullPath(
|
||||
options.DevelopmentLiveExecutableSceneDirectory));
|
||||
}
|
||||
catch (Exception exception) when (
|
||||
exception is ArgumentException or IOException or NotSupportedException or
|
||||
System.Security.SecurityException)
|
||||
{
|
||||
throw Invalid(nameof(options.SceneDirectory));
|
||||
}
|
||||
|
||||
if (expectedSceneDirectory is null ||
|
||||
!string.Equals(
|
||||
sceneDirectory,
|
||||
expectedSceneDirectory,
|
||||
StringComparison.OrdinalIgnoreCase) ||
|
||||
options.LegacySceneFadeDuration != 6 ||
|
||||
options.LegacySceneBackgroundKind != LegacySceneBackgroundKind.None ||
|
||||
!string.IsNullOrWhiteSpace(options.LegacySceneBackgroundAssetPath) ||
|
||||
!string.IsNullOrWhiteSpace(options.LegacyBackgroundDirectory) ||
|
||||
options.ReconnectEnabled ||
|
||||
options.MaximumReconnectAttempts != 0 ||
|
||||
options.MaximumAutomaticRefreshesPerTakeIn != 0)
|
||||
{
|
||||
throw new PlayoutConfigurationException(
|
||||
"Development Live configuration no longer matches its protected startup contract.");
|
||||
}
|
||||
}
|
||||
|
||||
if (options.Mode == PlayoutMode.Test)
|
||||
{
|
||||
if (!IsLiteralLoopback(host))
|
||||
|
||||
Reference in New Issue
Block a user