From a92446591980703d7380efbc87fae1824eb03b59 Mon Sep 17 00:00:00 2001 From: zombieb Date: Fri, 19 Sep 2025 22:37:22 -0400 Subject: [PATCH] refresh token fix --- Core/Config/Config.cs | 2 ++ Core/Init.cs | 15 +++++++++------ Patches/RefreshTokenFix.cs | 27 +++++++++++++++++++++++++++ Plugin.cs | 2 +- undead-universal-patch-il2cpp.csproj | 2 +- 5 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 Patches/RefreshTokenFix.cs diff --git a/Core/Config/Config.cs b/Core/Config/Config.cs index 127b5fe..2fe1921 100644 --- a/Core/Config/Config.cs +++ b/Core/Config/Config.cs @@ -22,6 +22,7 @@ namespace undead_universal_patch_il2cpp.Core.Config public static ConfigEntry ImageSignaturePatch; public static ConfigEntry RegistrationPatch; public static ConfigEntry AFKPatch; + public static ConfigEntry RefreshTokenFix; } public static class PatchConfigDefaults { @@ -31,6 +32,7 @@ namespace undead_universal_patch_il2cpp.Core.Config public static bool ImageSignaturePatch = false; public static bool RegistrationPatch = false; public static bool AFKPatch = false; + public static bool RefreshTokenFix = false; } public static class ServerPatchesConfig { diff --git a/Core/Init.cs b/Core/Init.cs index 21dc13d..89b2cc5 100644 --- a/Core/Init.cs +++ b/Core/Init.cs @@ -74,20 +74,23 @@ public class Initialization "Log all BestHTTP requests sent by the game."); GenericConfig.VerboseRequestLogs = UniversalPatchPlugin.Instance.Config.Bind("Generic", "VerboseRequestLogs", GenericConfigDefaults.VerboseRequestLogs, "Add additional request information to BestHTTPProxy logs. Requires LogAllRequest to be enabled."); - PatchConfig.CertificatePatch = UniversalPatchPlugin.Instance.Config.Bind("Generic", "CertificatePatch", PatchConfigDefaults.CertificatePatch, + PatchConfig.CertificatePatch = UniversalPatchPlugin.Instance.Config.Bind("Patches", "CertificatePatch", PatchConfigDefaults.CertificatePatch, "The game expects a certain certificate from rec.net when making HTTPS requests. Enable this to allow any valid certificate."); - PatchConfig.HilePatch = UniversalPatchPlugin.Instance.Config.Bind("Generic", "HilePatch", PatchConfigDefaults.HilePatch, + PatchConfig.HilePatch = UniversalPatchPlugin.Instance.Config.Bind("Patches", "HilePatch", PatchConfigDefaults.HilePatch, "The game will close after a short period of time if BepInEx is found. Enable to stop this from happening." + "\nThis will also enable the AGRoomRuntimeConfig patch. See the README for more info."); - PatchConfig.SignalRHandshakeFix = UniversalPatchPlugin.Instance.Config.Bind("Generic", "SignalRHandshakeFix", PatchConfigDefaults.SignalRHandshakeFix, + PatchConfig.SignalRHandshakeFix = UniversalPatchPlugin.Instance.Config.Bind("Patches", "SignalRHandshakeFix", PatchConfigDefaults.SignalRHandshakeFix, "Replace apostrophes with quotes in the initial SignalR handshake."); - PatchConfig.ImageSignaturePatch = UniversalPatchPlugin.Instance.Config.Bind("Generic", "ImageSignaturePatch", PatchConfigDefaults.ImageSignaturePatch, + PatchConfig.ImageSignaturePatch = UniversalPatchPlugin.Instance.Config.Bind("Patches", "ImageSignaturePatch", PatchConfigDefaults.ImageSignaturePatch, "When enabled, all image signatures will be valid." + "\nWorks only if the server appends a properly formatted signature header (signature does not need to be valid)"); - PatchConfig.RegistrationPatch = UniversalPatchPlugin.Instance.Config.Bind("Generic", "RegistrationPatch", PatchConfigDefaults.RegistrationPatch, + PatchConfig.RegistrationPatch = UniversalPatchPlugin.Instance.Config.Bind("Patches", "RegistrationPatch", PatchConfigDefaults.RegistrationPatch, "Always disable the registration prompt."); - PatchConfig.AFKPatch = UniversalPatchPlugin.Instance.Config.Bind("Generic", "AFKPatch", PatchConfigDefaults.AFKPatch, + PatchConfig.AFKPatch = UniversalPatchPlugin.Instance.Config.Bind("Patches", "AFKPatch", PatchConfigDefaults.AFKPatch, "Always present patch. Never get kicked to dorm for being AFK."); + PatchConfig.RefreshTokenFix = UniversalPatchPlugin.Instance.Config.Bind("Patches", "RefreshTokenFix", PatchConfigDefaults.RefreshTokenFix, + "Fix for the game needlessly requesting a refresh token in a loop. Cause for this issue is unknown." + + "\nDon't enable unless you know what this does."); ServerPatchesConfig.CustomEmotes = UniversalPatchPlugin.Instance.Config.Bind("ServerPatches", "CustomEmotes", ServerPatchesConfigDefaults.CustomEmotes, "Modify the game's emote text with a configuration from the server."); diff --git a/Patches/RefreshTokenFix.cs b/Patches/RefreshTokenFix.cs new file mode 100644 index 0000000..c43a7f5 --- /dev/null +++ b/Patches/RefreshTokenFix.cs @@ -0,0 +1,27 @@ +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.Config; + +namespace undead_universal_patch_il2cpp.Patches; + +[HarmonyPatch] +public class RefreshTokenFix +{ + static PatchTypesResult patchResult = Util.ConfigPreparePatchTypes( + PatchConfig.RefreshTokenFix, + "Refresh token implementation fix for some servers", + "RecNet.Login", + "OnLocalAccountUpdated" + ); + + static MethodBase TargetMethod() => patchResult.Method; + static bool Prepare() => patchResult.Success; + + static bool Prefix() => false; +} \ No newline at end of file diff --git a/Plugin.cs b/Plugin.cs index 8486997..f5ad90c 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -6,7 +6,7 @@ using undead_universal_patch_il2cpp.Core; namespace undead_universal_patch_il2cpp; -[BepInPlugin("dev.proxnet.recroom.universalpatch.noneac.il2cpp", "Undead Universal Patch", "2.2.0")] +[BepInPlugin("dev.proxnet.recroom.universalpatch.noneac.il2cpp", "Undead Universal Patch", "3.0.0")] public class UniversalPatchPlugin : BasePlugin { public static new readonly ManualLogSource Log = Logger.CreateLogSource("UUPatch"); diff --git a/undead-universal-patch-il2cpp.csproj b/undead-universal-patch-il2cpp.csproj index 06face2..8297554 100644 --- a/undead-universal-patch-il2cpp.csproj +++ b/undead-universal-patch-il2cpp.csproj @@ -4,7 +4,7 @@ net6.0 undead_universal_patch_il2cpp Non-EAC, IL2CPP build patcher for Rec Room (Late 2018*-*April 2020) - 2.2.0 + 3.0.0 true latest