Skip including stock game files as download sources if build server has none

This commit is contained in:
erri120 2020-07-05 12:15:31 +02:00
parent 9a71620061
commit ccd79fe25b
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135

View File

@ -204,20 +204,27 @@ namespace Wabbajack.Lib
{
foreach (var ag in AvailableGames)
{
var files = await ClientAPI.GetExistingGameFiles(Queue, ag);
Utils.Log($"Including {files.Length} stock game files from {ag} as download sources");
IndexedArchives.AddRange(files.Select(f =>
try
{
var meta = f.State.GetMetaIniString();
var ini = meta.LoadIniString();
var state = (GameFileSourceDownloader.State)f.State;
return new IndexedArchive(
VFS.Index.ByRootPath[ag.MetaData().GameLocation().Combine(state.GameFile)])
var files = await ClientAPI.GetExistingGameFiles(Queue, ag);
Utils.Log($"Including {files.Length} stock game files from {ag} as download sources");
IndexedArchives.AddRange(files.Select(f =>
{
IniData = ini, Meta = meta,
};
}));
var meta = f.State.GetMetaIniString();
var ini = meta.LoadIniString();
var state = (GameFileSourceDownloader.State)f.State;
return new IndexedArchive(
VFS.Index.ByRootPath[ag.MetaData().GameLocation().Combine(state.GameFile)])
{
IniData = ini, Meta = meta,
};
}));
}
catch (Exception e)
{
Utils.Error(e, "Unable to find existing game files, skipping.");
}
}
}