diff --git a/CHANGELOG.md b/CHANGELOG.md index 97f3b900..8387f3b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ### Changelog +#### Version - 2.3.5.0 - 12/16/2020 +* Fix tesall.ru download support +* Implement MechWarrior 5 support as a native compiler game +* Make the title in the WJ gallery (in app) optional for games that want the title to be in the splash screen +* Worked a few kinks out of the native game compiler + #### Version - 2.3.4.3 - 12/6/2020 * Disable the back button during install/compilation diff --git a/Wabbajack.CLI/Wabbajack.CLI.csproj b/Wabbajack.CLI/Wabbajack.CLI.csproj index 16237353..2842fa10 100644 --- a/Wabbajack.CLI/Wabbajack.CLI.csproj +++ b/Wabbajack.CLI/Wabbajack.CLI.csproj @@ -6,8 +6,8 @@ wabbajack-cli Wabbajack x64 - 2.3.4.3 - 2.3.4.3 + 2.3.5.0 + 2.3.5.0 Copyright © 2019-2020 An automated ModList installer true diff --git a/Wabbajack.Common/GameMetaData.cs b/Wabbajack.Common/GameMetaData.cs index fc4bcded..d4d0e397 100644 --- a/Wabbajack.Common/GameMetaData.cs +++ b/Wabbajack.Common/GameMetaData.cs @@ -4,6 +4,7 @@ using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; +using System.Net.Http.Headers; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Wabbajack.Common.StoreHandlers; @@ -38,7 +39,8 @@ namespace Wabbajack.Common Witcher3, [Description("Stardew Valley")] StardewValley, - KingdomComeDeliverance + KingdomComeDeliverance, + MechWarrior5Mercenaries } public static class GameExtensions @@ -67,6 +69,8 @@ namespace Wabbajack.Common // to get gog ids: https://www.gogdb.org public List? GOGIDs { get; internal set; } + + public List EpicGameStoreIDs { get; internal set; } = new List(); // to get BethNet IDs: check the registry public int BethNetID { get; internal set; } @@ -99,7 +103,16 @@ namespace Wabbajack.Common if (MainExecutable == null) throw new NotImplementedException(); - return FileVersionInfo.GetVersionInfo((string)gameLoc.Combine(MainExecutable)).ProductVersion; + var info = FileVersionInfo.GetVersionInfo((string)gameLoc.Combine(MainExecutable)); + var version = info.ProductVersion; + if (string.IsNullOrWhiteSpace(version)) + { + version = + $"{info.ProductMajorPart}.{info.ProductMinorPart}.{info.ProductBuildPart}.{info.ProductPrivatePart}"; + return version; + } + + return version; } } @@ -508,6 +521,23 @@ namespace Wabbajack.Common }, MainExecutable = @"bin\Win64\KingdomCome.exe" } + }, + { + Game.MechWarrior5Mercenaries, new GameMetaData + { + Game = Game.MechWarrior5Mercenaries, + NexusName = "mechwarrior5mercenaries", + MO2Name = "Mechwarrior 5: Mercenaries", + MO2ArchiveName = "mechwarrior5mercenaries", + NexusGameId = 3099, + EpicGameStoreIDs = new List {"9fd39d8ac72946a2a10a887ce86e6c35"}, + IsGenericMO2Plugin = true, + RequiredFiles = new List + { + @"MW5Mercs\Binaries\Win64\MechWarrior-Win64-Shipping.exe" + }, + MainExecutable = @"MW5Mercs\Binaries\Win64\MechWarrior-Win64-Shipping.exe" + } } }; diff --git a/Wabbajack.Common/StoreHandlers/EpicGameStoreHandler.cs b/Wabbajack.Common/StoreHandlers/EpicGameStoreHandler.cs new file mode 100644 index 00000000..67cf1852 --- /dev/null +++ b/Wabbajack.Common/StoreHandlers/EpicGameStoreHandler.cs @@ -0,0 +1,80 @@ +using System; +using System.Linq; +using Microsoft.Win32; + +namespace Wabbajack.Common.StoreHandlers +{ + public class EpicGameStoreHandler : AStoreHandler + { + public override StoreType Type { get; internal set; } + + public string BaseRegKey = @"SOFTWARE\Epic Games\EOS"; + public override bool Init() + { + return true; + } + + public override bool LoadAllGames() + { + using var eosKey = Registry.CurrentUser.OpenSubKey(BaseRegKey); + if (eosKey == null) + { + Utils.Log("Epic Game Store is not installed"); + return false; + } + + var name = eosKey.GetValue("ModSdkMetadataDir"); + if (name == null) + { + Utils.Log("Registry key entry does not exist for Epic Game store"); + return false; + } + + var byID = GameRegistry.Games.SelectMany(g => g.Value.EpicGameStoreIDs + .Select(id => (id, g.Value.Game))) + .GroupBy(t => t.id) + .ToDictionary(t => t.Key, t => t.First().Game); + + foreach (var itm in ((AbsolutePath)(string)(name!)).EnumerateFiles(false, "*.item")) + { + var item = itm.FromJson(); + Console.WriteLine($"Found Epic Game Store Game: {item.DisplayName} at {item.InstallLocation}"); + + if (byID.TryGetValue(item.CatalogItemId, out var game)) + { + Games.Add(new EpicStoreGame(game, item)); + } + + } + + + + return true; + } + + public class EpicStoreGame : AStoreGame + { + public EpicStoreGame(Game game, EpicGameItem item) + { + Type = StoreType.EpicGameStore; + Game = game; + Path = (AbsolutePath)item.InstallLocation; + Name = game.MetaData().HumanFriendlyGameName; + + } + + public override Game Game { get; internal set; } + public override StoreType Type { get; internal set; } + } + + public class EpicGameItem + { + public string DisplayName { get; set; } = ""; + public string InstallationGuid { get; set; } = ""; + public string CatalogItemId { get; set; } = ""; + public string CatalogNamespace { get; set; } = ""; + public string InstallSessionId { get; set; } = ""; + public string InstallLocation { get; set; } = ""; + } + } +} diff --git a/Wabbajack.Common/StoreHandlers/StoreHandler.cs b/Wabbajack.Common/StoreHandlers/StoreHandler.cs index 295c2225..68d3653c 100644 --- a/Wabbajack.Common/StoreHandlers/StoreHandler.cs +++ b/Wabbajack.Common/StoreHandlers/StoreHandler.cs @@ -9,7 +9,8 @@ namespace Wabbajack.Common.StoreHandlers { STEAM, GOG, - BethNet + BethNet, + EpicGameStore } public class StoreHandler @@ -25,6 +26,9 @@ namespace Wabbajack.Common.StoreHandlers private static readonly Lazy _bethNetHandler = new Lazy(() => new BethNetHandler()); public BethNetHandler BethNetHandler = _bethNetHandler.Value; + + private static readonly Lazy _epicGameStoreHandler = new Lazy(() => new EpicGameStoreHandler()); + public EpicGameStoreHandler EpicGameStoreHandler = _epicGameStoreHandler.Value; public List StoreGames; @@ -67,6 +71,18 @@ namespace Wabbajack.Common.StoreHandlers { Utils.Error(new StoreException("Could not Init the BethNetHandler, check previous error messages!")); } + + if (EpicGameStoreHandler.Init()) + { + if (EpicGameStoreHandler.LoadAllGames()) + StoreGames.AddRange(EpicGameStoreHandler.Games); + else + Utils.Error(new StoreException("Could not load all Games from the EpicGameStoreHandler, check previous error messages!")); + } + else + { + Utils.Error(new StoreException("Could not Init the EpicGameStoreHandler, check previous error messages!")); + } } public AbsolutePath? TryGetGamePath(Game game) diff --git a/Wabbajack.Launcher/Wabbajack.Launcher.csproj b/Wabbajack.Launcher/Wabbajack.Launcher.csproj index 9bdb83d4..67ced83f 100644 --- a/Wabbajack.Launcher/Wabbajack.Launcher.csproj +++ b/Wabbajack.Launcher/Wabbajack.Launcher.csproj @@ -4,8 +4,8 @@ WinExe netcoreapp3.1 true - 2.3.4.3 - 2.3.4.3 + 2.3.5.0 + 2.3.5.0 Copyright © 2019-2020 Wabbajack Application Launcher true diff --git a/Wabbajack.Server/Wabbajack.Server.csproj b/Wabbajack.Server/Wabbajack.Server.csproj index 9eb7a5f2..540bddb7 100644 --- a/Wabbajack.Server/Wabbajack.Server.csproj +++ b/Wabbajack.Server/Wabbajack.Server.csproj @@ -3,8 +3,8 @@ Exe netcoreapp3.1 - 2.3.4.3 - 2.3.4.3 + 2.3.5.0 + 2.3.5.0 Copyright © 2019-2020 Wabbajack Server win-x64 diff --git a/Wabbajack/Wabbajack.csproj b/Wabbajack/Wabbajack.csproj index 0580401c..32ede8d1 100644 --- a/Wabbajack/Wabbajack.csproj +++ b/Wabbajack/Wabbajack.csproj @@ -6,8 +6,8 @@ true x64 win10-x64 - 2.3.4.3 - 2.3.4.3 + 2.3.5.0 + 2.3.5.0 Copyright © 2019-2020 An automated ModList installer true