feat: player and map ranking ladder scores manager#100
Merged
Conversation
* Add a new `player-map-ranking` crate. It exposes a function to compute the leaderboard (ladder) of the players and maps, based on a certain formula per player record on a map. * Add a new `compute-player-map-ranking` crate. It's a binary used to output the result of the above function to two separate CSV files. * Add a new task running in the socc crate, that uses the new function, and output the result in two separate Redis ZSETs. * Add a new managed environment variable, used by the above task, for the interval of the compute made by the socc crate. It defaults to 1 week. Refs: #86.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a player and map ranking system that computes leaderboard scores based on player records. The implementation includes a new library for score computation, a CLI tool for generating CSV exports, and integration with the socc service to periodically update rankings in Redis.
Key Changes
- New
player-map-rankingcrate that computes scores using a formula based on record rank, record count, and average times - New
compute-player-map-rankingCLI binary that exports ranking data to CSV files - Integration with socc service to periodically compute and store rankings in Redis ZSETs
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/player-map-ranking/src/lib.rs | Core ranking algorithm implementation with score computation logic |
| crates/player-map-ranking/Cargo.toml | Dependencies for the ranking library |
| crates/compute-player-map-ranking/src/main.rs | CLI tool for exporting rankings to CSV files |
| crates/compute-player-map-ranking/Cargo.toml | Dependencies for the CLI tool |
| crates/socc/src/player_ranking.rs | Redis integration for storing computed rankings |
| crates/socc/src/main.rs | Task spawning for periodic ranking updates |
| crates/socc/Cargo.toml | Added dependencies for ranking functionality |
| crates/records_lib/src/redis_key.rs | Redis key definitions for player and map rankings |
| crates/records_lib/src/env.rs | Environment variable for ranking update interval |
| crates/graphql-schema-generator/src/main.rs | Removed extraneous blank line |
| Cargo.toml | Added new crates to workspace |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Closed
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
player-map-rankingcrate. It exposes a function to compute the leaderboard (ladder) of the players and maps, based on a certain formula per player record on a map.compute-player-map-rankingcrate. It's a binary used to output the result of the above function to two separate CSV files.Refs: #86.