From 2bae5f21c6693c46d0433696b90c3f405b064ad5 Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Tue, 7 Nov 2017 10:05:55 +0100 Subject: [PATCH] fix: stating real punishment in log --- GameEngine/Admin/database.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GameEngine/Admin/database.php b/GameEngine/Admin/database.php index 71cf01a5..be828ecd 100755 --- a/GameEngine/Admin/database.php +++ b/GameEngine/Admin/database.php @@ -196,6 +196,7 @@ class adm_DB { for ($i = 0; $i <= count($villages)-1; $i++) { $vid = $villages[$i]['wref']; if($post['punish']){ + $logPunishment = "-".(int) $post['punish']."% population"; $popOld = $villages[$i]['pop']; $proc = 100-$post['punish']; $pop = floor(($popOld/100)*($proc)); @@ -204,6 +205,7 @@ class adm_DB { } if($post['del_troop']){ + $logPunishment = "troops removal"; if($user['tribe'] == 1) { $unit = 1; }else if($user['tribe'] == 2) { @@ -214,12 +216,13 @@ class adm_DB { $this->DelUnits($villages[$i]['wref'],$unit); } if($post['clean_ware']){ + $logPunishment = "emptying warehouses"; $time = time(); $q = "UPDATE ".TB_PREFIX."vdata SET `wood` = '0', `clay` = '0', `iron` = '0', `crop` = '0', `lastupdate` = '$time' WHERE wref = ".(int) $vid; mysqli_query($this->connection,$q); } } - mysqli_query($this->connection,"Insert into ".TB_PREFIX."admin_log values (0,".(int) $_SESSION['id'].",'Punished user: ".(int) $post['uid']." with -".(int) $post['punish']."% population',".time().")"); + mysqli_query($this->connection,"Insert into ".TB_PREFIX."admin_log values (0,".(int) $_SESSION['id'].",'Punished user: ".(int) $post['uid']." with ".$logPunishment."',".time().")"); } function PunishBuilding($vid,$proc,$pop){