Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions SS14.Launcher/ConfigConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
24 changes: 14 additions & 10 deletions SS14.Launcher/Models/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private async Task<ContentLaunchInfo> 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<ContentLaunchInfo> InstallContentBundle(
Expand Down Expand Up @@ -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<ContentLaunchInfo> InstallEnginesForVersion(
SqliteConnection con,
long versionRowId,
string engine,
Lazy<Task<EngineModuleManifest>> 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;
Expand Down
Loading