A lot of changes (that shouldn't, hopefully be breaking)
This commit is contained in:
@@ -19,10 +19,11 @@ $overlayColor = [$overlayR, $overlayG, $overlayB];
|
||||
$conn0 = newConnection(0);
|
||||
$conn1 = newConnection(1);
|
||||
|
||||
$stmt = $conn0->prepare("SELECT * FROM users WHERE username = ?");
|
||||
$stmt = $conn0->prepare("SELECT id FROM users WHERE username = ?");
|
||||
$stmt->bind_param("s", $username);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$stmt->close();
|
||||
|
||||
if ($result->num_rows != 1) {
|
||||
echo encrypt("-1");
|
||||
@@ -34,10 +35,11 @@ if ($result->num_rows != 1) {
|
||||
$row = $result->fetch_assoc();
|
||||
$id = $row["id"];
|
||||
|
||||
$stmt2 = $conn1->prepare("SELECT * FROM userdata WHERE id = ? AND token = ?");
|
||||
$stmt2->bind_param("is", $id, $token);
|
||||
$stmt2->execute();
|
||||
$result2 = $stmt2->get_result();
|
||||
$stmt = $conn1->prepare("SELECT save_data FROM userdata WHERE id = ? AND token = ?");
|
||||
$stmt->bind_param("is", $id, $token);
|
||||
$stmt->execute();
|
||||
$result2 = $stmt->get_result();
|
||||
$stmt->close();
|
||||
|
||||
if ($result2->num_rows != 1) {
|
||||
echo encrypt("-1");
|
||||
@@ -53,15 +55,15 @@ $savedata['bird']['overlay'] = $overlay;
|
||||
$savedata['settings']['colors']['icon'] = $birdColor;
|
||||
if (getClientVersion() == "1.5.2") $savedata['settings']['colors']['overlay'] = $overlayColor;
|
||||
$savedata = json_encode($savedata);
|
||||
$updateStmt = $conn1->prepare("UPDATE userdata SET legacy_high_score = ?, save_data = ? WHERE id = ? AND token = ?");
|
||||
$updateStmt->bind_param("isis",
|
||||
$stmt = $conn1->prepare("UPDATE userdata SET legacy_high_score = ?, save_data = ? WHERE id = ? AND token = ?");
|
||||
$stmt->bind_param("isis",
|
||||
$highScore,
|
||||
$savedata,
|
||||
$id,
|
||||
$token
|
||||
);
|
||||
$updateStmt->execute();
|
||||
$updateStmt->close();
|
||||
$stmt->execute();
|
||||
$stmt->close();
|
||||
echo encrypt("1");
|
||||
|
||||
$conn0->close();
|
||||
|
||||
Reference in New Issue
Block a user