diff --git a/ArabicaCliento/Patches/ClientAdminManagerPatch.cs b/ArabicaCliento/Patches/ClientAdminManagerPatch.cs index b2b32e6..40feec8 100644 --- a/ArabicaCliento/Patches/ClientAdminManagerPatch.cs +++ b/ArabicaCliento/Patches/ClientAdminManagerPatch.cs @@ -23,4 +23,11 @@ private static bool Prefix(ref bool __result) __result = true; return false; } + + + [HarmonyFinalizer] + private static void Finalizer(Exception __exception) + { + MarseyLogger.Fatal($"Error while patching ClientAdminManagerPatch: {__exception}"); + } } \ No newline at end of file diff --git a/ArabicaCliento/Patches/ClientConGroupControllerPatch.cs b/ArabicaCliento/Patches/ClientConGroupControllerPatch.cs index a5de71b..0568656 100644 --- a/ArabicaCliento/Patches/ClientConGroupControllerPatch.cs +++ b/ArabicaCliento/Patches/ClientConGroupControllerPatch.cs @@ -25,4 +25,10 @@ private static bool Prefix(ref bool __result) __result = true; return false; } + + [HarmonyFinalizer] + private static void Finalizer(Exception __exception) + { + MarseyLogger.Fatal($"Error while patching ClientConGroupControllerPatch: {__exception}"); + } } \ No newline at end of file diff --git a/ArabicaCliento/Patches/ClientHeavyAttackPatch.cs b/ArabicaCliento/Patches/ClientHeavyAttackPatch.cs index cb1d36d..7d9d5f9 100644 --- a/ArabicaCliento/Patches/ClientHeavyAttackPatch.cs +++ b/ArabicaCliento/Patches/ClientHeavyAttackPatch.cs @@ -8,7 +8,7 @@ namespace ArabicaCliento.Patches; [HarmonyPatch(typeof(MeleeWeaponSystem), "ClientHeavyAttack")] -public class ClientHeavyAttackPatch +internal class ClientHeavyAttackPatch { private static IEntityManager? _entMan; private static TransformSystem? _transform; @@ -30,4 +30,10 @@ private static void Prefix(ref EntityUid user, if (output == null) return; coordinates = _transform.ToCoordinates(coordinates.EntityId, output.Value.Position); } + + [HarmonyFinalizer] + private static void Finalizer(Exception __exception) + { + MarseyLogger.Fatal($"Error while patching ClientHeavyAttackPatch: {__exception}"); + } } \ No newline at end of file diff --git a/ArabicaCliento/Patches/ConsoleHostPatch.cs b/ArabicaCliento/Patches/ConsoleHostPatch.cs index 05b8bb7..982be12 100644 --- a/ArabicaCliento/Patches/ConsoleHostPatch.cs +++ b/ArabicaCliento/Patches/ConsoleHostPatch.cs @@ -3,17 +3,16 @@ namespace ArabicaCliento.Patches; -[HarmonyPatch] +[HarmonyPatch("Robust.Client.Console.ClientConsoleHost", "CanExecute")] internal class ConsoleHostPatch { - [HarmonyTargetMethod] - private static MethodBase TargetMethod() - { - return AccessTools.Method(AccessTools.TypeByName("Robust.Client.Console.ClientConsoleHost"), - "CanExecute"); - - } - [HarmonyPostfix] private static void Postfix(ref bool __result) => __result = true; + + + [HarmonyFinalizer] + private static void Finalizer(Exception __exception) + { + MarseyLogger.Fatal($"Error while patching ConsoleHostPatch: {__exception}"); + } } \ No newline at end of file diff --git a/ArabicaCliento/Patches/DrawOcclusionDepthPatch.cs b/ArabicaCliento/Patches/DrawOcclusionDepthPatch.cs index e1189df..c1367c4 100644 --- a/ArabicaCliento/Patches/DrawOcclusionDepthPatch.cs +++ b/ArabicaCliento/Patches/DrawOcclusionDepthPatch.cs @@ -6,8 +6,14 @@ namespace ArabicaCliento.Patches; internal static class DrawOcclusionDepthPatch { [HarmonyPrefix] - static bool Prefix() + private static bool Prefix() { return !ArabicaConfig.FOVDisable; } + + [HarmonyFinalizer] + private static void Finalizer(Exception __exception) + { + MarseyLogger.Fatal($"Error while patching DrawOcclusionDepthPatch: {__exception}"); + } } \ No newline at end of file diff --git a/ArabicaCliento/Patches/EntityMenuElementPatch.cs b/ArabicaCliento/Patches/EntityMenuElementPatch.cs index 62eae4f..5ac045b 100644 --- a/ArabicaCliento/Patches/EntityMenuElementPatch.cs +++ b/ArabicaCliento/Patches/EntityMenuElementPatch.cs @@ -9,6 +9,7 @@ namespace ArabicaCliento.Patches; internal class EntityMenuElementPatch { private static MethodInfo? _methodCache; + [HarmonyPrefix] private static bool Prefix(EntityUid entity, EntityMenuElement __instance, ref string __result) { @@ -16,4 +17,10 @@ private static bool Prefix(EntityUid entity, EntityMenuElement __instance, ref s __result = _methodCache.Invoke(__instance, [entity]) as string ?? throw new InvalidOperationException(); return false; } + + [HarmonyFinalizer] + private static void Finalizer(Exception __exception) + { + MarseyLogger.Fatal($"Error while patching EntityMenuElementPatch: {__exception}"); + } } \ No newline at end of file diff --git a/ArabicaCliento/Patches/GunUpdatePatch.cs b/ArabicaCliento/Patches/GunUpdatePatch.cs index 3f4d4e5..3811ced 100644 --- a/ArabicaCliento/Patches/GunUpdatePatch.cs +++ b/ArabicaCliento/Patches/GunUpdatePatch.cs @@ -11,7 +11,7 @@ namespace ArabicaCliento.Patches; [HarmonyPatch(typeof(GunSystem), nameof(GunSystem.Update))] -public class GunUpdatePatch +internal class GunUpdatePatch { private static EntityManager? _entMan; private static IInputManager? _input; @@ -57,4 +57,10 @@ private static IEnumerable Transpiler(IEnumerable false; + + [HarmonyFinalizer] + private static void Finalizer(Exception __exception) + { + MarseyLogger.Fatal($"Error while patching MouseRotatorPatch: {__exception}"); + } } \ No newline at end of file diff --git a/ArabicaCliento/Patches/OverlaysPatch.cs b/ArabicaCliento/Patches/OverlaysPatch.cs index cac8051..2d2a42c 100644 --- a/ArabicaCliento/Patches/OverlaysPatch.cs +++ b/ArabicaCliento/Patches/OverlaysPatch.cs @@ -25,4 +25,10 @@ private static bool Prefix() { return !ArabicaConfig.OverlaysDisable; } + + [HarmonyFinalizer] + private static void Finalizer(Exception __exception) + { + MarseyLogger.Fatal($"Error while patching OverlaysPatch: {__exception}"); + } } \ No newline at end of file