OnLogout, Steam platform auth in account creation. Not configurable to ensure server uses ticket to validate.

This commit is contained in:
2025-09-22 00:24:04 -04:00
parent 4649042ac1
commit 2ff60f8399
7 changed files with 132 additions and 15 deletions

View File

@@ -0,0 +1,30 @@
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using undead_universal_patch_il2cpp.Core;
using undead_universal_patch_il2cpp.Core.Content.CustomRecNet;
namespace undead_universal_patch_il2cpp.Patches.Internals;
[HarmonyPatch]
public static class LogoutEvent
{
static PatchTypesResult typesResult = Util.PreparePatchTypes(
"RecNet logout event patch",
"RecNet.Login",
"OnLogout"
);
static MethodBase TargetMethod() => typesResult.Method;
static bool Prepare() => typesResult.Success;
static void Postfix()
{
Util.ConditionalDebug("Running onLogout actions");
foreach (var action in RecNetInteractions.onLogout) action();
}
}

View File

@@ -0,0 +1,29 @@
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using undead_universal_patch_il2cpp.Core;
using undead_universal_patch_il2cpp.Core.Content.CustomRecNet;
namespace undead_universal_patch_il2cpp.Patches.Internals;
[HarmonyPatch]
public class SteamPlatformManagerEvent
{
static PatchTypesResult typesResult = Util.PreparePatchTypes(
"On SteamPlatformManager.Initialize",
"SteamPlatformManager",
"Initialize"
);
static MethodBase TargetMethod() => typesResult.Method;
static bool Prepare() => typesResult.Success;
static void Postfix()
{
UniversalPatchPlugin.Log.LogInfo("Running post-steam platform initialize actions");
foreach (var action in RecNetInteractions.onPlatformInitialize) action();
}
}

View File

@@ -22,19 +22,13 @@ public class AuthenticationEventPatch
static MethodBase TargetMethod() => patchResult.Method;
private static bool RanPostActions { get; set; } = false;
static void Postfix(ref string accessToken)
{
UniversalPatchPlugin.Log.LogInfo("Intercepted AccessToken");
RecNetInteractions.AccessToken = accessToken;
if (!RanPostActions)
{
bool value = (bool)hasAccessTokenProperty.GetValue(patchResult.Type);
if (value) UniversalPatchPlugin.Log.LogInfo("Running post-authentication actions");
foreach (var action in RecNetInteractions.postAuthenticationActions)
action();
}
else RanPostActions = true;
UniversalPatchPlugin.Log.LogInfo("Running post-authentication actions");
foreach (var action in RecNetInteractions.postAuthenticationActions)
action();
}
}