Marketplace data

This commit is contained in:
2025-08-20 14:01:13 -07:00
parent f460c1b650
commit 5a47e60bfb
4 changed files with 12 additions and 3 deletions

View File

@@ -19,6 +19,7 @@ if ($request_type === "0") {
2 => "totalSlowBerries", 2 => "totalSlowBerries",
3 => "totalUltraBerries", 3 => "totalUltraBerries",
4 => "totalSpeedyBerries", 4 => "totalSpeedyBerries",
5 => "totalCoinBerries",
default => "totalNormalBerries" default => "totalNormalBerries"
}; };
} else { } else {

View File

@@ -26,9 +26,11 @@ if ($result->num_rows > 0) {
"totalSlowBerries" => (string)$row['totalSlowBerries'], "totalSlowBerries" => (string)$row['totalSlowBerries'],
"totalUltraBerries" => (string)$row['totalUltraBerries'], "totalUltraBerries" => (string)$row['totalUltraBerries'],
"totalSpeedyBerries" => (string)$row['totalSpeedyBerries'], "totalSpeedyBerries" => (string)$row['totalSpeedyBerries'],
"totalCoinBerries" => (string)$row['totalCoinBerries'],
"totalAttempts" => (string)$row['totalAttempts'], "totalAttempts" => (string)$row['totalAttempts'],
"birdColor" => json_decode((string)$row['birdColor']), "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 { } else {
echo encrypt(json_encode(["success" => false, "message" => "Invalid session token or username, please refresh login"])); echo encrypt(json_encode(["success" => false, "message" => "Invalid session token or username, please refresh login"]));

View File

@@ -52,9 +52,11 @@ if ($loginType === "0") {
"totalSlowBerries" => (string)$user['totalSlowBerries'], "totalSlowBerries" => (string)$user['totalSlowBerries'],
"totalUltraBerries" => (string)$user['totalUltraBerries'], "totalUltraBerries" => (string)$user['totalUltraBerries'],
"totalSpeedyBerries" => (string)$user['totalSpeedyBerries'], "totalSpeedyBerries" => (string)$user['totalSpeedyBerries'],
"totalCoinBerries" => (string)$user['totalCoinBerries'],
"totalAttempts" => (string)$user['totalAttempts'], "totalAttempts" => (string)$user['totalAttempts'],
"birdColor" => json_decode((string)$user['birdColor']), "birdColor" => json_decode((string)$user['birdColor']),
"overlayColor" => json_decode((string)$user['overlayColor']) "overlayColor" => json_decode((string)$user['overlayColor']),
"marketplaceData" => json_decode((string)$user['marketplaceData'])
]; ];
} }

View File

@@ -18,9 +18,11 @@ $totalPoisonBerries = (string)$post['totalPoisonBerries'] ?? '0';
$totalSlowBerries = (string)$post['totalSlowBerries'] ?? '0'; $totalSlowBerries = (string)$post['totalSlowBerries'] ?? '0';
$totalUltraBerries = (string)$post['totalUltraBerries'] ?? '0'; $totalUltraBerries = (string)$post['totalUltraBerries'] ?? '0';
$totalSpeedyBerries = (string)$post['totalSpeedyBerries'] ?? '0'; $totalSpeedyBerries = (string)$post['totalSpeedyBerries'] ?? '0';
$totalCoinBerries = (string)$post['totalCoinBerries'] ?? '0';
$totalAttempts = (string)$post['totalAttempts'] ?? '0'; $totalAttempts = (string)$post['totalAttempts'] ?? '0';
$birdColor = (string)$post['birdColor'] ?? '[255,255,255]'; $birdColor = (string)$post['birdColor'] ?? '[255,255,255]';
$overlayColor = (string)$post['overlayColor'] ?? '[255,255,255]'; $overlayColor = (string)$post['overlayColor'] ?? '[255,255,255]';
$marketplaceData = (string)$post['marketplaceData'] ?? '[]';
$conn = newConnection(); $conn = newConnection();
@@ -30,7 +32,7 @@ $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
if ($result->num_rows > 0) { 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", $updateStmt->bind_param("iiiiiiiiissss",
$highScore, $highScore,
$icon, $icon,
@@ -40,9 +42,11 @@ if ($result->num_rows > 0) {
$totalSlowBerries, $totalSlowBerries,
$totalUltraBerries, $totalUltraBerries,
$totalSpeedyBerries, $totalSpeedyBerries,
$totalCoinBerries,
$totalAttempts, $totalAttempts,
$birdColor, $birdColor,
$overlayColor, $overlayColor,
$marketplaceData,
$token, $token,
$username $username
); );