diff --git a/src/AnticheatMgr.cpp b/src/AnticheatMgr.cpp index 0031ac9..50db4dc 100644 --- a/src/AnticheatMgr.cpp +++ b/src/AnticheatMgr.cpp @@ -781,6 +781,11 @@ void AnticheatMgr::AnticheatDeleteCommand(ObjectGuid guid) } } +void AnticheatMgr::AnticheatPurgeCommand(ChatHandler* handler) +{ + CharacterDatabase.Execute("TRUNCATE TABLE daily_players_reports;"); +} + void AnticheatMgr::ResetDailyReportStates() { for (AnticheatPlayersDataMap::iterator it = m_Players.begin(); it != m_Players.end(); ++it) diff --git a/src/AnticheatMgr.h b/src/AnticheatMgr.h index 03eb9b0..966721e 100644 --- a/src/AnticheatMgr.h +++ b/src/AnticheatMgr.h @@ -80,7 +80,7 @@ class AnticheatMgr void AnticheatGlobalCommand(ChatHandler* handler); void AnticheatDeleteCommand(ObjectGuid guid); - + void AnticheatPurgeCommand(ChatHandler* handler); void ResetDailyReportStates(); private: void SpeedHackDetection(Player* player, MovementInfo movementInfo); diff --git a/src/cs_anticheat.cpp b/src/cs_anticheat.cpp index 279ea5e..8f73aad 100644 --- a/src/cs_anticheat.cpp +++ b/src/cs_anticheat.cpp @@ -40,6 +40,7 @@ public: { "delete", SEC_ADMINISTRATOR, true, &HandleAntiCheatDeleteCommand, "" }, { "jail", SEC_GAMEMASTER, false, &HandleAnticheatJailCommand, "" }, { "parole", SEC_GAMEMASTER, false, &HandleAnticheatParoleCommand, "" }, + { "purge", SEC_ADMINISTRATOR, true, &HandleAntiCheatPurgeCommand, "" }, { "warn", SEC_GAMEMASTER, true, &HandleAnticheatWarnCommand, "" } }; @@ -276,6 +277,13 @@ public: return true; } + + static bool HandleAntiCheatPurgeCommand(ChatHandler* handler, const char* /* args */) + { + sAnticheatMgr->AnticheatPurgeCommand(handler); + handler->PSendSysMessage("The Anticheat daily_player_reports has been purged."); + return true; + } }; void AddSC_anticheat_commandscript()