From 327833832da31561d6b49caae47570d359671116 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Thu, 3 Feb 2022 09:24:36 -0600 Subject: [PATCH] Handle rollover from newImage to Image in MySQL PHP --- .../resources/extracted/web/standalone/MySQL_tiles.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/DynmapCore/src/main/resources/extracted/web/standalone/MySQL_tiles.php b/DynmapCore/src/main/resources/extracted/web/standalone/MySQL_tiles.php index 1859692c..7f8a1c60 100644 --- a/DynmapCore/src/main/resources/extracted/web/standalone/MySQL_tiles.php +++ b/DynmapCore/src/main/resources/extracted/web/standalone/MySQL_tiles.php @@ -81,10 +81,10 @@ if (count($fparts) == 3) { // zoom_x_y } initDbIfNeeded(); -$stmt = $db->prepare('SELECT t.newImage,t.Format,t.HashCode,t.LastUpdate FROM ' . $dbprefix . 'Maps m JOIN ' . $dbprefix . 'Tiles t WHERE m.WorldID=? AND m.MapID=? AND m.Variant=? AND m.ID=t.MapID AND t.x=? AND t.y=? and t.zoom=?'); +$stmt = $db->prepare('SELECT t.newImage,t.Image,t.Format,t.HashCode,t.LastUpdate FROM ' . $dbprefix . 'Maps m JOIN ' . $dbprefix . 'Tiles t WHERE m.WorldID=? AND m.MapID=? AND m.Variant=? AND m.ID=t.MapID AND t.x=? AND t.y=? and t.zoom=?'); $stmt->bind_param('sssiii', $world, $prefix, $variant, $x, $y, $zoom); $res = $stmt->execute(); -$stmt->bind_result($timage, $format, $thash, $tlast); +$stmt->bind_result($tnewimage, $timage, $format, $thash, $tlast); if ($stmt->fetch()) { if ($format == 0) { header('Content-Type: image/png'); @@ -93,7 +93,11 @@ if ($stmt->fetch()) { } header('ETag: \'' . $thash . '\''); header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $tlast / 1000) . ' GMT'); - echo $timage; + if ($tnewimage) { + echo $tnewimage + } else { + echo $timage; + } } else { header('Location: ../images/blank.png'); }