You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When requesting a non-default range from the leaderboard using e.g. pos=5&before=2&after=2, the positions of the players are incorrect. The reason is pretty simple: before is subtracted from pos to get min (the row number of the first player to return).
$query = "SELECT id, name, rank_id, country, time, score FROM player WHERE score > 0
ORDER BY score DESC, name DESC LIMIT " . $min . ", " . $max;
$result = $connection->query($query);
while ($row = $result->fetch())
{
$Response->writeDataLine(
$pos++,
$row['id'],
trim($row['name']),
$row['score'],
$row['time'],
$row['rank_id'],
strtoupper($row['country'])
);
Thus in the above example, the player that should be on position 3 (pos 5 - before 2) is shows as position 5. Every following player is shifted accordingly.
The text was updated successfully, but these errors were encountered:
When requesting a non-default range from the leaderboard using e.g.
pos=5&before=2&after=2
, the positions of the players are incorrect. The reason is pretty simple:before
is subtracted frompos
to getmin
(the row number of the first player to return).asp/src/ASP/aspx/getleaderboard.php
Lines 82 to 90 in df86f71
However, the first returned player is not given
min+1
(query is zero-indexed, leaderboard is one-indexed) as their position butpos
.asp/src/ASP/aspx/getleaderboard.php
Lines 121 to 134 in df86f71
Thus in the above example, the player that should be on position 3 (pos 5 - before 2) is shows as position 5. Every following player is shifted accordingly.
The text was updated successfully, but these errors were encountered: