INTERNAL REWRITE! server configs
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
using undead_universal_patch_il2cpp.Core;
|
||||
using undead_universal_patch_il2cpp.Core.Config;
|
||||
using UnityEngine;
|
||||
|
||||
namespace undead_universal_patch_il2cpp.Patches
|
||||
@@ -8,27 +9,23 @@ namespace undead_universal_patch_il2cpp.Patches
|
||||
[HarmonyPatch]
|
||||
public class ConnectToRecNetPatchEvent
|
||||
{
|
||||
static readonly string TargetTypeName = "RecNet.Core";
|
||||
static readonly string TargetMethodName = "ConnectToRecNet";
|
||||
static readonly string Description = "Hile Patch event method"; // It's convenient. Could patch at a different time. But this part was easy.
|
||||
static PatchTypesResult patchResult = Util.ConfigPreparePatchTypes(
|
||||
PatchConfig.HilePatch,
|
||||
"Hile Patch event method",
|
||||
"RecNet.Core",
|
||||
"ConnectToRecNet"
|
||||
);
|
||||
|
||||
static bool Prepare()
|
||||
{
|
||||
if (AccessTools.Method(AccessTools.TypeByName(TargetTypeName), TargetMethodName) == null)
|
||||
{
|
||||
Plugin.Log.LogWarning($"'{Description}' disabled. The method for this patch was not found.");
|
||||
return false;
|
||||
}
|
||||
static bool Prepare() => patchResult.Success;
|
||||
|
||||
static MethodBase TargetMethod() => patchResult.Method;
|
||||
|
||||
Plugin.Log.LogInfo($"'{Description}' succeeded validation.");
|
||||
return true;
|
||||
}
|
||||
static MethodBase TargetMethod() => AccessTools.Method(AccessTools.TypeByName(TargetTypeName), TargetMethodName);
|
||||
static void Prefix()
|
||||
{
|
||||
if (GenericConfig.HilePatch.Value) HilePatch.Patch();
|
||||
if (PatchConfig.HilePatch.Value) HilePatch.Patch();
|
||||
}
|
||||
}
|
||||
|
||||
public static class HilePatch
|
||||
{
|
||||
public static void Patch()
|
||||
@@ -51,7 +48,7 @@ namespace undead_universal_patch_il2cpp.Patches
|
||||
"winhttp.dll"
|
||||
]));
|
||||
|
||||
Plugin.Log.LogInfo("Hile patch succeeded.");
|
||||
UniversalPatchPlugin.Log.LogInfo("Hile patch succeeded.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user