From 8f1f6098e3573d8d9dfd2111a45ef0f5bcea4e2e Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Thu, 28 Aug 2025 10:23:12 -0700 Subject: [PATCH] Support 1.6 - 1.6.3 --- config/general.php | 4 ++-- database/getChatroomMessages.php | 7 ++++++- database/getTopPlayers.php | 3 +-- incl/util.php | 3 +++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/config/general.php b/config/general.php index f1eda21..c5f297a 100644 --- a/config/general.php +++ b/config/general.php @@ -2,5 +2,5 @@ $latestVersion = "1.6.3"; $latestBetaVersion = $latestVersion; $latestLauncherVersion = "1.0.0"; -$allowedVersions = [$latestVersion, $latestBetaVersion]; -$allowedDatabaseVersions = [$latestVersion, $latestBetaVersion]; \ No newline at end of file +$allowedVersions = [$latestVersion, $latestBetaVersion, "1.6.2", "1.6.1", "1.6"]; +$allowedDatabaseVersions = [$latestVersion, $latestBetaVersion, "1.6.2", "1.6.1", "1.6"]; \ No newline at end of file diff --git a/database/getChatroomMessages.php b/database/getChatroomMessages.php index 03f1bd0..4b0b583 100644 --- a/database/getChatroomMessages.php +++ b/database/getChatroomMessages.php @@ -50,6 +50,11 @@ foreach ($rows as $row) { ]; } -echo encrypt(json_encode(["messages" => array_reverse($mapped), "customIcons" => $icons])); + +if (getClientVersion() == "1.6") { + echo encrypt(json_encode($mapped)); +} else { + echo encrypt(json_encode(["messages" => array_reverse($mapped), "customIcons" => $icons])); +} $conn->close(); \ No newline at end of file diff --git a/database/getTopPlayers.php b/database/getTopPlayers.php index e6dc3b1..9639cff 100644 --- a/database/getTopPlayers.php +++ b/database/getTopPlayers.php @@ -72,8 +72,7 @@ foreach ($rows as $row) { usort($mapped, fn($a,$b) => $b['value'] <=> $a['value']); $limited = array_slice($mapped, 0, 500); -$clientVersion = $_SERVER['HTTP_CLIENTVERSION'] ?? "0"; -if ($_SERVER['HTTP_REQUESTER'] == 'BerryDashLauncher') { +if (getClientVersion() == "1.6" || (getClientVersion() == "1.6.1" && $request_type == "1")) { echo encrypt(json_encode($limited)); } else { echo encrypt(json_encode(["entries" => $limited, "customIcons" => $icons])); diff --git a/incl/util.php b/incl/util.php index f16213b..0a9debb 100644 --- a/incl/util.php +++ b/incl/util.php @@ -48,6 +48,9 @@ function exitWithMessage($message, $encrypt = true) { } exit; } +function getClientVersion() { + return $_SERVER['HTTP_CLIENTVERSION']; +} function isLatestVersion($version) { global $latestVersion;