This commit is contained in:
D1GQ committed 2024-10-26 15:37:32 -05:00
1 parent 534caed6dd
commit 4f7860fd93
6 files changed
+59 -15

No files matched your search

+18 -1
View File
@@ -11,6 +11,7 @@ class AntiCheat
public static Dictionary<string, string> PlayerData = []; // HashPuid, FriendCode
public static Dictionary<string, string> SickoData = []; // HashPuid, FriendCode
public static Dictionary<string, string> AUMData = []; // HashPuid, FriendCode
public static Dictionary<string, string> KNData = []; // HashPuid, FriendCode
private static bool IsEnabled = true;
public static void Update()
@@ -204,7 +205,23 @@ class AntiCheat
return;
}
if (callId is unchecked((byte)CustomRPC.Killnetwork) && Main.AntiCheat.Value && BetterGameSettings.DetectCheatClients.GetBool())
{
var flag = KNData.ContainsKey(Utils.GetHashPuid(player));
if (!flag)
{
player.ReportPlayer(ReportReasons.Cheating_Hacking);
KNData[Utils.GetHashPuid(player)] = player.Data.FriendCode;
BetterDataManager.SaveCheatData(Utils.GetHashPuid(player), player.Data.FriendCode, player.Data.PlayerName, "knData", "KN RPC");
BetterNotificationManager.NotifyCheat(player, Translator.GetString("AntiCheat.Cheat.KN"), Translator.GetString("AntiCheat.HasBeenDetectedWithCheat2"));
}
return;
}
}
// Check and notify for invalid rpcs
public static void CheckRPC(PlayerControl player, byte callId, MessageReader Oldreader)
{
@@ -563,7 +580,7 @@ class AntiCheat
return false;
}
if (callId is (byte)RpcCalls.StartMeeting)
if (callId is (byte)RpcCalls.StartMeeting or (byte)RpcCalls.ReportDeadBody)
{
if (GameStates.IsMeeting && MeetingHudUpdatePatch.timeOpen > 0.5f || GameStates.IsHideNSeek || !player.IsAlive() || player.IsInVent() || player.shapeshifting
|| player.inMovingPlat || player.onLadder || player.MyPhysics.Animations.IsPlayingAnyLadderAnimation())
+23 -10
View File
@@ -61,12 +61,13 @@ class BetterDataManager
{
// Initialize with predefined categories
var initialData = new Dictionary<string, Dictionary<string, Dictionary<string, string>>>
{
{ "Data", new Dictionary<string, Dictionary<string, string>>() }, // Default category
{ "cheatData", new Dictionary<string, Dictionary<string, string>>() },
{ "sickoData", new Dictionary<string, Dictionary<string, string>>() },
{ "aumData", new Dictionary<string, Dictionary<string, string>>() }
};
{
{ "Data", new Dictionary<string, Dictionary<string, string>>() }, // Default category
{ "cheatData", new Dictionary<string, Dictionary<string, string>>() },
{ "sickoData", new Dictionary<string, Dictionary<string, string>>() },
{ "aumData", new Dictionary<string, Dictionary<string, string>>() },
{ "knData", new Dictionary<string, Dictionary<string, string>>() }
};
string json = JsonSerializer.Serialize(initialData, new JsonSerializerOptions { WriteIndented = true });
File.WriteAllText(filePath, json);
@@ -94,19 +95,23 @@ class BetterDataManager
// Check and add missing categories
if (!jsonData.ContainsKey("Data"))
{
jsonData["Data"] = new Dictionary<string, Dictionary<string, string>>();
jsonData["Data"] = [];
}
if (!jsonData.ContainsKey("cheatData"))
{
jsonData["cheatData"] = new Dictionary<string, Dictionary<string, string>>();
jsonData["cheatData"] = [];
}
if (!jsonData.ContainsKey("sickoData"))
{
jsonData["sickoData"] = new Dictionary<string, Dictionary<string, string>>();
jsonData["sickoData"] = [];
}
if (!jsonData.ContainsKey("aumData"))
{
jsonData["aumData"] = new Dictionary<string, Dictionary<string, string>>();
jsonData["aumData"] = [];
}
if (!jsonData.ContainsKey("knData"))
{
jsonData["knData"] = [];
}
// Write the updated JSON data back to the file
@@ -468,6 +473,14 @@ class BetterDataManager
AntiCheat.AUMData[item.Value["HashPUID"]] = item.Value["FriendCode"];
}
}
if (jsonData.ContainsKey("knData"))
{
foreach (var item in jsonData["knData"])
{
AntiCheat.KNData[item.Value["HashPUID"]] = item.Value["FriendCode"];
}
}
}
}
catch (Exception ex)
+1
View File
@@ -10,6 +10,7 @@ enum CustomRPC : int
Sicko = 420, // Results in 164
AUM = 42069, // Results in 85
AUMChat = 101,
Killnetwork = 250,
// TOHE
VersionCheck = 80,
+5 -3
View File
@@ -124,11 +124,13 @@ class MeetingHudUpdatePatch
// Put +++ at the end of each tag
if (!string.IsNullOrEmpty(hashPuid) && AntiCheat.SickoData.ContainsKey(hashPuid) || !string.IsNullOrEmpty(friendCode) && AntiCheat.SickoData.ContainsValue(friendCode))
sbTag.Append("<color=#00f583>Sicko User</color>+++");
sbTag.Append($"<color=#00f583>{Translator.GetString("Player.SickoUser")}</color>+++");
else if (!string.IsNullOrEmpty(hashPuid) && AntiCheat.AUMData.ContainsKey(hashPuid) || !string.IsNullOrEmpty(friendCode) && AntiCheat.AUMData.ContainsValue(friendCode))
sbTag.Append("<color=#4f0000>AUM User</color>+++");
sbTag.Append($"<color=#4f0000>{Translator.GetString("Player.AUMUser")}</color>+++");
else if (!string.IsNullOrEmpty(hashPuid) && AntiCheat.KNData.ContainsKey(hashPuid) || !string.IsNullOrEmpty(friendCode) && AntiCheat.KNData.ContainsValue(friendCode))
sbTag.Append($"<color=#4f0000>{Translator.GetString("Player.KNUser")}</color>+++");
else if (!string.IsNullOrEmpty(hashPuid) && AntiCheat.PlayerData.ContainsKey(hashPuid) || !string.IsNullOrEmpty(friendCode) && AntiCheat.PlayerData.ContainsValue(friendCode))
sbTag.Append("<color=#fc0000>Known Cheater</color>+++");
sbTag.Append($"<color=#fc0000>{Translator.GetString("Player.KnownCheater")}</color>+++");
for (int i = 0; i < sbTag.ToString().Split("+++").Length; i++)
{
+9 -1
View File
@@ -151,6 +151,13 @@ class PlayerControlPatch
player.SetOutlineByHex(true, "#4f0000");
}
else if (!string.IsNullOrEmpty(hashPuid) && hashPuid.Length > 0 && AntiCheat.KNData.ContainsKey(hashPuid)
|| !string.IsNullOrEmpty(friendCode) && friendCode.Length > 0 && AntiCheat.KNData.ContainsValue(friendCode))
{
sbTag.Append($"<color=#8731e7>{Translator.GetString("Player.KNUser")}</color>+++");
player.SetOutlineByHex(true, "#8731e7");
}
else if (!string.IsNullOrEmpty(hashPuid) && hashPuid.Length > 0 && AntiCheat.PlayerData.ContainsKey(hashPuid)
|| !string.IsNullOrEmpty(friendCode) && friendCode.Length > 0 && AntiCheat.PlayerData.ContainsValue(friendCode))
{
@@ -161,7 +168,8 @@ class PlayerControlPatch
else
{
var color = player.cosmetics.currentBodySprite.BodySprite.material.GetColor("_OutlineColor");
if (color == Utils.HexToColor32("#00f583") || color == Utils.HexToColor32("#4f0000") || color == Utils.HexToColor32("#fc0000"))
if (color == Utils.HexToColor32("#00f583") || color == Utils.HexToColor32("#4f0000")
|| color == Utils.HexToColor32("#8731e7") || color == Utils.HexToColor32("#fc0000"))
{
player.SetOutline(false, null);
}
+3
View File
@@ -25,6 +25,7 @@
"Player.BetterHost": "Better Host",
"Player.SickoUser": "Sicko User",
"Player.AUMUser": "AUM User",
"Player.KNUser": "KN User",
"Player.KnownCheater": "Known Cheater",
"DisconnectReason.Left": "{0} Left the game!",
@@ -114,10 +115,12 @@
"AntiCheat.TryBanExploit": "Attempted To Ban Exploit",
"AntiCheat.Cheat.Sicko": "Sicko Menu",
"AntiCheat.Cheat.AUM": "AUM",
"AntiCheat.Cheat.KN": "Kill Network",
"AntiCheat.Reason.InvalidFriendCode": "Invalid Friend Code",
"AntiCheat.Reason.PlatformSpoofer": "Platform Spoofer",
"AntiCheat.Reason.SickoMenuUser": "Known Sicko User",
"AntiCheat.Reason.AUMUser": "Known AUM User",
"AntiCheat.Reason.KNUser": "Known KN User",
"AntiCheat.Reason.KnownCheater": "Known Cheater",
"GameSummary": "Game Summary",