Skip to content

Commit

Permalink
Merge pull request #41 from BUTR/dev
Browse files Browse the repository at this point in the history
v1.3.3
  • Loading branch information
Aragas authored Apr 15, 2023
2 parents 71f5530 + d221ad7 commit 85baed2
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<!--Development Variables-->
<PropertyGroup>
<Version>1.3.2</Version>
<Version>1.3.3</Version>
<HarmonyVersion>2.2.2</HarmonyVersion>
<BUTRSharedVersion>3.0.0.136</BUTRSharedVersion>
<BUTRModuleManagerVersion>5.0.198</BUTRModuleManagerVersion>
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---------------------------------------------------------------------------------------------------
Version: 1.3.3
Game Versions: v1.0.0,v1.0.1,v1.0.2,v1.0.3,v1.1.0,v1.1.1,v1.1.2
* Xbox version CTD fix
---------------------------------------------------------------------------------------------------
Version: 1.3.2
Game Versions: v1.0.0,v1.0.1,v1.0.2,v1.0.3,v1.1.0,v1.1.1,v1.1.2
* Added EnableDPIScaling setting to remove DPI scaling on high resolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public static void Launch(string[] args)
// Catch AccessViolation. .NET Core 3.1 still allows that
Environment.SetEnvironmentVariable("COMPlus_legacyCorruptedStateExceptionsPolicy", "1");

// TODO: Remove once Lib.Harmony v2.3 is out
// Disable aggressive inlining of JIT by disabling JIT Tiered Compilation
Environment.SetEnvironmentVariable("COMPlus_TieredCompilation", "0");

Expand Down
6 changes: 3 additions & 3 deletions src/Bannerlord.BLSE.Shared/ModuleInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ At least v2.2.2.x is required!
var assemblyFile = ResolveHarmonyAssembliesFile(assemblyName);
if (string.IsNullOrEmpty(assemblyFile))
return null;

var harmony = Assembly.ReflectionOnlyLoadFrom(assemblyFile);
if (harmony.GetName().Version < new Version(2, 2, 2, 0))

if (ReflectionParser.GetAssemblyVersion(assemblyFile) < new Version(2, 2, 2, 0))
{
MessageBoxDialog.Show(@"The Harmony module is corrupted!
Wrong 0Harmony.dll version! At least v2.2.2.x is required!
Expand Down
16 changes: 16 additions & 0 deletions src/Bannerlord.BLSE.Shared/Utils/ReflectionParser.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Mono.Cecil;

using System;

namespace Bannerlord.BLSE.Shared.Utils
{
public static class ReflectionParser
{
public static Version GetAssemblyVersion(string? path)
{
if (path is null) return new Version();
var assemblyDefinition = AssemblyDefinition.ReadAssembly(path);
return assemblyDefinition.Name.Version;
}
}
}

0 comments on commit 85baed2

Please sign in to comment.