From f0f8a9f208d765018ddff5700f6daaad0a06b033 Mon Sep 17 00:00:00 2001 From: Matt Haynie Date: Mon, 8 Jun 2020 22:54:42 -0700 Subject: [PATCH] Prevented players from kicking themselves. --- tf2_bot_detector/ModeratorLogic.cpp | 3 ++ tf2_bot_detector/WorldState.cpp | 39 ++++++++++------- tf2_bot_detector/WorldState.h | 2 +- tf2_bot_detector/cfg/playerlist.official.json | 42 +++++++++++++++++++ 4 files changed, 69 insertions(+), 17 deletions(-) diff --git a/tf2_bot_detector/ModeratorLogic.cpp b/tf2_bot_detector/ModeratorLogic.cpp index d30de068..af78a274 100644 --- a/tf2_bot_detector/ModeratorLogic.cpp +++ b/tf2_bot_detector/ModeratorLogic.cpp @@ -126,6 +126,9 @@ void ModeratorLogic::HandleFriendlyCheaters(uint8_t friendlyPlayerCount, const s // Votekick the first one that is actually connected for (const IPlayer* cheater : friendlyCheaters) { + if (cheater->GetSteamID() == m_Settings->m_LocalSteamID) + continue; + if (cheater->GetConnectionState() == PlayerStatusState::Active) { if (InitiateVotekick(*cheater, KickReason::Cheating)) diff --git a/tf2_bot_detector/WorldState.cpp b/tf2_bot_detector/WorldState.cpp index 083b4b21..9f43d8fc 100644 --- a/tf2_bot_detector/WorldState.cpp +++ b/tf2_bot_detector/WorldState.cpp @@ -853,22 +853,29 @@ std::pair WorldState::RandomizeChatWrappers(const std: // http://emptycharacter.com/ static constexpr const char8_t* WRAP_CHARS[] = { - u8"\u0020", - u8"\u00A0", - u8"\u2000", - u8"\u2001", - u8"\u2002", - u8"\u2003", - u8"\u2004", - u8"\u2005", - u8"\u2006", - u8"\u2007", - u8"\u2008", - u8"\u2009", - u8"\u200A", - //u8"\u2028", - u8"\u205F", - u8"\u3000", + //u8"\u0020", + //u8"\u00A0", + //u8"\u2000", + //u8"\u2001", + //u8"\u2002", + //u8"\u2003", + //u8"\u2004", + //u8"\u2005", + //u8"\u2006", + //u8"\u2007", + //u8"\u2008", + //u8"\u2009", + //u8"\u200A", + ////u8"\u2028", + //u8"\u205F", + //u8"\u3000", + //u8"\uFEFF", + + //u8"\u180E", + u8"\u200B", + u8"\u200C", + u8"\u200D", + u8"\u2060", }; const auto GenerateCharSequence = [&](std::string& narrow, std::u16string& wide, int offset) diff --git a/tf2_bot_detector/WorldState.h b/tf2_bot_detector/WorldState.h index d93f66ab..5d08b82d 100644 --- a/tf2_bot_detector/WorldState.h +++ b/tf2_bot_detector/WorldState.h @@ -98,7 +98,7 @@ namespace tf2_bot_detector void OnConsoleLineParsed(WorldState& world, IConsoleLine& parsed) override; - static std::pair RandomizeChatWrappers(const std::filesystem::path& tfdir, size_t wrapChars = 8); + static std::pair RandomizeChatWrappers(const std::filesystem::path& tfdir, size_t wrapChars = 16); std::pair m_ChatMsgWrappers; void TrySnapshot(bool& snapshotUpdated); diff --git a/tf2_bot_detector/cfg/playerlist.official.json b/tf2_bot_detector/cfg/playerlist.official.json index 242875f4..a571b32f 100644 --- a/tf2_bot_detector/cfg/playerlist.official.json +++ b/tf2_bot_detector/cfg/playerlist.official.json @@ -1108,6 +1108,16 @@ ], "steamid": "[U:1:1087390094]" }, + { + "attributes": [ + "cheater" + ], + "last_seen": { + "player_name": "pazer", + "time": 1591678944 + }, + "steamid": "[U:1:1087394410]" + }, { "attributes": [ "cheater" @@ -1347,6 +1357,16 @@ }, "steamid": "[U:1:1093844463]" }, + { + "attributes": [ + "cheater" + ], + "last_seen": { + "player_name": "N bomb", + "time": 1591680349 + }, + "steamid": "[U:1:1094342572]" + }, { "attributes": [ "cheater" @@ -2088,6 +2108,17 @@ }, "steamid": "[U:1:1104070775]" }, + { + "attributes": [ + "cheater", + "racist" + ], + "last_seen": { + "player_name": "[g0tb0t]CoonSlayer", + "time": 1591681402 + }, + "steamid": "[U:1:1104086131]" + }, { "attributes": [ "cheater", @@ -2099,6 +2130,17 @@ }, "steamid": "[U:1:1104104760]" }, + { + "attributes": [ + "cheater", + "racist" + ], + "last_seen": { + "player_name": "[g0tb0t]CatholicGod", + "time": 1591680142 + }, + "steamid": "[U:1:1104127239]" + }, { "attributes": [ "cheater",