From d238a6ce617d50d18f24a77b2d88caf56b42719a Mon Sep 17 00:00:00 2001 From: MDIC Date: Wed, 15 Jun 2022 09:44:24 -0400 Subject: [PATCH] update (cmd): Save Stats before Global stats display adding in a save stats before displaying global stats with .anticheat global gm command. --- src/AnticheatMgr.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/AnticheatMgr.cpp b/src/AnticheatMgr.cpp index 92ccf3e..0e0aa05 100644 --- a/src/AnticheatMgr.cpp +++ b/src/AnticheatMgr.cpp @@ -938,6 +938,11 @@ void AnticheatMgr::BuildReport(Player* player, uint16 reportType) void AnticheatMgr::AnticheatGlobalCommand(ChatHandler* handler) { + // save All Anticheat Player Data before displaying global stats + for (SessionMap::const_iterator itr = sWorld->GetAllSessions().begin(); itr != sWorld->GetAllSessions().end(); ++itr) + if (Player* plr = itr->second->GetPlayer()) + sAnticheatMgr->SavePlayerData(plr); + QueryResult resultDB = CharacterDatabase.Query("SELECT guid,average,total_reports FROM players_reports_status WHERE total_reports != 0 ORDER BY average ASC LIMIT 3;"); if (!resultDB) {