Skip to content

feat: player and map ranking ladder scores manager#100

Merged
ahmadbky merged 5 commits intomasterfrom
86-player-of-the-week
Oct 22, 2025
Merged

feat: player and map ranking ladder scores manager#100
ahmadbky merged 5 commits intomasterfrom
86-player-of-the-week

Conversation

@ahmadbky
Copy link
Copy Markdown
Member

  • 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.

* 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.
@ahmadbky ahmadbky requested a review from Copilot October 22, 2025 21:30
@ahmadbky ahmadbky self-assigned this Oct 22, 2025
@ahmadbky ahmadbky added the enhancement New feature or request label Oct 22, 2025
@ahmadbky ahmadbky linked an issue Oct 22, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-ranking crate that computes scores using a formula based on record rank, record count, and average times
  • New compute-player-map-ranking CLI 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.

@ahmadbky ahmadbky linked an issue Oct 22, 2025 that may be closed by this pull request
ahmadbky and others added 4 commits October 22, 2025 23:35
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Refs: #86.
@ahmadbky ahmadbky merged commit 9163d74 into master Oct 22, 2025
3 checks passed
@ahmadbky ahmadbky deleted the 86-player-of-the-week branch October 22, 2025 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose "map of the week" Add a "player of the week" periodic mechanism

2 participants