Persistent leaderboards #61
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Leaderboards are no longer computed lazily at runtime instead they are now stored in the database and updated through the game packets that are submitted as per #60 this is a breaking change so the version number has also been increased.
Thanks @Aim4kill for letting me know about the packet that provides the values for updating the leaderboard.
With these new changes players will not appear in the game leaderboards unless they have completed at least one game, they don't have to win the game they just have to finish it (Dying straight away counts as finishing it) and then they will appear on the leaderboards with their score.
These changes should improve server performance as computing the entire leaderboard at fixed intervals is less than ideal (Although the server still managed to do this relatively easily without any issues with a decent number of users so you never know, SQLite's performance never ceases to amaze me)
Changes
Related Issues