Add: Purge cmd

.anticheat purge clears the whole daily_player_reports table. only administrator level can do run the command.
This commit is contained in:
MDIC
2022-04-09 13:41:46 -04:00
parent 3d98caf636
commit bac7aefd12
3 changed files with 14 additions and 1 deletions

View File

@@ -781,6 +781,11 @@ void AnticheatMgr::AnticheatDeleteCommand(ObjectGuid guid)
} }
} }
void AnticheatMgr::AnticheatPurgeCommand(ChatHandler* handler)
{
CharacterDatabase.Execute("TRUNCATE TABLE daily_players_reports;");
}
void AnticheatMgr::ResetDailyReportStates() void AnticheatMgr::ResetDailyReportStates()
{ {
for (AnticheatPlayersDataMap::iterator it = m_Players.begin(); it != m_Players.end(); ++it) for (AnticheatPlayersDataMap::iterator it = m_Players.begin(); it != m_Players.end(); ++it)

View File

@@ -80,7 +80,7 @@ class AnticheatMgr
void AnticheatGlobalCommand(ChatHandler* handler); void AnticheatGlobalCommand(ChatHandler* handler);
void AnticheatDeleteCommand(ObjectGuid guid); void AnticheatDeleteCommand(ObjectGuid guid);
void AnticheatPurgeCommand(ChatHandler* handler);
void ResetDailyReportStates(); void ResetDailyReportStates();
private: private:
void SpeedHackDetection(Player* player, MovementInfo movementInfo); void SpeedHackDetection(Player* player, MovementInfo movementInfo);

View File

@@ -40,6 +40,7 @@ public:
{ "delete", SEC_ADMINISTRATOR, true, &HandleAntiCheatDeleteCommand, "" }, { "delete", SEC_ADMINISTRATOR, true, &HandleAntiCheatDeleteCommand, "" },
{ "jail", SEC_GAMEMASTER, false, &HandleAnticheatJailCommand, "" }, { "jail", SEC_GAMEMASTER, false, &HandleAnticheatJailCommand, "" },
{ "parole", SEC_GAMEMASTER, false, &HandleAnticheatParoleCommand, "" }, { "parole", SEC_GAMEMASTER, false, &HandleAnticheatParoleCommand, "" },
{ "purge", SEC_ADMINISTRATOR, true, &HandleAntiCheatPurgeCommand, "" },
{ "warn", SEC_GAMEMASTER, true, &HandleAnticheatWarnCommand, "" } { "warn", SEC_GAMEMASTER, true, &HandleAnticheatWarnCommand, "" }
}; };
@@ -276,6 +277,13 @@ public:
return true; 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() void AddSC_anticheat_commandscript()