Make berry dash launcher leaderboards work
This commit is contained in:
@@ -9,7 +9,7 @@ $stmt->close();
|
|||||||
|
|
||||||
if ($result->num_rows > 0) {
|
if ($result->num_rows > 0) {
|
||||||
$topPlayers = [];
|
$topPlayers = [];
|
||||||
|
|
||||||
while ($row = $result->fetch_assoc()) {
|
while ($row = $result->fetch_assoc()) {
|
||||||
$id = $row["id"];
|
$id = $row["id"];
|
||||||
$stmt = $conn1->prepare("SELECT legacy_high_score, save_data FROM userdata WHERE id = ? AND legacy_high_score > 0 LIMIT 1");
|
$stmt = $conn1->prepare("SELECT legacy_high_score, save_data FROM userdata WHERE id = ? AND legacy_high_score > 0 LIMIT 1");
|
||||||
|
|||||||
@@ -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