INTERNAL REWRITE! server configs

This commit is contained in:
2025-08-12 03:10:25 -04:00
parent 1c51b37a7c
commit 7fc0d6c5b0
23 changed files with 645 additions and 564 deletions

View File

@@ -1,30 +1,26 @@
using System.Reflection;
using HarmonyLib;
using undead_universal_patch_il2cpp.Core;
using undead_universal_patch_il2cpp.Core.Config;
namespace undead_universal_patch_il2cpp.Patches;
[HarmonyPatch]
public class AFKPatch
{
static readonly string TargetTypeName = "Player";
static readonly string TargetMethodName = "UpdateAFKStatus";
static readonly string Description = "Always present, never AFK";
static PatchTypesResult patchResult = Util.ConfigPreparePatchTypes(
PatchConfig.AFKPatch,
"Always present, never AFK",
"Player",
"UpdateAFKStatus"
);
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(ref bool userIsPresent)
{
if (GenericConfig.AFKPatch.Value) userIsPresent = true;
if (PatchConfig.AFKPatch.Value) userIsPresent = true;
}
}