Make icon marketplace icons show up in chatroom and leaderboards
This commit is contained in:
@@ -18,9 +18,24 @@ $result = $stmt->get_result();
|
||||
$rows = $result->fetch_all(MYSQLI_ASSOC);
|
||||
|
||||
$mapped = [];
|
||||
$icons = [];
|
||||
foreach ($rows as $row) {
|
||||
$savedata = json_decode($row['save_data'], true);
|
||||
|
||||
$customIcon = $savedata['bird']['customIcon']['selected'] ?? null;
|
||||
|
||||
if ($customIcon != null && strlen($customIcon) == 36 && $icons[$customIcon] == null) {
|
||||
$stmt = $conn->prepare("SELECT data FROM marketplaceicons WHERE uuid = ?");
|
||||
$stmt->bind_param("s", $customIcon);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$rowData = $result->fetch_assoc();
|
||||
if ($rowData) {
|
||||
$stmt->close();
|
||||
$icons[$customIcon] = $rowData["data"];
|
||||
}
|
||||
}
|
||||
|
||||
$mapped[] = [
|
||||
'username' => $row['username'],
|
||||
'userid' => $row['user_id'],
|
||||
@@ -31,9 +46,10 @@ foreach ($rows as $row) {
|
||||
'overlay' => $savedata['bird']['overlay'] ?? 0,
|
||||
'birdColor' => $savedata['settings']['colors']['icon'] ?? [255,255,255],
|
||||
'overlayColor' => $savedata['settings']['colors']['overlay'] ?? [255,255,255],
|
||||
'customIcon' => $customIcon,
|
||||
];
|
||||
}
|
||||
|
||||
echo encrypt(json_encode(array_reverse($mapped)));
|
||||
echo encrypt(json_encode(["messages" => array_reverse($mapped), "customIcons" => $icons]));
|
||||
|
||||
$conn->close();
|
||||
Reference in New Issue
Block a user