report player

This commit is contained in:
D1GQ committed 2024-08-04 06:49:48 -05:00
1 parent 75e550fcca
commit 4c3b5b99e3
2 files changed
+20 -8

No files matched your search

+9 -8
View File
@@ -96,17 +96,19 @@ class AntiCheat
{
if (__instance.Platform is Platforms.StandaloneWin10 or Platforms.Xbox)
{
if (__instance.XboxPlatformId.ToString().Length is < 16 or > 17)
if (__instance.XboxPlatformId.ToString().Length != 16)
{
BetterNotificationManager.NotifyCheat(player, $"Platform Spoofer", newText: "Has been detected with a cheat");
player.ReportPlayer(ReportReasons.Cheating_Hacking);
BetterNotificationManager.NotifyCheat(player, $"Platform Spoofer", newText: "Has been detected with a cheat");
}
}
if (__instance.Platform is Platforms.Playstation)
{
if (__instance.PsnPlatformId.ToString().Length is < 19 or > 20)
if (__instance.PsnPlatformId.ToString().Length != 19)
{
BetterNotificationManager.NotifyCheat(player, $"Platform Spoofer", newText: "Has been detected with a cheat");
player.ReportPlayer(ReportReasons.Cheating_Hacking);
BetterNotificationManager.NotifyCheat(player, $"Platform Spoofer", newText: "Has been detected with a cheat");
}
}
}
@@ -114,7 +116,6 @@ class AntiCheat
}
}
// Handle RPC before anti cheat detection
public static void HandleRPCBeforeCheck(PlayerControl player, byte callId, MessageReader Oldreader)
{
@@ -130,7 +131,7 @@ class AntiCheat
if (reader.BytesRemaining == 0 && !flag)
{
AmongUsClient.Instance.ReportPlayer(player.GetClientId(), ReportReasons.Cheating_Hacking);
player.ReportPlayer(ReportReasons.Cheating_Hacking);
SickoData[Utils.GetHashPuid(player)] = player.FriendCode;
BetterDataManager.SaveCheatData(Utils.GetHashPuid(player), player.Data.FriendCode, player.Data.PlayerName, "sickoData", "Sicko Menu RPC");
BetterNotificationManager.NotifyCheat(player, $"Sicko Menu", newText: "Has been detected with a cheat client");
@@ -152,7 +153,7 @@ class AntiCheat
if (!flag)
{
AmongUsClient.Instance.ReportPlayer(player.GetClientId(), ReportReasons.Cheating_Hacking);
player.ReportPlayer(ReportReasons.Cheating_Hacking);
AUMData[Utils.GetHashPuid(player)] = player.FriendCode;
BetterDataManager.SaveCheatData(Utils.GetHashPuid(player), player.Data.FriendCode, player.Data.PlayerName, "aumData", "AUM RPC");
BetterNotificationManager.NotifyCheat(player, $"AUM", newText: "Has been detected with a cheat client");
@@ -183,7 +184,7 @@ class AntiCheat
if (!flag && !flag2)
{
AmongUsClient.Instance.ReportPlayer(player.GetClientId(), ReportReasons.Cheating_Hacking);
player.ReportPlayer(ReportReasons.Cheating_Hacking);
AUMData[Utils.GetHashPuid(AUMPlayer)] = AUMPlayer.FriendCode;
BetterDataManager.SaveCheatData(Utils.GetHashPuid(player), player.Data.FriendCode, player.Data.PlayerName, "aumData", "AUM Chat RPC");
BetterNotificationManager.NotifyCheat(AUMPlayer, $"AUM", newText: "Has been detected with a cheat client");
+11
View File
@@ -170,4 +170,15 @@ static class ExtendedPlayerControl
// Check if player is the host
public static bool IsHost(this PlayerControl player) => player?.Data != null && GameData.Instance?.GetHost()?.Puid == player.Data.Puid;
// Report player
public static void ReportPlayer(this PlayerControl player, ReportReasons reason = ReportReasons.None)
{
if (player != null)
{
if (!player.GetClient().HasBeenReported)
{
AmongUsClient.Instance.ReportPlayer(player.GetClientId(), reason);
}
}
}
}