feat: Leaderboard configurable - ordenamiento, tamaño, posición del jugador#12
Closed
michumichifu wants to merge 1 commit into
Closed
feat: Leaderboard configurable - ordenamiento, tamaño, posición del jugador#12michumichifu wants to merge 1 commit into
michumichifu wants to merge 1 commit into
Conversation
- Leaderboard sort criteria now configurable via config.yml (sort-by, tiebreaker) Default: level DESC, xp DESC (current season progress, not cumulative total_levels) - Leaderboard size configurable (default 20, max 27) - was hardcoded to 10 - Added min-level filter to exclude inactive players from leaderboard - Added "Your Rank" item (RECOVERY_COMPASS, slot 31) showing player's position even if not in top - Added XP progress bar visualization in leaderboard player lore - New getPlayerRankInfo() method uses efficient COUNT query instead of loading all top players - Option to reset total_levels on season end (reset-total-levels-on-season-end) - resetSeason() now optionally resets total_levels in DB (fixes stale cumulative rankings) Fixes: Leaderboard was sorted by total_levels (cumulative, never reset) making veteran players permanently dominate the top regardless of current season activity. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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.
Resumen
El leaderboard actualmente ordena por
total_levels, un contador acumulativo que nunca se resetea al cambiar de temporada. Esto hace que los jugadores veteranos ocupen permanentemente las primeras posiciones sin importar su actividad en la temporada actual, anulando el propósito de los resets de temporada.Este PR agrega configurabilidad completa al leaderboard y corrige el comportamiento del reset de temporada.
Cambios
Ordenamiento configurable del leaderboard (
config.yml):Posición del jugador: Nuevo item "Tu Posición" (RECOVERY_COMPASS, slot 31) que muestra a cada jugador su posición en el ranking aunque no esté en el top. Usa una query eficiente con
COUNT(*)en vez de cargar todos los jugadores del top.Barra de progreso XP: Barra visual en el lore de cada jugador mostrando su progreso de XP hacia el siguiente nivel.
Corrección del reset de temporada:
resetSeason()ahora opcionalmente reseteatotal_levelsa 0 cuandoreset-total-levels-on-season-end: true, para que el leaderboard refleje correctamente la actividad de la temporada actual.El problema (antes de este PR)
Con
sort-by: levelyreset-total-levels-on-season-end: true, el leaderboard refleja correctamente quién está jugando la temporada actual.Retrocompatible