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

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

View File

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