Closed Mery042 closed 3 weeks ago
Hey @Mery042, thanks for your pull request. Could you please explain more about the feature and maybe show off some screenshots of what this does?
Thanks for the pull request! I see there's a huge bottleneck with the way you implemented the rankings, that is many servers have more than 100 maps, mostlikely more than 500 even. Your implementation would generate one query for each map, thus making 500 queries or more, which is something we really wish to avoid.
Sorry mate, but I have to close this pullrequest as not merged.
The plugin fetches the records of the maps list by ascending order on time attribute. It assigns rank to each player. It calculates the points of each player with (recordsCount - rank) + 1 and adds it to the points amount of the player. Then, we calculates averages by dividing these points by the maps count and sorts the array by descending order. Finally we attribuate a final rank to each player in the array and we have our ranking for the server.