From d5495257f4c1fd3969b0cfe0f1bf0fed85e494c6 Mon Sep 17 00:00:00 2001 From: CarloFalco <48788661+CarloFalco@users.noreply.github.com> Date: Tue, 18 Jun 2024 20:53:33 +0200 Subject: [PATCH 1/2] Update Generator.php Update Generator.php, fix 'Coordinates DoNotExist' --- GameEngine/Generator.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GameEngine/Generator.php b/GameEngine/Generator.php index c7ce83e9..b47d08f7 100755 --- a/GameEngine/Generator.php +++ b/GameEngine/Generator.php @@ -118,7 +118,9 @@ class MyGenerator { public function getBaseID($x, $y){ - return ((WORLD_MAX - $y) * (WORLD_MAX * 2 + 1)) + (WORLD_MAX + $x + 1); + # broken -> return ((WORLD_MAX - $y) * (WORLD_MAX * 2 + 1)) + (WORLD_MAX + $x + 1); + # OK -> return ((WORLD_MAX - $y) * (WORLD_MAX * 2 + 1)) + (WORLD_MAX - $x + 1); + return ((WORLD_MAX - $y) * (WORLD_MAX * 2 + 1)) + (WORLD_MAX - $x + 1); } public function getMapCheck($wref){ From 27c0a2f10b3f6fdf942b294be7fb7dc011c38af2 Mon Sep 17 00:00:00 2001 From: CarloFalco <48788661+CarloFalco@users.noreply.github.com> Date: Sat, 13 Jul 2024 17:19:46 +0200 Subject: [PATCH 2/2] Update Database.php Fix issue "Building orders are canceled after the attack in WW village" --- GameEngine/Database.php | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/GameEngine/Database.php b/GameEngine/Database.php index 60b109d5..2926cf3e 100755 --- a/GameEngine/Database.php +++ b/GameEngine/Database.php @@ -705,14 +705,26 @@ class MYSQLi_DB implements IDbConnection { $arg_list = func_get_args(); $ret = []; - for ($i = 0; $i < $numargs; $i++) { - if (is_string($arg_list[$i])) { - $arg_list[$i] = stripslashes($arg_list[$i]); - $res[] = mysqli_real_escape_string($this->dblink, $arg_list[$i]); - } else { - $res[] = $arg_list[$i]; - } - } + for ($i = 0; $i < $numargs; $i++) { + if (is_array($arg_list[$i])) { + // array handling + $escaped_array = []; + foreach ($arg_list[$i] as $item) { + if (is_string($item)) { + $item = stripslashes($item); + $escaped_array[] = mysqli_real_escape_string($this->dblink, $item); + } else { + $escaped_array[] = (int)$item; + } + } + $res[] = $escaped_array; + } elseif (is_string($arg_list[$i])) { + $arg_list[$i] = stripslashes($arg_list[$i]); + $res[] = mysqli_real_escape_string($this->dblink, $arg_list[$i]); + } else { + $res[] = (int)$arg_list[$i]; + } + } return $res; }