Marketplace data
This commit is contained in:
@@ -19,6 +19,7 @@ if ($request_type === "0") {
|
||||
2 => "totalSlowBerries",
|
||||
3 => "totalUltraBerries",
|
||||
4 => "totalSpeedyBerries",
|
||||
5 => "totalCoinBerries",
|
||||
default => "totalNormalBerries"
|
||||
};
|
||||
} else {
|
||||
|
||||
@@ -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"]));
|
||||
|
||||
@@ -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'])
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user