Backport 1.5 load account

This commit is contained in:
2025-09-12 07:50:52 -07:00
parent 2adacb4101
commit 6445cc45d3
2 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<?php
$post = getPostData();
$token = $post['gameSession'] ?? '';
$username = $post['userName'] ?? '';
$conn = newConnection();
$stmt = $conn->prepare("SELECT * FROM users WHERE token = ? AND username = ?");
$stmt->bind_param("ss", $token, $username);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$savedata = json_decode($row['save_data'], true);
$icon = $savedata['bird']['icon'] ?? 1;
$overlay = $savedata['bird']['overlay'] ?? 0;
$birdColor = $savedata['settings']['colors']['icon'] ?? [255,255,255];
$overlayColor = $savedata['settings']['colors']['overlay'] ?? [255,255,255];
echo encrypt("1" . ":" . $row['legacy_high_score'] . ":" . $icon . ":" . $overlay . ":0:0:0:0:0:0:" . ":" . $birdColor[0] . ":" . $birdColor[1] . ":" . $birdColor[2] . ":" . $overlayColor[0] . ":" . $overlayColor[1] . ":" . $overlayColor[2]);
} else {
echo encrypt("-1");
}
$stmt->close();
$conn->close();

View File

@@ -1,6 +1,12 @@
<?php
require __DIR__ . '/../incl/util.php';
setPlainHeader();
if (isAllowedDatabaseVersion(getClientVersion())) {
if (getClientVersion() == "1.5.0" || getClientVersion() == "1.5.1" || getClientVersion() == "1.5.2") {
require __DIR__ . '/backported/1.5/loadAccount.php';
exit;
}
}
checkClientDatabaseVersion();
$post = getPostData();