From 0a03a9d90d41b3bb158fa95bb23186f6769e0f9f Mon Sep 17 00:00:00 2001 From: js6pak Date: Fri, 3 Jun 2022 21:49:56 +0200 Subject: [PATCH] Fix udp matchmaking --- Reactor/Patches/CustomServersPatch.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Reactor/Patches/CustomServersPatch.cs b/Reactor/Patches/CustomServersPatch.cs index 2fe000b..8f1a261 100644 --- a/Reactor/Patches/CustomServersPatch.cs +++ b/Reactor/Patches/CustomServersPatch.cs @@ -13,5 +13,20 @@ namespace Reactor.Patches __result = false; return false; } + + [HarmonyPatch(typeof(AmongUsClient._CoJoinOnlinePublicGame_d__1), nameof(AmongUsClient._CoJoinOnlinePublicGame_d__1.MoveNext))] + [HarmonyPrefix] + public static void EnableUdpMatchmakingPatch(AmongUsClient._CoJoinOnlinePublicGame_d__1 __instance) + { + // Skip to state 1 which just calls CoJoinOnlineGameDirect + if (__instance.__1__state == 0 && !ServerManager.Instance.IsHttp) + { + __instance.__1__state = 1; + __instance.__8__1 = new AmongUsClient.__c__DisplayClass1_0 + { + matchmakerToken = string.Empty, + }; + } + } } }