Internals rewritten. PHoton config can now be fetched from the server, and if it fails, fallback to the local configuration.

This commit is contained in:
2025-08-16 21:04:26 -04:00
parent 8ca37170e4
commit 087d9a900e
20 changed files with 393 additions and 234 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using BepInEx.Configuration;
using CodeStage.AntiCheat.ObscuredTypes;
using HarmonyLib;
using undead_universal_patch_il2cpp.Core.Config;
@@ -16,6 +17,22 @@ namespace undead_universal_patch_il2cpp.Core
public bool Success;
}
public class RecNetUtil
{
public static ObscuredInt GetAccountId()
{
PropertyInfo selfAccountProp = AccessTools.Property("RecNet.Accounts:LocalAccount");
object acc = selfAccountProp.GetValue(null);
Type selfAccountType = acc.GetType();
PropertyInfo accountIdProp = AccessTools.Property(selfAccountType, "AccountId");
ObscuredInt val = (ObscuredInt)accountIdProp.GetValue(acc);
return val;
}
}
public class Util
{
private static readonly PatchTypesResult UnsuccessfulPatchResult = new()
@@ -25,8 +42,6 @@ namespace undead_universal_patch_il2cpp.Core
Success = false
};
public static string LocalInstanceGuid { set; get; }
public static void ConditionalDebug(string msg)
{
if (GenericConfig.PatchDebug.Value) UniversalPatchPlugin.Log.LogDebug(msg);