Skip to content

Add Player Count support with configurable intervals and integration#21

Open
FllipEis wants to merge 2 commits into
feat/platform-reworkfrom
fix/player-count
Open

Add Player Count support with configurable intervals and integration#21
FllipEis wants to merge 2 commits into
feat/platform-reworkfrom
fix/player-count

Conversation

@FllipEis

@FllipEis FllipEis commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What this pull request does

This pull request adds configurable Player Count support to Proxy Essentials. Instead of only showing the local proxy's current player count, the plugin can now calculate a summed count from the current SimpleCloud group and optional additional targets.

The new player-count configuration allows server owners to include extra SimpleCloud groups and persistent servers in the displayed online/max player count. That calculated count is then used for server-list ping responses and the default player-count placeholders used by MOTD, tablist, and related text rendering.

Why this is needed

In a SimpleCloud setup, the visible Minecraft server list count should often represent more than one local proxy instance. Networks may split players across multiple groups or persistent servers, so using only the proxy's direct player count can make the server appear less populated or inconsistent with the actual network state.

This change makes the displayed player count configurable and closer to the intended network-wide view while still preserving the existing local proxy count as a fallback.

Original changes in this pull request

  • Added a new player-count section to the default BungeeCord and Velocity configs.
  • Added PlayerCountConfig to the shared configuration model.
  • Added PlayerCountHandler, which periodically reads SimpleCloud group/server player counts and stores a snapshot.
  • Added Cloud API helper methods for resolving servers by ID and persistent server names.
  • Updated BungeeCord and Velocity ping listeners to use the calculated player count.
  • Updated placeholder resolver setup so <online_players> and related values can use the calculated count.
  • Added legacy config migration support for the new player-count defaults.

Follow-up changes added now

After reviewing the first version, I added a hardening commit to make the feature safer and clearer before merge.

  • Added player-count.enabled so the summed player-count feature can be explicitly disabled.
  • Changed update-time: 0 to disable automatic syncing instead of being coerced to a 1-tick update loop. This avoids accidental high-frequency Cloud API polling.
  • Added an additive config migration pass for existing config.yml files, so current installs receive the new player-count section or missing enabled key even when they are not using the old split config files.
  • Updated the default BungeeCord and Velocity config comments to document the new enabled flag and the update-time: 0 behavior.

These follow-up changes keep the feature behavior predictable for existing users and avoid surprising runtime behavior when the update interval is set to zero.

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.

2 participants