forked from zombieb/undead-universal-patch-il2cpp
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:
32
Patches/Internals/PostGetMyAccount.cs
Normal file
32
Patches/Internals/PostGetMyAccount.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Reflection;
|
||||
using BestHTTP;
|
||||
using HarmonyLib;
|
||||
using Il2CppInterop.Runtime;
|
||||
using RecRoom.Async;
|
||||
using undead_universal_patch_il2cpp.Core;
|
||||
using undead_universal_patch_il2cpp.Core.Content.CustomRecNet;
|
||||
|
||||
namespace undead_universal_patch_il2cpp.Patches.Internals;
|
||||
|
||||
[HarmonyPatch]
|
||||
public class GetMyAccountEventPatch
|
||||
{
|
||||
static PatchTypesResult patchResult = Util.PreparePatchTypes(
|
||||
"RecNet GetLocalAccount event patch",
|
||||
"RecNet.Accounts",
|
||||
"GetLocalAccount"
|
||||
);
|
||||
|
||||
static bool Prepare() => patchResult.Success;
|
||||
|
||||
static MethodBase TargetMethod() => patchResult.Method;
|
||||
|
||||
static void Postfix(ref IPromise<RecNet.SelfAccount> __result)
|
||||
{
|
||||
__result.Then(DelegateSupport.ConvertDelegate<Il2CppSystem.Action>(() =>
|
||||
{
|
||||
UniversalPatchPlugin.Log.LogInfo("Running post-GetLocalAccount actions");
|
||||
foreach (var action in RecNetInteractions.postLocalAccountActions) action();
|
||||
}));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user