Browse Source

Upgrade to Harmony pre-2.0 (443f551)

Bepis 5 years ago
parent
commit
451142ee5b

+ 3 - 3
BepInEx.Preloader/RuntimeFixes/TraceFix.cs

@@ -2,12 +2,12 @@
 using System.Diagnostics;
 using System.Linq;
 using System.Reflection;
-using Harmony;
+using HarmonyLib;
 
 namespace BepInEx.Preloader.RuntimeFixes
 {
 	/// <summary>
-	/// This exists because the Mono implementation of <see cref="Trace"/> is/was broken, and would call Write directly instead of calling TraceEvent. This class fixes that with a <see cref="Harmony"/> hook.
+	/// This exists because the Mono implementation of <see cref="Trace"/> is/was broken, and would call Write directly instead of calling TraceEvent. This class fixes that with a <see cref="BepInEx.Harmony"/> hook.
 	/// </summary>
 	internal static class TraceFix
 	{
@@ -35,7 +35,7 @@ namespace BepInEx.Preloader.RuntimeFixes
 			prop_AutoFlush = AccessTools.Property(TraceImplType, "AutoFlush");
 
 
-			HarmonyInstance instance = HarmonyInstance.Create("com.bepis.bepinex.tracefix");
+			HarmonyLib.Harmony instance = new HarmonyLib.Harmony("com.bepis.bepinex.tracefix");
 
 			instance.Patch(
 				typeof(Trace).GetMethod("DoTrace", BindingFlags.Static | BindingFlags.NonPublic),

+ 2 - 2
BepInEx.Preloader/RuntimeFixes/UnityPatches.cs

@@ -2,13 +2,13 @@
 using System.Collections.Generic;
 using System.Reflection;
 using BepInEx.Harmony;
-using Harmony;
+using HarmonyLib;
 
 namespace BepInEx.Preloader.RuntimeFixes
 {
 	internal static class UnityPatches
 	{
-		public static HarmonyInstance HarmonyInstance { get; } = HarmonyInstance.Create("com.bepinex.unitypatches");
+		public static HarmonyLib.Harmony HarmonyInstance { get; } = new HarmonyLib.Harmony("com.bepinex.unitypatches");
 
 		public static Dictionary<string, string> AssemblyLocations { get; } =
 			new Dictionary<string, string>(StringComparer.InvariantCultureIgnoreCase);

+ 1 - 1
submodules/BepInEx.Harmony

@@ -1 +1 @@
-Subproject commit 95863891d65bd3f02338845668ca1cbd26a17362
+Subproject commit e312b4d07326f72bec23d4fd61bbb83fe188bd9c