From bb15f7ba3e60604b809258edc89a43d0ee373965 Mon Sep 17 00:00:00 2001 From: Gurge44 Date: Tue, 25 Aug 2026 19:25:09 +0200 Subject: [PATCH] remove auth timeout patch --- Modules/Utils.cs | 2 +- Patches/ClientPatch.cs | 56 ------------------------------------------ 2 files changed, 1 insertion(+), 57 deletions(-) diff --git a/Modules/Utils.cs b/Modules/Utils.cs index e51046a12..caee7725a 100644 --- a/Modules/Utils.cs +++ b/Modules/Utils.cs @@ -5072,7 +5072,7 @@ public static class Utils { name = "AOU-"; - for (var i = 0; i < ip.Length; i++) + for (var i = 8; i < ip.Length; i++) { char c = ip[i]; if (c == '.') break; diff --git a/Patches/ClientPatch.cs b/Patches/ClientPatch.cs index 48a3813ce..1fd18e449 100644 --- a/Patches/ClientPatch.cs +++ b/Patches/ClientPatch.cs @@ -1,10 +1,8 @@ using System; -using System.Reflection; using AmongUs.Data; using EHR.Modules; using HarmonyLib; using Hazel; -using Il2CppInterop.Runtime.InteropTypes; using InnerNet; using TMPro; using UnityEngine; @@ -184,58 +182,4 @@ static class CheckOnlinePermissionsPatch { DataManager.Player.Ban.banPoints = 0f; } -} - -[HarmonyPatch] -internal static class AuthTimeoutPatch -{ - // From Reactor.gg - // https://github.com/NuclearPowered/Reactor/blob/master/Reactor/Patches/Miscellaneous/CustomServersPatch.cs - - [HarmonyPatch(typeof(AuthManager), nameof(AuthManager.CoConnect))] - [HarmonyPrefix] - public static bool CoConnect_Prefix() - { - return GameStates.CurrentServerTypeInCreateMenu is GameStates.ServerType.Vanilla or GameStates.ServerType.Local; - } - - [HarmonyPatch(typeof(AuthManager), nameof(AuthManager.CoWaitForNonce))] - [HarmonyPrefix] - public static bool CoWaitforNonce_Prefix() - { - return GameStates.CurrentServerTypeInCreateMenu is GameStates.ServerType.Vanilla or GameStates.ServerType.Local; - } - - // If you don't patch this, you still need to wait for 5 s. - // I have no idea why this is happening - [HarmonyPatch] - public static class EnableUdpPatch - { - public static MethodBase TargetMethod() - { - return Utils.GetStateMachineMoveNext(nameof(AmongUsClient.CoJoinOnlinePublicGame))!; - } - - public static void Prefix(Il2CppObjectBase __instance) - { - var stateMachine = new StateMachineWrapper(__instance); - - // Skip to state 1 which just calls CoJoinOnlineGameDirect - if (stateMachine.State == 0 && !ServerManager.Instance.IsHttp) - { - stateMachine.State = 1; - var lambdaType = stateMachine.GetParameter("__8__1").GetType(); - var newDisplayClass = Activator.CreateInstance(lambdaType); - if (newDisplayClass == null) - { - throw new InvalidOperationException($"Could not create display class of type '{lambdaType}'."); - } - - var displayClass = new CompilerGeneratedObjectWrapper(newDisplayClass); - displayClass.SetField("matchmakerToken", string.Empty); - - stateMachine.SetParameter("__8__1", newDisplayClass); - } - } - } } \ No newline at end of file