From 4da72fb9b996c82e229a7e649cc6c5eb2def2d16 Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Sat, 28 Oct 2017 20:52:15 +0200 Subject: [PATCH] fix: player auto-deletion after a set period of time now works It only deleted player from the users table. Now, it deletes everything, so basically clears everything up. --- GameEngine/Automation.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index a1ebce70..3c0d3029 100755 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -470,8 +470,9 @@ class Automation { private function ClearUser() { global $database; if(AUTO_DEL_INACTIVE) { - $time = time()+UN_ACT_TIME; - $q = "DELETE from ".TB_PREFIX."users where timestamp >= $time and act != ''"; + $time = time()-UN_ACT_TIME; + + $q = "INSERT INTO ".TB_PREFIX."deleting SELECT id, UNIX_TIMESTAMP() FROM ".TB_PREFIX."users WHERE timestamp < $time AND tribe IN(1,2,3)"; $database->query($q); } }