zz
This commit is contained in:
27
GlobalShared/Patching/PatchHelpers.cs
Normal file
27
GlobalShared/Patching/PatchHelpers.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Global.Shared.Logging;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace Global.Shared.Patching
|
||||
{
|
||||
public static class PatchHelpers
|
||||
{
|
||||
public static bool PatchAll(IPluginLogger log, Harmony harmony)
|
||||
{
|
||||
log.Info("Applying patches...");
|
||||
|
||||
try
|
||||
{
|
||||
harmony.PatchAll(Assembly.GetCallingAssembly());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Critical(ex, "Failed to apply patches!");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user