diff --git a/libs/database/wrapper.js b/libs/database/wrapper.js index f20282d..c195969 100644 --- a/libs/database/wrapper.js +++ b/libs/database/wrapper.js @@ -242,10 +242,12 @@ export function leaderboardPoints(type, region, start, end) { SELECT rank, region, player, points FROM points WHERE type = ? AND region = ? ORDER BY rank ASC LIMIT ?, ${end}`) .all(type, region, start - 1) } + let rank = 1 for (const entry of leaderboard) { let flag = skinDB.prepare(`SELECT flag FROM skindata WHERE player = ?`).get(entry.player)?.flag ?? "default" - output.push({ rank: entry.rank, player: entry.player, points: entry.points, region: entry.region, flag: flag }) + output.push({ rank: rank, global: entry.rank, player: entry.player, points: entry.points, region: entry.region, flag: flag }) + ++i } return output }