From fb3f8a79680c90db4e1faefab9bc95c341a94f48 Mon Sep 17 00:00:00 2001 From: EzioTheDeadPoet <52624146+EzioTheDeadPoet@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:20:59 +0100 Subject: [PATCH 1/2] Updated GameFinder, Added EADesktop module --- CHANGELOG.md | 7 ++++ Wabbajack.DTOs/Game/GameMetaData.cs | 3 ++ Wabbajack.DTOs/Game/GameRegistry.cs | 32 +++++++++++++++++++ Wabbajack.Downloaders.GameFile/GameLocator.cs | 22 ++++++++++++- .../Wabbajack.Downloaders.GameFile.csproj | 9 +++--- 5 files changed, 68 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d1e4b92..f041f619 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ ### Changelog +#### Version - TBD +* Updated GameFinder + * Fixes Wabbajack not Launching on some systems +* Added the GameFinder module for EA Desktop + * Only `Dragon Age: Origins` & `Dragon Age: Inquisition` supported for now. + * For other games we still need to collect the right store IDs + #### Version - 3.4.1.0 - 12/21/2023 * Added Support for Final Fantasy 7: Remake Intergrade * Update CLI to .NET 8.0 (was missed in the last update) diff --git a/Wabbajack.DTOs/Game/GameMetaData.cs b/Wabbajack.DTOs/Game/GameMetaData.cs index 1b4a4061..79b9e81f 100644 --- a/Wabbajack.DTOs/Game/GameMetaData.cs +++ b/Wabbajack.DTOs/Game/GameMetaData.cs @@ -1,4 +1,5 @@ using System; +using System.Runtime.InteropServices.JavaScript; using Wabbajack.Paths; namespace Wabbajack.DTOs; @@ -29,6 +30,8 @@ public class GameMetaData // EAPlay games may have @subscription appended to the file name public string[] OriginIDs { get; set; } = Array.Empty(); + public string[] EADesktopIDs { get; set; } = Array.Empty(); + public string[] EpicGameStoreIDs { get; internal init; } = Array.Empty(); // to get BethNet IDs: check the registry diff --git a/Wabbajack.DTOs/Game/GameRegistry.cs b/Wabbajack.DTOs/Game/GameRegistry.cs index e3310ebb..1deefa43 100644 --- a/Wabbajack.DTOs/Game/GameRegistry.cs +++ b/Wabbajack.DTOs/Game/GameRegistry.cs @@ -357,6 +357,22 @@ public static class GameRegistry MO2Name = "Dragon Age: Origins", SteamIDs = new[] {47810}, OriginIDs = new[] {"DR:169789300", "DR:208591800"}, + EADesktopIDs = new [] // Possibly Wrong + { + "9df89a8e-b201-4507-8a8d-bd6799fedb18", + "Origin.SFT.50.0000078", + "Origin.SFT.50.0000078", + "Origin.SFT.50.0000078", + "Origin.SFT.50.0000085", + "Origin.SFT.50.0000086", + "Origin.SFT.50.0000087", + "Origin.SFT.50.0000088", + "Origin.SFT.50.0000089", + "Origin.SFT.50.0000090", + "Origin.SFT.50.0000091", + "Origin.SFT.50.0000097", + "Origin.SFT.50.0000098" + }, GOGIDs = new long[] {1949616134}, RequiredFiles = new[] { @@ -374,6 +390,22 @@ public static class GameRegistry MO2Name = "Dragon Age 2", // Probably wrong SteamIDs = new[] {1238040}, OriginIDs = new[] {"OFB-EAST:59474", "DR:201797000"}, + EADesktopIDs = new [] // Possibly Wrong + { + "Origin.SFT.50.0000073", + "Origin.SFT.50.0000255", + "Origin.SFT.50.0000256", + "Origin.SFT.50.0000257", + "Origin.SFT.50.0000288", + "Origin.SFT.50.0000310", + "Origin.SFT.50.0000311", + "Origin.SFT.50.0000356", + "Origin.SFT.50.0000385", + "Origin.SFT.50.0000429", + "Origin.SFT.50.0000449", + "Origin.SFT.50.0000452", + "Origin.SFT.50.0000453" + }, RequiredFiles = new[] { @"bin_ship\DragonAge2.exe".ToRelativePath() diff --git a/Wabbajack.Downloaders.GameFile/GameLocator.cs b/Wabbajack.Downloaders.GameFile/GameLocator.cs index 8c2a9d94..f5e887a0 100644 --- a/Wabbajack.Downloaders.GameFile/GameLocator.cs +++ b/Wabbajack.Downloaders.GameFile/GameLocator.cs @@ -1,6 +1,8 @@ using System.Runtime.InteropServices; using GameFinder.Common; using GameFinder.RegistryUtils; +using GameFinder.StoreHandlers.EADesktop; +using GameFinder.StoreHandlers.EADesktop.Crypto.Windows; using GameFinder.StoreHandlers.EGS; using GameFinder.StoreHandlers.GOG; using GameFinder.StoreHandlers.Origin; @@ -20,12 +22,14 @@ public class GameLocator : IGameLocator private readonly GOGHandler? _gog; private readonly EGSHandler? _egs; private readonly OriginHandler? _origin; + private readonly EADesktopHandler? _eaDesktop; private readonly Dictionary _steamGames = new(); private readonly Dictionary _gogGames = new(); private readonly Dictionary _egsGames = new(); private readonly Dictionary _originGames = new(); - + private readonly Dictionary _eaDesktopGames = new(); + private readonly Dictionary _locationCache; private readonly ILogger _logger; @@ -42,6 +46,7 @@ public class GameLocator : IGameLocator _gog = new GOGHandler(windowsRegistry, fileSystem); _egs = new EGSHandler(windowsRegistry, fileSystem); _origin = new OriginHandler(fileSystem); + _eaDesktop = new EADesktopHandler(fileSystem, new HardwareInfoProvider()); } else { @@ -90,6 +95,14 @@ public class GameLocator : IGameLocator { _logger.LogError(e, "While finding games installed with Origin"); } + try + { + FindStoreGames(_eaDesktop, _eaDesktopGames, game => (AbsolutePath)game.BaseInstallPath.GetFullPath()); + } + catch (Exception e) + { + _logger.LogError(e, "While finding games installed with EADesktop"); + } } private void FindStoreGames( @@ -189,6 +202,13 @@ public class GameLocator : IGameLocator path = found; return true; } + + foreach (var id in metaData.EADesktopIDs) + { + if (!_eaDesktopGames.TryGetValue(EADesktopGameId.From(id), out var found)) continue; + path = found; + return true; + } path = default; return false; diff --git a/Wabbajack.Downloaders.GameFile/Wabbajack.Downloaders.GameFile.csproj b/Wabbajack.Downloaders.GameFile/Wabbajack.Downloaders.GameFile.csproj index 8f005484..0a03a0ad 100644 --- a/Wabbajack.Downloaders.GameFile/Wabbajack.Downloaders.GameFile.csproj +++ b/Wabbajack.Downloaders.GameFile/Wabbajack.Downloaders.GameFile.csproj @@ -18,10 +18,11 @@ - - - - + + + + + From 3b81f3b856f312f150c383fc5ca82349ff66bf67 Mon Sep 17 00:00:00 2001 From: EzioTheDeadPoet <52624146+EzioTheDeadPoet@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:30:36 +0100 Subject: [PATCH 2/2] updated version number in CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f041f619..f3246b48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ### Changelog #### Version - TBD -* Updated GameFinder +* Updated GameFinder to 4.1.0 * Fixes Wabbajack not Launching on some systems * Added the GameFinder module for EA Desktop * Only `Dragon Age: Origins` & `Dragon Age: Inquisition` supported for now.