summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehonal <yehonal.azeroth@gmail.com>2016-08-31 01:54:20 +0200
committerYehonal <yehonal.azeroth@gmail.com>2016-08-31 01:54:20 +0200
commit3704829d65bdf4fb7efd6357a0cce3fa26ccf12b (patch)
tree7afbcf191f5cfe8231bd044f3576e69376a9aefa
parentde714fdae75239157073966554df3880fc1c93ba (diff)
Re-implemented Clean logs table
-rw-r--r--src/game/World/World.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/game/World/World.cpp b/src/game/World/World.cpp
index aead742497..9b3b756ad9 100644
--- a/src/game/World/World.cpp
+++ b/src/game/World/World.cpp
@@ -2010,6 +2010,20 @@ void World::Update(uint32 diff)
WeatherMgr::Update(uint32(m_timers[WUPDATE_WEATHERS].GetInterval()));
}
+ /// <li> Clean logs table
+ if(getIntConfig(CONFIG_LOGDB_CLEARINTERVAL) > 0) // if not enabled, ignore the timer
+ {
+ if (m_timers[WUPDATE_CLEANDB].Passed())
+ {
+ uint32 tmpDiff = (m_gameTime - m_startTime);
+ uint32 maxClientsNum = GetMaxActiveSessionCount();
+
+ m_timers[WUPDATE_CLEANDB].Reset();
+ LoginDatabase.PExecute("DELETE FROM logs WHERE (time + %u) < " UI64FMTD ";",
+ getIntConfig(CONFIG_LOGDB_CLEARINTERVAL), uint64(time(0)));
+ }
+ }
+
sLFGMgr->Update(diff, 0); // pussywizard: remove obsolete stuff before finding compatibility during map update
sMapMgr->Update(diff);