mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
ok....
This commit is contained in:
1 parent
e8bcbe77fa
commit
065a158f46
1 file changed
+28
-19
@@ -8,11 +8,6 @@ namespace EHR.Patches;
|
||||
[HarmonyPatch]
|
||||
internal static class CustomServersPatch
|
||||
{
|
||||
public static bool Prepare()
|
||||
{
|
||||
return !OperatingSystem.IsAndroid();
|
||||
}
|
||||
|
||||
private static bool IsCurrentServerOfficial()
|
||||
{
|
||||
const string domain = "among.us";
|
||||
@@ -24,30 +19,44 @@ internal static class CustomServersPatch
|
||||
|
||||
[HarmonyPatch(typeof(AuthManager._CoConnect_d__4), "MoveNext")]
|
||||
[HarmonyPatch(typeof(AuthManager._CoWaitForNonce_d__6), "MoveNext")]
|
||||
[HarmonyPrefix]
|
||||
public static bool DisableAuthServer(ref bool __result)
|
||||
static class DisableAuthServerPatch
|
||||
{
|
||||
if (IsCurrentServerOfficial())
|
||||
public static bool Prepare()
|
||||
{
|
||||
return true;
|
||||
return !OperatingSystem.IsAndroid();
|
||||
}
|
||||
|
||||
public static bool Prefix(ref bool __result)
|
||||
{
|
||||
if (IsCurrentServerOfficial())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
__result = false;
|
||||
return false;
|
||||
__result = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(AmongUsClient._CoJoinOnlinePublicGame_d__49), "MoveNext")]
|
||||
[HarmonyPrefix]
|
||||
public static void EnableUdpMatchmaking(AmongUsClient._CoJoinOnlinePublicGame_d__49 __instance)
|
||||
static class EnableUdpMatchmakingPatch
|
||||
{
|
||||
// Skip to state 1 which just calls CoJoinOnlineGameDirect
|
||||
if (__instance.__1__state == 0 && !ServerManager.Instance.IsHttp)
|
||||
public static bool Prepare()
|
||||
{
|
||||
__instance.__1__state = 1;
|
||||
__instance.__8__1 = new AmongUsClient.__c__DisplayClass49_0
|
||||
return !OperatingSystem.IsAndroid();
|
||||
}
|
||||
|
||||
public static void Prefix(AmongUsClient._CoJoinOnlinePublicGame_d__49 __instance)
|
||||
{
|
||||
// Skip to state 1 which just calls CoJoinOnlineGameDirect
|
||||
if (__instance.__1__state == 0 && !ServerManager.Instance.IsHttp)
|
||||
{
|
||||
matchmakerToken = string.Empty,
|
||||
};
|
||||
__instance.__1__state = 1;
|
||||
__instance.__8__1 = new AmongUsClient.__c__DisplayClass49_0
|
||||
{
|
||||
matchmakerToken = string.Empty,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user