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
It is possible that two players have e.g. the same overall score, meaning they tie for a leaderboard position. For the leaderboard itself, that tie is broken by additionally sorting by name.
$query = "SELECT COUNT(id) FROM player WHERE score > %d";
This mismatch results in a potentially incorrect and non-unique leaderboard position being returned for the player, since every player with the same score will be placed at the same position by the 2nd query.
A quick example. The actual leaderboard might be (name is sorted DESC to break ties):
Pos
Nick
Score
1
alpha
1000
2
charlie
900
3
bravo
900
Requesting the positions of bravo or charlie will return 2, since only alpha has a greater score.
The text was updated successfully, but these errors were encountered:
It is possible that two players have e.g. the same overall score, meaning they tie for a leaderboard position. For the leaderboard itself, that tie is broken by additionally sorting by name.
asp/src/ASP/aspx/getleaderboard.php
Lines 121 to 122 in df86f71
However, the tiebreaker is not applied when determining a player's position on the leaderboard directly.
asp/src/ASP/aspx/getleaderboard.php
Line 147 in df86f71
This mismatch results in a potentially incorrect and non-unique leaderboard position being returned for the player, since every player with the same score will be placed at the same position by the 2nd query.
A quick example. The actual leaderboard might be (name is sorted
DESC
to break ties):Requesting the positions of
bravo
orcharlie
will return2
, since onlyalpha
has a greater score.The text was updated successfully, but these errors were encountered: