No longer trust host BAU users

This commit is contained in:
D1GQ committed 2026-01-09 01:49:43 -06:00
1 parent 3900add575
commit b2cae7378a
2 files changed
+2 -5

No files matched your search

+2 -2
View File
@@ -124,7 +124,7 @@ internal static class BetterAntiCheat
internal static void CheckRPC(PlayerControl player, byte callId, MessageReader oldReader)
{
if (player == null || player?.Data == null) return;
if (!IsEnabled || !BAUPlugin.AntiCheat.Value || (GameState.IsBetterHostLobby && !GameState.IsHost) || !BetterGameSettings.DetectInvalidRPCs.GetBool()) return;
if (!IsEnabled || !BAUPlugin.AntiCheat.Value || !BetterGameSettings.DetectInvalidRPCs.GetBool()) return;
if (player.IsLocalPlayer() && player.IsHost()) return;
MessageReader reader = MessageReader.Get(oldReader);
@@ -138,7 +138,7 @@ internal static class BetterAntiCheat
try
{
if (player == null || player?.Data == null) return true;
if (!IsEnabled || !BAUPlugin.AntiCheat.Value || (GameState.IsBetterHostLobby && !GameState.IsHost) || !BetterGameSettings.DetectInvalidRPCs.GetBool()) return true;
if (!IsEnabled || !BAUPlugin.AntiCheat.Value || !BetterGameSettings.DetectInvalidRPCs.GetBool()) return true;
if (player.IsLocalPlayer() && player.IsHost()) return true;
MessageReader reader = MessageReader.Get(oldReader);
-3
View File
@@ -1,6 +1,4 @@
using AmongUs.GameOptions;
using BetterAmongUs.Helpers;
using BetterAmongUs.Mono;
namespace BetterAmongUs.Modules;
@@ -105,7 +103,6 @@ internal static class GameState
internal static bool IsShip => ShipStatus.Instance != null;
internal static bool IsHost => AmongUsClient.Instance != null && AmongUsClient.Instance.AmHost;
internal static bool IsPrivateOnlyLobby => (BAUPlugin.PrivateOnlyLobby.Value || AmongUsClient.Instance.AmLocalHost) && IsHost;
internal static bool IsBetterHostLobby => PlayerControl.LocalPlayer?.IsHost() == true || BAUPlugin.AllPlayerControls.Any(pc => pc?.BetterData() != null && pc.IsHost() && pc.BetterData().IsBetterUser && pc.BetterData().IsVerifiedBetterUser);
internal static bool IsCanMove => PlayerControl.LocalPlayer?.CanMove is true;
internal static bool IsDead => PlayerControl.LocalPlayer?.Data?.IsDead is true;
}