Files
opengenesislinkserver/addons/OGLAssetService/OGLAssetServiceRobustBootstrap.cs
T
OpenGenesis (MPL 2.0) 9295b28179 feat(ogl-assets): integrate safe FSAssets-compatible Gen 1 addon (#237)
Distribute the opt-in OGL AssetService, isolated build/ROBUST/DB/HTTP and cache/atomic migration tests, and staged admin infrastructure. Preserve existing AssetService/HGAssetService configuration and authoritative FSAssets storage. Fix SSD cache reuse across ROBUST restarts. No production cutover; distributed caches, atomic updates and admin listener remain disabled. Real-data staging and rollback required before activation.
2026-10-23 03:16:20 +02:00

35 lines
1.5 KiB
C#

using System;
using Nini.Config;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces;
namespace OpenGenesisLINK.Addons.AssetService
{
/// <summary>
/// Explicit host integration for the exact asset instance loaded by ROBUST.
/// Never constructs another asset connector or binds the public asset port.
/// </summary>
public static class OGLAssetServiceRobustBootstrap
{
public static OGLAssetServiceAdminListener StartAdmin(
IConfigSource config, IHttpServer dedicatedAdminServer,
IAssetService loadedAssetService, string auditPath,
long maxJournalBytes, int retainedFiles)
{
if (config == null) throw new ArgumentNullException(nameof(config));
IConfig section = config.Configs[OGLAssetServiceAdminHostConfiguration.Section];
if (section == null || !section.GetBoolean("Enabled", false))
return null;
if (loadedAssetService is not OGLAssetConnector connector)
throw new InvalidOperationException(
"Administrative endpoints require the ROBUST-loaded OGLAssetConnector.");
// The host must pass its separately configured TLS listener.
// Startup preflight and journal ownership belong to the listener.
return OGLAssetServiceAdminListener.Start(config, dedicatedAdminServer,
connector, auditPath, maxJournalBytes, retainedFiles);
}
}
}