From 5a47e60bfb79a9a89ba98c0083f4080f0f00e956 Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Wed, 20 Aug 2025 14:01:13 -0700 Subject: [PATCH] Marketplace data --- database/getTopPlayers.php | 1 + database/loadAccount.php | 4 +++- database/loginAccount.php | 4 +++- database/saveAccount.php | 6 +++++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/database/getTopPlayers.php b/database/getTopPlayers.php index 320fd67..75441d9 100644 --- a/database/getTopPlayers.php +++ b/database/getTopPlayers.php @@ -19,6 +19,7 @@ if ($request_type === "0") { 2 => "totalSlowBerries", 3 => "totalUltraBerries", 4 => "totalSpeedyBerries", + 5 => "totalCoinBerries", default => "totalNormalBerries" }; } else { diff --git a/database/loadAccount.php b/database/loadAccount.php index 6404ea0..1deb3f4 100644 --- a/database/loadAccount.php +++ b/database/loadAccount.php @@ -26,9 +26,11 @@ if ($result->num_rows > 0) { "totalSlowBerries" => (string)$row['totalSlowBerries'], "totalUltraBerries" => (string)$row['totalUltraBerries'], "totalSpeedyBerries" => (string)$row['totalSpeedyBerries'], + "totalCoinBerries" => (string)$row['totalCoinBerries'], "totalAttempts" => (string)$row['totalAttempts'], "birdColor" => json_decode((string)$row['birdColor']), - "overlayColor" => json_decode((string)$row['overlayColor']) + "overlayColor" => json_decode((string)$row['overlayColor']), + "marketplaceData" => json_decode((string)$row['marketplaceData']) ])); } else { echo encrypt(json_encode(["success" => false, "message" => "Invalid session token or username, please refresh login"])); diff --git a/database/loginAccount.php b/database/loginAccount.php index a4dbd45..b37b3c2 100644 --- a/database/loginAccount.php +++ b/database/loginAccount.php @@ -52,9 +52,11 @@ if ($loginType === "0") { "totalSlowBerries" => (string)$user['totalSlowBerries'], "totalUltraBerries" => (string)$user['totalUltraBerries'], "totalSpeedyBerries" => (string)$user['totalSpeedyBerries'], + "totalCoinBerries" => (string)$user['totalCoinBerries'], "totalAttempts" => (string)$user['totalAttempts'], "birdColor" => json_decode((string)$user['birdColor']), - "overlayColor" => json_decode((string)$user['overlayColor']) + "overlayColor" => json_decode((string)$user['overlayColor']), + "marketplaceData" => json_decode((string)$user['marketplaceData']) ]; } diff --git a/database/saveAccount.php b/database/saveAccount.php index a4b1da6..32f26c2 100644 --- a/database/saveAccount.php +++ b/database/saveAccount.php @@ -18,9 +18,11 @@ $totalPoisonBerries = (string)$post['totalPoisonBerries'] ?? '0'; $totalSlowBerries = (string)$post['totalSlowBerries'] ?? '0'; $totalUltraBerries = (string)$post['totalUltraBerries'] ?? '0'; $totalSpeedyBerries = (string)$post['totalSpeedyBerries'] ?? '0'; +$totalCoinBerries = (string)$post['totalCoinBerries'] ?? '0'; $totalAttempts = (string)$post['totalAttempts'] ?? '0'; $birdColor = (string)$post['birdColor'] ?? '[255,255,255]'; $overlayColor = (string)$post['overlayColor'] ?? '[255,255,255]'; +$marketplaceData = (string)$post['marketplaceData'] ?? '[]'; $conn = newConnection(); @@ -30,7 +32,7 @@ $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows > 0) { - $updateStmt = $conn->prepare("UPDATE users SET highScore = ?, icon = ?, overlay = ?, totalNormalBerries = ?, totalPoisonBerries = ?, totalSlowBerries = ?, totalUltraBerries = ?, totalSpeedyBerries = ?, totalAttempts = ?, birdColor = ?, overlayColor = ? WHERE token = ? AND username = ?"); + $updateStmt = $conn->prepare("UPDATE users SET highScore = ?, icon = ?, overlay = ?, totalNormalBerries = ?, totalPoisonBerries = ?, totalSlowBerries = ?, totalUltraBerries = ?, totalSpeedyBerries = ?, totalCoinBerries = ?, totalAttempts = ?, birdColor = ?, overlayColor = ?, marketplaceData = ? WHERE token = ? AND username = ?"); $updateStmt->bind_param("iiiiiiiiissss", $highScore, $icon, @@ -40,9 +42,11 @@ if ($result->num_rows > 0) { $totalSlowBerries, $totalUltraBerries, $totalSpeedyBerries, + $totalCoinBerries, $totalAttempts, $birdColor, $overlayColor, + $marketplaceData, $token, $username );