From b2133ddbc035d3ff910377f2abfc9516873e6c5e Mon Sep 17 00:00:00 2001 From: Shadow <1140613+Shadowss@users.noreply.github.com> Date: Mon, 15 Jan 2018 08:34:39 +0200 Subject: [PATCH] Gallic trappers does not work right #473 Thanks @Dayran --- GameEngine/Database.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/GameEngine/Database.php b/GameEngine/Database.php index c0457754..549d7045 100755 --- a/GameEngine/Database.php +++ b/GameEngine/Database.php @@ -7673,9 +7673,21 @@ References: User ID/Message ID, Mode return self::$prisonersCacheByID[$id]; } - function getPrisoners3($from) { - return $this->getPrisoners($from, 1); - } + function getPrisoners3($from, $use_cache = true) { //change all this function arrange Dayran prisoners + list($from) = $this->escape_input((int) $from); + + // first of all, check if we should be using cache and whether the field + // required is already cached + if ($use_cache && ($cachedValue = self::returnCachedContent(self::$prisonersCacheByVillageAndFromIDs, $from)) && !is_null($cachedValue)) { + return $cachedValue; + } + + $q = "SELECT * FROM " . TB_PREFIX . "prisoners where " . TB_PREFIX . "prisoners.from = $from"; + $result = mysqli_query($this->dblink,$q); + + self::$prisonersCacheByVillageAndFromIDs[$wid.$from] = $this->mysqli_fetch_all($result); + return self::$prisonersCacheByVillageAndFromIDs[$from]; + }//hasta aki function deletePrisoners($id) { if (!is_array($id)) { @@ -7934,4 +7946,4 @@ if (!in_array($req_file, ['tutorial.php', 'anleitung.php'])) { $database->sendPendingMessages(); }); } -?> \ No newline at end of file +?>