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

@@ -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);