mirror of
https://github.com/NuclearPowered/Reactor.git
synced 2026-10-19 15:51:54 +00:00
Don't disable auth server on officials
Since 2023.6.13 official servers went back to using DTLS for auth only
This commit is contained in:
1 file changed
+17
-1
@@ -1,3 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace Reactor.Patches.Miscellaneous;
|
||||
@@ -5,11 +7,25 @@ namespace Reactor.Patches.Miscellaneous;
|
||||
[HarmonyPatch]
|
||||
internal static class CustomServersPatch
|
||||
{
|
||||
private static bool IsCurrentServerOfficial()
|
||||
{
|
||||
const string Domain = "among.us";
|
||||
|
||||
return ServerManager.Instance.CurrentRegion?.TryCast<StaticHttpRegionInfo>() is { } regionInfo &&
|
||||
regionInfo.PingServer.EndsWith(Domain, StringComparison.Ordinal) &&
|
||||
regionInfo.Servers.All(serverInfo => serverInfo.Ip.EndsWith(Domain, StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(AuthManager._CoConnect_d__4), nameof(AuthManager._CoConnect_d__4.MoveNext))]
|
||||
[HarmonyPatch(typeof(AuthManager._CoWaitForNonce_d__6), nameof(AuthManager._CoWaitForNonce_d__6.MoveNext))]
|
||||
[HarmonyPrefix]
|
||||
public static bool DisableAuthServer(out bool __result)
|
||||
public static bool DisableAuthServer(ref bool __result)
|
||||
{
|
||||
if (IsCurrentServerOfficial())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
__result = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user