31 lines
946 B
C#
31 lines
946 B
C#
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 RegistrationPatch
|
|
{
|
|
static PatchTypesResult patchResult = Util.ConfigPreparePatchTypes(
|
|
PatchConfig.RegistrationPatch,
|
|
"Registration patch (to be vetted, might not work)",
|
|
"UnityEngine.PlayerPrefs",
|
|
"GetInt"
|
|
);
|
|
|
|
static bool Prepare() => patchResult.Success;
|
|
|
|
static MethodInfo TargetMethod() => patchResult.Method;
|
|
|
|
static void Postfix(ref string key, ref int defaultValue, ref int __result)
|
|
{
|
|
if (key.StartsWith("IncompleteRegistration-"))
|
|
{
|
|
__result = 0;
|
|
UniversalPatchPlugin.Log.LogInfo("Detour'd IncompleteRegistration pref key");
|
|
}
|
|
}
|
|
}
|
|
} |