diff --git a/SS14.Launcher/ConfigConstants.cs b/SS14.Launcher/ConfigConstants.cs index 8772a0a..9d7e150 100644 --- a/SS14.Launcher/ConfigConstants.cs +++ b/SS14.Launcher/ConfigConstants.cs @@ -106,6 +106,13 @@ public static class ConfigConstants "https://robust-builds.fallback.cdn.spacestation14.com/modules.json", ]) }, + { + "Supermatter", + new UrlFallbackSet([ + "https://robust-builds.cdn.spacestation14.com/modules.json", + "https://robust-builds.fallback.cdn.spacestation14.com/modules.json", + ]) + }, }; private static readonly UrlFallbackSet LauncherDataBaseUrl = new([ diff --git a/SS14.Launcher/Models/Updater.cs b/SS14.Launcher/Models/Updater.cs index 056d7a2..dc1a0c3 100644 --- a/SS14.Launcher/Models/Updater.cs +++ b/SS14.Launcher/Models/Updater.cs @@ -132,7 +132,7 @@ private async Task RunUpdate( await Task.Run(() => { CullOldContentVersions(con); }, CancellationToken.None); - return await InstallEnginesForVersion(con, versionRowId, buildInfo.EngineType, cancel); + return await InstallEnginesForVersion(con, versionRowId, buildInfo.EngineType, moduleManifest, cancel); } private async Task InstallContentBundle( @@ -254,32 +254,36 @@ FROM ContentManifest return versionId; }, CancellationToken.None); - return await InstallEnginesForVersion(con, versionId, metadata.Engine, cancel); + return await InstallEnginesForVersion(con, versionId, metadata.Engine, moduleManifest, cancel); } private async Task InstallEnginesForVersion( SqliteConnection con, long versionRowId, string engine, + Lazy> moduleManifest, CancellationToken cancel) { Status = UpdateStatus.CheckingClientUpdate; var modules = con.Query<(string, string)>( - "SELECT ModuleName, moduleVersion FROM ContentEngineDependency WHERE ModuleName = @Engine AND VersionId = @Version", - new { Engine = engine, Version = versionRowId }).ToArray(); + "SELECT ModuleName, moduleVersion FROM ContentEngineDependency WHERE VersionId = @Version", + new { Version = versionRowId }).ToArray(); for (var index = 0; index < modules.Length; index++) { var (name, version) = modules[index]; - if (!ConfigConstants.EngineBuildsUrl.TryGetValue(name, out _)) + if (name == engine) { - Log.Error($"No engine URL set for module {name}"); - continue; + var newEngineVersion = await InstallEngineVersionIfMissing(version, name, cancel); + modules[index] = (name, newEngineVersion); + } + else + { + Status = UpdateStatus.DownloadingEngineModules; + var manifest = await moduleManifest.Value; + await _engineManager.DownloadModuleIfNecessary(name, version, manifest, progress: null, cancel); } - - var newEngineVersion = await InstallEngineVersionIfMissing(version, name, cancel); - modules[index] = (name, newEngineVersion); } Status = UpdateStatus.CullingEngine;