Merge pull request #339 from erri120/store-fixes

Added more verbose output to the StoreHandlers
This commit is contained in:
Timothy Baldridge 2020-01-04 10:45:32 -08:00 committed by GitHub
commit 96f899648d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 15 deletions

View File

@ -105,15 +105,18 @@ namespace Wabbajack.Common.StoreHandlers
}; };
var gameMeta = GameRegistry.Games.Values.FirstOrDefault(g => var gameMeta = GameRegistry.Games.Values.FirstOrDefault(g =>
g.GOGIDs != null {
&& return g.GOGIDs != null
g.GOGIDs.Contains(game.ID) && (g.SteamIDs?.Contains(gameID) ?? false)
&& && (g.RequiredFiles?.TrueForAll(file => File.Exists(Path.Combine(game.Path, file))) ??
g.RequiredFiles.TrueForAll(file => true);
File.Exists(Path.Combine(game.Path, file)))); });
if (gameMeta == null) if (gameMeta == null)
{
Utils.Log($"GOG Game \"{gameName}\"({gameID}) is not supported, skipping");
return; return;
}
game.Game = gameMeta.Game; game.Game = gameMeta.Game;

View File

@ -128,6 +128,8 @@ namespace Wabbajack.Common.StoreHandlers
SteamUniverses.Do(u => SteamUniverses.Do(u =>
{ {
Utils.Log($"Searching for Steam Games in {u}");
Directory.EnumerateFiles(u, "*.acf", SearchOption.TopDirectoryOnly).Where(File.Exists).Do(f => Directory.EnumerateFiles(u, "*.acf", SearchOption.TopDirectoryOnly).Where(File.Exists).Do(f =>
{ {
var game = new SteamGame(); var game = new SteamGame();
@ -146,14 +148,12 @@ namespace Wabbajack.Common.StoreHandlers
if (l.Contains("\"name\"")) if (l.Contains("\"name\""))
game.Name = GetVdfValue(l); game.Name = GetVdfValue(l);
if (l.Contains("\"installdir\"")) if (!l.Contains("\"installdir\""))
{ return;
var path = Path.Combine(u, "common", GetVdfValue(l));
if (Directory.Exists(path)) var path = Path.Combine(u, "common", GetVdfValue(l));
{ if (Directory.Exists(path))
game.Path = path; game.Path = path;
}
}
}); });
if (!gotID || !Directory.Exists(game.Path)) return; if (!gotID || !Directory.Exists(game.Path)) return;
@ -165,7 +165,10 @@ namespace Wabbajack.Common.StoreHandlers
}); });
if (gameMeta == null) if (gameMeta == null)
{
Utils.Log($"Steam Game {game.Name}({game.ID}) is not supported, skipping");
return; return;
}
game.Game = gameMeta.Game; game.Game = gameMeta.Game;
game.Universe = u; game.Universe = u;
@ -183,7 +186,7 @@ namespace Wabbajack.Common.StoreHandlers
return true; return true;
} }
private void LoadWorkshopItems(SteamGame game) private static void LoadWorkshopItems(SteamGame game)
{ {
if(game.WorkshopItems == null) if(game.WorkshopItems == null)
game.WorkshopItems = new List<SteamWorkshopItem>(); game.WorkshopItems = new List<SteamWorkshopItem>();