Skip to content

[Feat] Faction Leaderboard #67

@derrickmehaffy

Description

@derrickmehaffy

Scope

A leaderboard system for ranking factions by configurable criteria, with both command and GUI support.

  1. Command-based leaderboard view (e.g., /f leaderboard [criteria] or /f top)
  2. GUI page with sorting and pagination
  3. Configurable ranking criteria: power, territory count, treasury balance, member count
  4. Pagination for large server populations

Implementation Details

Data access already available:

  • FactionManager.getAllFactions() — returns Collection<Faction> (line 346-354)
  • PowerManager.getFactionPower(factionId) / getFactionMaxPower()
  • faction.getClaimCount() — territory count
  • faction.getMemberCount() — member count
  • faction.economy().balance() — treasury balance
  • faction.createdAt() — faction age

Reference implementations for sorting/pagination:

  • FactionBrowserPage.java (lines 197-200) — sorts by POWER, MEMBERS, NAME
  • NewPlayerBrowsePage.java (lines 226-229) — similar sorting pattern
  • AdminEconomyPage.java (lines 214-219) — sorts by BALANCE, NAME, MEMBERS

Suggested command: /f leaderboard [power|territory|balance|members] (default: power)

GUI approach:

  • Create FactionLeaderboardPage.java extending InteractiveCustomUIPage<FactionLeaderboardData>
  • Reuse sorting patterns from FactionBrowserPage
  • Register in FactionPageRegistry.java
  • Support sort mode toggle (dropdown or cycle button)
  • 10 entries per page with pagination controls

Risks and Alternatives

  1. Performance consideration with many factions — should cache/sort periodically rather than on each request
  2. Could optionally expose as placeholders too (e.g., %hyperfactions_leaderboard_1_name%)
  3. Alternative: text-only command output without GUI page (simpler, faster)

References and Media

Similar to FactionsUUID /f top command. GUI pattern follows existing FactionBrowserPage.java implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions