From a56921e130f57c653cc5669a2ab8c6225e0914e7 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Sun, 27 Jun 2021 14:35:11 -0600 Subject: [PATCH] 2.5.0.4 --- CHANGELOG.md | 4 +++ Wabbajack.CLI/OptionsDefinition.cs | 3 +- Wabbajack.CLI/Properties/launchSettings.json | 3 +- Wabbajack.CLI/Verbs/DownloadFromMeta.cs | 38 ++++++++++++++++++++ Wabbajack.CLI/Wabbajack.CLI.csproj | 4 +-- Wabbajack.Common/Consts.cs | 16 ++++----- Wabbajack.Launcher/Wabbajack.Launcher.csproj | 4 +-- Wabbajack.Lib/LibCefHelpers/Init.cs | 27 +++++++------- Wabbajack.Lib/WebAutomation/WebAutomation.cs | 1 + Wabbajack.Server/Wabbajack.Server.csproj | 4 +-- Wabbajack/Wabbajack.csproj | 4 +-- 11 files changed, 78 insertions(+), 30 deletions(-) create mode 100644 Wabbajack.CLI/Verbs/DownloadFromMeta.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 619a0775..911d7256 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ### Changelog +#### Version - 2.5.0.4 - 6/27/2021 +* Fix for NPE in Texture analysis compiler step +* Implemented attachment support in IPS4 sites + #### Version - 2.5.0.3 - 6/26/2021 * HOTFIX: Fix "argument out of range" error when installing modlists diff --git a/Wabbajack.CLI/OptionsDefinition.cs b/Wabbajack.CLI/OptionsDefinition.cs index b0c960bd..ec4695e9 100644 --- a/Wabbajack.CLI/OptionsDefinition.cs +++ b/Wabbajack.CLI/OptionsDefinition.cs @@ -40,7 +40,8 @@ namespace Wabbajack.CLI typeof(VerifyAllDownloads), typeof(HashBenchmark), typeof(StressTestURL), - typeof(MirrorFolder) + typeof(MirrorFolder), + typeof(DownloadFromMeta) }; } } diff --git a/Wabbajack.CLI/Properties/launchSettings.json b/Wabbajack.CLI/Properties/launchSettings.json index be163303..e60f336f 100644 --- a/Wabbajack.CLI/Properties/launchSettings.json +++ b/Wabbajack.CLI/Properties/launchSettings.json @@ -1,7 +1,8 @@ { "profiles": { "Wabbajack.CLI": { - "commandName": "Project" + "commandName": "Project", + "commandLineArgs": "download-from-meta -m c:\\tmp\\test.meta -o c:\\tmp\\out.7z" } } } \ No newline at end of file diff --git a/Wabbajack.CLI/Verbs/DownloadFromMeta.cs b/Wabbajack.CLI/Verbs/DownloadFromMeta.cs new file mode 100644 index 00000000..3a15c67f --- /dev/null +++ b/Wabbajack.CLI/Verbs/DownloadFromMeta.cs @@ -0,0 +1,38 @@ +using System; +using System.Threading.Tasks; +using CommandLine; +using Wabbajack.Common; +using Wabbajack.Lib; +using Wabbajack.Lib.Downloaders; +using Wabbajack.Lib.LibCefHelpers; + +namespace Wabbajack.CLI.Verbs +{ + [Verb("download-from-meta", HelpText = "Download a file from a given .meta file")] + public class DownloadFromMeta : AVerb + { + [Option('m', "meta", Required = true, HelpText = "Meta to read from which to source the download")] + public string Meta { get; set; } = ""; + + [Option('o', "output", Required = true, HelpText = "Output file name")] + public string Output { get; set; } = ""; + + + protected override async Task Run() + { + var state = await DownloadDispatcher.ResolveArchive(((AbsolutePath)Meta).LoadIniFile(), true); + if (state == null) + { + Console.WriteLine("Cannot find downloader for input meta"); + return ExitCode.Error; + } + + var astate = (AbstractDownloadState)state; + + Console.WriteLine($"Downloading {astate.PrimaryKeyString}"); + await astate.Download(new Archive(astate), (AbsolutePath)Output); + + return ExitCode.Ok; + } + } +} diff --git a/Wabbajack.CLI/Wabbajack.CLI.csproj b/Wabbajack.CLI/Wabbajack.CLI.csproj index 3b7e27a4..e66a55a2 100644 --- a/Wabbajack.CLI/Wabbajack.CLI.csproj +++ b/Wabbajack.CLI/Wabbajack.CLI.csproj @@ -6,8 +6,8 @@ wabbajack-cli Wabbajack x64 - 2.5.0.3 - 2.5.0.3 + 2.5.0.4 + 2.5.0.4 Copyright © 2019-2020 An automated ModList installer true diff --git a/Wabbajack.Common/Consts.cs b/Wabbajack.Common/Consts.cs index 065ef487..f4cf5d2e 100644 --- a/Wabbajack.Common/Consts.cs +++ b/Wabbajack.Common/Consts.cs @@ -104,14 +104,14 @@ namespace Wabbajack.Common } } - public static RelativePath MetaIni = new RelativePath("meta.ini"); - public static Extension IniExtension = new Extension(".ini"); + public static RelativePath MetaIni = new("meta.ini"); + public static Extension IniExtension = new(".ini"); - public static Extension HashFileExtension = new Extension(".xxHash"); - public static Extension MetaFileExtension = new Extension(".meta"); + public static Extension HashFileExtension = new(".xxHash"); + public static Extension MetaFileExtension = new(".meta"); public const string ModListExtensionString = ".wabbajack"; - public static Extension ModListExtension = new Extension(ModListExtensionString); - public static AbsolutePath LocalAppDataPath => new AbsolutePath(Path.Combine(KnownFolders.LocalAppData.Path, "Wabbajack")); + public static Extension ModListExtension = new(ModListExtensionString); + public static AbsolutePath LocalAppDataPath => new(Path.Combine(KnownFolders.LocalAppData.Path, "Wabbajack")); public static AbsolutePath FaviconCacheFolderPath => LocalAppDataPath.Combine("favicons"); public static string MetricsKeyHeader => "x-metrics-key"; @@ -136,8 +136,8 @@ namespace Wabbajack.Common public static AbsolutePath EntryPoint => (AbsolutePath)(Assembly.GetEntryAssembly()?.Location ?? (string)((RelativePath)"Unknown").RelativeToWorkingDirectory()); public static AbsolutePath LogFile => LogsFolder.Combine(EntryPoint.FileNameWithoutExtension + ".current.log"); public static int MaxOldLogs = 50; - public static Extension BSA = new Extension(".BSA"); - public static Extension MOHIDDEN = new Extension(".mohidden"); + public static Extension BSA = new(".BSA"); + public static Extension MOHIDDEN = new(".mohidden"); public static AbsolutePath SettingsFile => LocalAppDataPath.Combine("settings.json"); public static RelativePath SettingsIni = (RelativePath)"settings.ini"; diff --git a/Wabbajack.Launcher/Wabbajack.Launcher.csproj b/Wabbajack.Launcher/Wabbajack.Launcher.csproj index 4b8741a5..897c88fb 100644 --- a/Wabbajack.Launcher/Wabbajack.Launcher.csproj +++ b/Wabbajack.Launcher/Wabbajack.Launcher.csproj @@ -4,8 +4,8 @@ Exe net5.0-windows true - 2.5.0.3 - 2.5.0.3 + 2.5.0.4 + 2.5.0.4 Copyright © 2019-2020 Wabbajack Application Launcher true diff --git a/Wabbajack.Lib/LibCefHelpers/Init.cs b/Wabbajack.Lib/LibCefHelpers/Init.cs index 3e7b1d5e..6100d16f 100644 --- a/Wabbajack.Lib/LibCefHelpers/Init.cs +++ b/Wabbajack.Lib/LibCefHelpers/Init.cs @@ -87,21 +87,24 @@ namespace Wabbajack.Lib.LibCefHelpers public static Func? SchemeHandler { get; set; } + private static object _initLock = new object(); public static void Init() { - if (Inited || Cef.IsInitialized) return; - Inited = true; - CefSettings settings = new CefSettings(); - settings.CachePath = Consts.CefCacheLocation.ToString(); - settings.JavascriptFlags = "--noexpose_wasm"; - settings.RegisterScheme(new CefCustomScheme() + lock (_initLock) { - SchemeName = "wabbajack", - SchemeHandlerFactory = new SchemeHandlerFactor() - }); - - - Cef.Initialize(settings); + if (Inited || Cef.IsInitialized) return; + Inited = true; + CefSettings settings = new CefSettings(); + settings.CachePath = Consts.CefCacheLocation.ToString(); + settings.JavascriptFlags = "--noexpose_wasm"; + settings.RegisterScheme(new CefCustomScheme() + { + SchemeName = "wabbajack", SchemeHandlerFactory = new SchemeHandlerFactor() + }); + + + Cef.Initialize(settings); + } } private class SchemeHandlerFactor : ISchemeHandlerFactory diff --git a/Wabbajack.Lib/WebAutomation/WebAutomation.cs b/Wabbajack.Lib/WebAutomation/WebAutomation.cs index c259d327..9162e221 100644 --- a/Wabbajack.Lib/WebAutomation/WebAutomation.cs +++ b/Wabbajack.Lib/WebAutomation/WebAutomation.cs @@ -25,6 +25,7 @@ namespace Wabbajack.Lib.WebAutomation } public static async Task Create() { + Helpers.Init(); var driver = new Driver(); await driver._driver.WaitForInitialized(); return driver; diff --git a/Wabbajack.Server/Wabbajack.Server.csproj b/Wabbajack.Server/Wabbajack.Server.csproj index afb3be28..a9a88fc0 100644 --- a/Wabbajack.Server/Wabbajack.Server.csproj +++ b/Wabbajack.Server/Wabbajack.Server.csproj @@ -3,8 +3,8 @@ Exe net5.0-windows - 2.5.0.3 - 2.5.0.3 + 2.5.0.4 + 2.5.0.4 Copyright © 2019-2020 Wabbajack Server win-x64 diff --git a/Wabbajack/Wabbajack.csproj b/Wabbajack/Wabbajack.csproj index 0151b637..d715f61c 100644 --- a/Wabbajack/Wabbajack.csproj +++ b/Wabbajack/Wabbajack.csproj @@ -6,8 +6,8 @@ true x64 win10-x64 - 2.5.0.3 - 2.5.0.3 + 2.5.0.4 + 2.5.0.4 Copyright © 2019-2020 An automated ModList installer true