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:
19
Core/Util.cs
19
Core/Util.cs
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user