From 4f8aed79a3c173a437c8fdc3f660ead9209bbbdb Mon Sep 17 00:00:00 2001 From: Vitalii Mikhailov Date: Wed, 5 Jul 2023 15:13:56 +0300 Subject: [PATCH] Fixed BLSE detection --- build/common.props | 2 +- changelog.txt | 4 ++++ src/Bannerlord.ButterLib/ExceptionHandler/HtmlBuilder.cs | 6 +++--- .../Logger/Extensions/LoggerExtensions.cs | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/build/common.props b/build/common.props index 59859f38..8cadfe85 100644 --- a/build/common.props +++ b/build/common.props @@ -4,7 +4,7 @@ - 2.8.4 + 2.8.5 2.2.2 3.2.0.77 diff --git a/changelog.txt b/changelog.txt index 5d7122f0..9bc00adb 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,8 @@ --------------------------------------------------------------------------------------------------- +Version: 2.8.5 +Game Versions: v1.0.0,v1.0.1,v1.0.2,v1.0.3,v1.1.0,v1.1.1,v1.1.2,v1.1.3,v1.1.4,v1.1.5,v1.2.0 +* Fixed BLSE detection +--------------------------------------------------------------------------------------------------- Version: 2.8.4 Game Versions: v1.0.0,v1.0.1,v1.0.2,v1.0.3,v1.1.0,v1.1.1,v1.1.2,v1.1.3,v1.1.4,v1.1.5,v1.2.0 * ButterLib is not able to disable v1.2.0 Watchdog, BLSE is required diff --git a/src/Bannerlord.ButterLib/ExceptionHandler/HtmlBuilder.cs b/src/Bannerlord.ButterLib/ExceptionHandler/HtmlBuilder.cs index 1c077099..3b4edaf0 100644 --- a/src/Bannerlord.ButterLib/ExceptionHandler/HtmlBuilder.cs +++ b/src/Bannerlord.ButterLib/ExceptionHandler/HtmlBuilder.cs @@ -27,7 +27,7 @@ namespace Bannerlord.ButterLib.ExceptionHandler { internal static class HtmlBuilder { - private static readonly int Version = 11; + private static readonly int Version = 12; private static readonly string NL = Environment.NewLine; public static readonly string MiniDumpTag = ""; @@ -325,12 +325,12 @@ function screenshot(element) {{ } private static string GetBLSEVersion() { - var blseMetadata = AccessTools2.TypeByName("Bannerlord.BLSE.BLSEInterceptorAttribute")?.Assembly.GetCustomAttributes(); + var blseMetadata = AccessTools2.AllAssemblies().FirstOrDefault(x => x.GetName().Name == "Bannerlord.BLSE")?.GetCustomAttributes(); return blseMetadata?.FirstOrDefault(x => x.Key == "BLSEVersion")?.Value ?? string.Empty; } private static string GetLauncherExVersion() { - var launcherExMetadata = AccessTools2.TypeByName("Bannerlord.LauncherEx.Mixins.LauncherVMMixin")?.Assembly.GetCustomAttributes(); + var launcherExMetadata = AccessTools2.AllAssemblies().FirstOrDefault(x => x.GetName().Name == "Bannerlord.LauncherEx")?.GetCustomAttributes(); return launcherExMetadata?.FirstOrDefault(x => x.Key == "LauncherExVersion")?.Value ?? string.Empty; } diff --git a/src/Bannerlord.ButterLib/Logger/Extensions/LoggerExtensions.cs b/src/Bannerlord.ButterLib/Logger/Extensions/LoggerExtensions.cs index e81bd9c7..20d6d575 100644 --- a/src/Bannerlord.ButterLib/Logger/Extensions/LoggerExtensions.cs +++ b/src/Bannerlord.ButterLib/Logger/Extensions/LoggerExtensions.cs @@ -176,7 +176,7 @@ public KeyValuePair this[int index] { if (index < 0 || index >= Count) throw new IndexOutOfRangeException(nameof(index)); - return index == Count - 1 ? new KeyValuePair("{OriginalFormat}", _originalMessage) : _formatter.GetValue(_values, index); + return index == Count - 1 ? new KeyValuePair("{OriginalFormat}", _originalMessage) : _formatter!.GetValue(_values!, index); } }