From a8166b05076652e86762b5afb01da9bb91b17cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Gonz=C3=A1lez?= Date: Sat, 24 Feb 2018 12:43:31 -0300 Subject: [PATCH] Add option to configure report save time --- conf/Anticheat.conf.dist | 6 ++++++ src/AnticheatScripts.cpp | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/conf/Anticheat.conf.dist b/conf/Anticheat.conf.dist index 5f4b3f1..597820b 100644 --- a/conf/Anticheat.conf.dist +++ b/conf/Anticheat.conf.dist @@ -44,6 +44,12 @@ Anticheat.LoginMessage = 0 Anticheat.WriteLog = 0 +# Anticheat.SaveReportsTime +# Description: Set the time between each report save in seconds +# Default: 60 - (seconds) + +Anticheat.SaveReportsTime = 60 + # Anticheat.Detect # Description: It represents which detections are enabled (ClimbHack disabled by default). # Default: 1 - (Enabled) diff --git a/src/AnticheatScripts.cpp b/src/AnticheatScripts.cpp index 221aef7..b6a661f 100644 --- a/src/AnticheatScripts.cpp +++ b/src/AnticheatScripts.cpp @@ -43,8 +43,9 @@ public: } if (sWorld->GetUptime() > lastIterationPlayer) { - lastIterationPlayer = sWorld->GetUptime() + 30;//TODO: change 30 secs static to a configurable option + lastIterationPlayer = sWorld->GetUptime() + sConfigMgr->GetIntDefault("Anticheat.SaveReportsTime", 60); sLog->outString( "Saving reports for %u players.", sWorld->GetPlayerCount()); + for (SessionMap::const_iterator itr = sWorld->GetAllSessions().begin(); itr != sWorld->GetAllSessions().end(); ++itr) if (Player* plr = itr->second->GetPlayer()) sAnticheatMgr->SavePlayerData(plr);