Add game performance leaderboard with fair scoring system#352
Merged
Conversation
Co-authored-by: Pierre-Demessence <1756398+Pierre-Demessence@users.noreply.github.com>
Co-authored-by: Pierre-Demessence <1756398+Pierre-Demessence@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Leaderboard of players
Add game performance leaderboard with fair scoring system
Jul 26, 2025
- 🔧 Mark UserID as required in CasinoUser and TokenTransaction classes - 🔄 Change Details and DetailsJson properties to nullable types - 📊 Update GameStatistics and GameLeaderboard methods to handle nullable game names - 🗑️ Remove redundant GameLeaderboard and GameStatistics methods from CasinoSlashModule.cs - 🔍 Refactor CapitalizeWords method for better readability
There was a problem hiding this comment.
Pull Request Overview
This PR implements a new game performance leaderboard feature that provides a fair ranking system for casino players by combining win rate with game volume using a logarithmic scoring formula. The new /casino tokens game-leaderboard command shows top performers either globally or for specific games.
- Adds
GetGameLeaderboard()service method with fair scoring algorithm (winrate × log₁₀(totalGames + 1)) - Implements new
/casino leaderboardslash command with optional game filtering - Creates
GameLeaderboardEntrydomain model for leaderboard data structure
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| CasinoService.cs | Adds new GetGameLeaderboard() method and updates method signatures to use nullable parameters |
| CasinoSlashModule.cs | Removes old statistics command and helper method (moved to Games module) |
| CasinoSlashModule.Games.cs | Adds new leaderboard command, moves statistics command from main module, and adds helper methods |
| CasinoUser.cs | Adds GameLeaderboardEntry model and updates existing models with nullable reference types |
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.
This PR implements a new game leaderboard feature that combines aspects of the existing token leaderboard and individual statistics commands to show the best performing players across casino games.
New Command
/casino tokens game-leaderboard [game]Key Features
Fair Scoring Formula
Uses
winrate × log₁₀(totalGames + 1)to rank players, which solves the core issue where players with just 1 game and 100% winrate would dominate leaderboards. The logarithmic scaling rewards both skill and game volume:Rich Display
Shows top 10 players with:
Example Output
Implementation Details
CasinoService.GetGameLeaderboard()aggregates user statistics across all usersGameLeaderboardEntrystores calculated scores and performance metricsTesting
Fixes #350.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.