Make berry dash launcher leaderboards work

This commit is contained in:
2026-02-16 22:43:58 -07:00
parent 876b1bce08
commit 94051c6b55
3 changed files with 7 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ $stmt->close();
if ($result->num_rows > 0) {
$topPlayers = [];
while ($row = $result->fetch_assoc()) {
$id = $row["id"];
$stmt = $conn1->prepare("SELECT legacy_high_score, save_data FROM userdata WHERE id = ? AND legacy_high_score > 0 LIMIT 1");

View File

@@ -14,7 +14,7 @@ if (
exit;
}
$post = getPostData();
$request_type = $post['type'] ?? '';
$request_type = $post['type'] ?? isLauncher() ? '0' : '';
$conn0 = newConnection(0);
$conn1 = newConnection(1);

View File

@@ -27,9 +27,13 @@ function getClientVersion() {
return $_SERVER['HTTP_CLIENTVERSION'];
}
function isLauncher() {
return ($_SERVER['HTTP_REQUESTER'] == "BerryDashLauncher" && $_SERVER['HTTP_LAUNCHERVERSION'] == "1.1.0");
}
function encrypt($plainText) {
include __DIR__.'/../config/encryption.php';
$key = $SERVER_SEND_TRANSFER_KEY_SPECIFIC[getClientVersion()];
$key = isLauncher() ? $SERVER_SEND_TRANSFER_KEY_SPECIFIC["1.6"] : $SERVER_SEND_TRANSFER_KEY_SPECIFIC[getClientVersion()];
if ($key == null) return;
$iv = random_bytes(16);
$cipher = openssl_encrypt($plainText, 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $iv);