Browse Source

A potential error in System.Guid.NewGuid is now caught instead of bubbling up to the error handler

pull/62/head
Anairkoen Schno 3 years ago
parent
commit
078ff43f92
Signed by: DaNike GPG Key ID: BEFB74D5F3FC4387
3 changed files with 15 additions and 6 deletions
  1. +1
    -1
      IPA.Injector/Injector.cs
  2. +14
    -5
      IPA.Loader/Logging/StdoutInterceptor.cs
  3. BIN
      Refs/UnityEngine.CoreModule.Net4.dll

+ 1
- 1
IPA.Injector/Injector.cs View File

@ -86,7 +86,7 @@ namespace IPA.Injector
CriticalSection.Configure();
injector.Debug("Prepping bootstrapper");
// updates backup
InstallBootstrapPatch();


+ 14
- 5
IPA.Loader/Logging/StdoutInterceptor.cs View File

@ -124,12 +124,21 @@ namespace IPA.Logging
var setFg = foregroundProperty?.GetSetMethod();
var getFg = foregroundProperty?.GetGetMethod();
if (resetColor != null)
harmony.Patch(resetColor, transpiler: new HarmonyMethod(typeof(ConsoleHarmonyPatches), nameof(PatchResetColor)));
if (foregroundProperty != null)
try
{
harmony.Patch(setFg, transpiler: new HarmonyMethod(typeof(ConsoleHarmonyPatches), nameof(PatchSetForegroundColor)));
harmony.Patch(getFg, transpiler: new HarmonyMethod(typeof(ConsoleHarmonyPatches), nameof(PatchGetForegroundColor)));
if (resetColor != null)
harmony.Patch(resetColor, transpiler: new HarmonyMethod(typeof(ConsoleHarmonyPatches), nameof(PatchResetColor)));
if (foregroundProperty != null)
{
harmony.Patch(setFg, transpiler: new HarmonyMethod(typeof(ConsoleHarmonyPatches), nameof(PatchSetForegroundColor)));
harmony.Patch(getFg, transpiler: new HarmonyMethod(typeof(ConsoleHarmonyPatches), nameof(PatchGetForegroundColor)));
}
}
catch (Exception e)
{
// Harmony might be fucked because of wierdness in Guid.NewGuid, don't let that kill us
Logger.log.Error("Error installing harmony patches to intercept Console color properties:");
Logger.log.Error(e);
}
}


BIN
Refs/UnityEngine.CoreModule.Net4.dll View File


Loading…
Cancel
Save