forked from zombieb/undead-universal-patch-il2cpp
INTERNAL REWRITE! server configs
This commit is contained in:
33
Patches/PostNameserver.cs
Normal file
33
Patches/PostNameserver.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Reflection;
|
||||
using Il2CppInterop.Runtime;
|
||||
using RecRoom.Async;
|
||||
using undead_universal_patch_il2cpp.Core;
|
||||
using undead_universal_patch_il2cpp.Core.CustomRecNet;
|
||||
|
||||
namespace undead_universal_patch_il2cpp.Patches;
|
||||
|
||||
public class NameserverConnectEventPatch
|
||||
{
|
||||
static PatchTypesResult patchResult = Util.PreparePatchTypes(
|
||||
"Nameserver connect event patch",
|
||||
"RecNet.Core",
|
||||
"ConnectToRecNet"
|
||||
);
|
||||
|
||||
static bool Prepare() => patchResult.Success;
|
||||
|
||||
static MethodBase TargetMethod() => patchResult.Method;
|
||||
|
||||
static void Postfix(ref IPromise __result)
|
||||
{
|
||||
__result.Finally(DelegateSupport.ConvertDelegate<Il2CppSystem.Action>(() =>
|
||||
{
|
||||
if (RecNetInteractions.HasNameserverConnected())
|
||||
{
|
||||
UniversalPatchPlugin.Log.LogInfo("Running post-nameserver actions");
|
||||
foreach (var action in RecNetInteractions.postAuthenticationActions) action();
|
||||
}
|
||||
else Util.ConditionalDebug("The nameserver request did not resolve successfully, skipping post-nameserver actions.");
|
||||
}));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user