diff --git a/BlueMapCommon/webapp/public/sql.php b/BlueMapCommon/webapp/public/sql.php index 6f3382412..b7ba8bcd5 100644 --- a/BlueMapCommon/webapp/public/sql.php +++ b/BlueMapCommon/webapp/public/sql.php @@ -21,7 +21,7 @@ "bluemap:deflate" => "deflate", "bluemap:zstd" => "zstd", "bluemap:lz4" => "lz4" -] +]; // meta files $metaFileKeys = [ @@ -29,7 +29,7 @@ "textures.json" => "bluemap:textures", "live/markers.json" => "bluemap:markers", "live/players.json" => "bluemap:players", -] +]; // mime-types for meta-files $mimeDefault = "application/octet-stream"; @@ -125,7 +125,7 @@ function send($data) { $uriPath = $_SERVER['REQUEST_URI']; $path = substr($uriPath, strlen($root)); -// add / +// add / if ($path === "") { header("Location: $uriPath/"); exit; @@ -157,14 +157,14 @@ function send($data) { // parse tile-coordinates preg_match_all("/tiles\/([\d\/]+)\/x(-?[\d\/]+)z(-?[\d\/]+).*/", $mapPath, $matches); $lod = intval($matches[1][0]); - $storage = $lod === 0 ? "bluemap:hires" : "bluemap:lowres/".$lod + $storage = $lod === 0 ? "bluemap:hires" : "bluemap:lowres/".$lod; $tileX = intval(str_replace("/", "", $matches[2][0])); $tileZ = intval(str_replace("/", "", $matches[3][0])); // query for tile try { $statement = $sql->prepare(" - SELECT d.data, c.compression + SELECT d.data, c.key FROM bluemap_grid_storage_data d INNER JOIN bluemap_map m ON d.map = m.id @@ -181,7 +181,6 @@ function send($data) { $statement->bindParam( ':storage', $storage, PDO::PARAM_STR ); $statement->bindParam( ':x', $tileX, PDO::PARAM_INT ); $statement->bindParam( ':z', $tileZ, PDO::PARAM_INT ); - $statement->bindParam( ':compression', $compression, PDO::PARAM_STR ); $statement->setFetchMode(PDO::FETCH_ASSOC); $statement->execute(); @@ -200,7 +199,7 @@ function send($data) { exit; } - } catch (PDOException $e) { error(500, "Failed to fetch data"); } + } catch (PDOException $e) { error(500, "Failed to fetch data"); } // no content if nothing found http_response_code(204); @@ -215,7 +214,7 @@ function send($data) { if ($storage !== null) { try { $statement = $sql->prepare(" - SELECT d.data, c.compression + SELECT d.data, c.key FROM bluemap_item_storage_data d INNER JOIN bluemap_map m ON d.map = m.id