Make berry dash launcher leaderboards work
This commit is contained in:
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user