Skip to content

feat(navigator): show the player count per mode - #417

Merged
TheMeinerLP merged 1 commit into
mainfrom
feat/navigator-player-counts
Oct 12, 2026
Merged

TheMeinerLP merged 1 commit into
mainfrom
feat/navigator-player-counts

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Contributor

What

Every navigator entry now shows N online as a lore line: the players currently on that mode's CloudNet task, summed over its running services.

  • Source: the existing PlayerCounts bean (count(TASK, name), which HolderPlayerCounts sums over running services). Injected as Optional<PlayerCounts>, so the navigator still works without a provider.
  • Refresh: a Minestom scheduler task every navigator.refreshSeconds (new navigator.yaml, default 5, validated 1..3600 like lobbyswitcher.refreshSeconds). The read runs on a virtual thread, skipped while the previous one is running; the stacks are updated in place on the next tick, for both the public and the team inventory. The task is cancelled in @PreDestroy.
  • Unknown count (no provider, task not running, lookup failed) omits the line instead of showing 0. A running task with nobody on it shows 0 online.
  • Layout rebuilds (applyLayoutIfChanged) and click handling are unchanged; rebuilt layouts reuse the last known counts.
  • The architecture rule that forbade io.avaje.config in the navigator now allows it for NavigatorSettings only.

Tests

Unit tests for the lore (known/zero/unknown), TaskPlayers and the settings; Minestom Env tests with a fake PlayerCounts that drive the refresh with explicit ticks (first read, update after one period, unknown, stop, click still works).

https://claude.ai/code/session_01GXose9rakuRNZoM3TP3xj1

@TheMeinerLP
TheMeinerLP requested a review from a team as a code owner October 11, 2026 21:02
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Test results

  894 files    894 suites   41m 38s ⏱️
2 401 tests 2 399 ✅  2 💤 0 ❌
7 231 runs  7 148 ✅ 83 💤 0 ❌

Results for commit 2100dcd.

♻️ This comment has been updated with latest results.

Each navigator entry gets a lore line with the players currently on its
CloudNet task, read through the existing PlayerCounts bean and refreshed
every navigator.refreshSeconds (default 5). Unknown counts add no line.

Claude-Session: https://claude.ai/code/session_01GXose9rakuRNZoM3TP3xj1
@TheMeinerLP
TheMeinerLP force-pushed the feat/navigator-player-counts branch from 2994648 to 2100dcd Compare October 12, 2026 19:27
@TheMeinerLP
TheMeinerLP merged commit 5a3efd8 into main Oct 12, 2026
7 checks passed
@TheMeinerLP
TheMeinerLP deleted the feat/navigator-player-counts branch October 12, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant