Skip to content

Commit

Permalink
test: Removed user rank search algorithm to determine XP issue (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
Seb committed Apr 21, 2022
1 parent e542c7d commit f0f5c87
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/de/voidtech/gerald/service/ExperienceService.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ public List<Experience> getServerLeaderboardChunk(long serverID, int limit, int
public int getUserLeaderboardPosition(long serverID, String userID) {
List<Experience> leaderboard = getServerLeaderboard(serverID);
int position = 0;
boolean found = false;
//boolean found = false;

while (!found & leaderboard.iterator().hasNext()) {
position++;
if (leaderboard.iterator().next().getUserID().equals(userID)) found = true;
}
//while (!found & leaderboard.iterator().hasNext()) {
//position++;
//if (leaderboard.iterator().next().getUserID().equals(userID)) found = true;
//}

return position;
}
Expand Down

0 comments on commit f0f5c87

Please sign in to comment.