Repository navigation
Count and list players across every region of a shard group - #103
Merged
Merged
Conversation
region_group points a server at a Civ13 shard group file; every other region is watched under its group name and follows the file. The status and current-round embeds show one Online Players field grouped by region, each ckey once; travellers listed twice go to their new region and ones listed nowhere stay counted for 30 s under Between regions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WTP2QKpudxeZ6grywgxcm
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Member
Author
|
2026-11-15: merged at eea2c7b (squash ddd18c8) after local checks on PHP 8.3: heartbeat-roster, heartbeat-integration, heartbeat, heartbeat-playercount, windows/portable, play-link, core-gameserver-fixes, server-compatibility, controls, shard-region, run, lifecycle-consumers and restart-command all pass. CI on the merged head is being watched. Not verified on the live bot: it takes effect once the bot is updated and Generated by Claude Code |
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.
Requested by Val · project thread
Summary
The Persistence embed in the player-count channel (#pers-N) only counted the world the bot is configured for (North America), so players on Gaia, Europe, Asia and the other earth regions were missing from both the count and the list.
region_group: the absolute path of the Civ13 shard group file (for exampleD:/Civ13Regions/earth.json). Every region in it (<root>/<id>) other than the server's own world gets a passive heartbeat under its group name. The list follows the file (re-read when it changes), so a new region shows up without a bot restart.shardsstill works and can be combined.RegionRoster: one group-wide roster from the heartbeats. Each ckey counts once. A traveller still listed by the region they left goes under the region they moved to; one listed by no region stays counted under Between regions for 30 s (the game writes serverdata every 10 s, the bot samples every 15 s), so trips never drop the count. When every world is down nobody is listed.Online Players (N)with one line per region (**Gaia** (2): alice, bob), also when the bot's own world is down but other regions run. Over 1024 characters it falls back to per-region counts. The player-count channel name uses the same roster.PortableProfilevalidatesregion_group(existing absolute file).Tests
php tests/local/heartbeat-roster.php(new): grouping, double-listed travellers, between-regions grace and expiry, all-down, escaping, oversize fallback.php tests/local/heartbeat-integration.php: group file watched by name, bad ids ignored, both embeds list players by region, removed region unwatched.php tests/local/heartbeat.php,heartbeat-playercount.php,tests/windows/portable.php, plusplay-link,core-gameserver-fixes,server-compatibility,controls,shard-region,run,lifecycle-consumers,restart-commandall pass (PHP 8.3).Not verified: the live bot on the host. Taking effect needs the bot updated and
"region_group": "D:/Civ13Regions/earth.json"added to the test1714 server in the local profile.Generated by Claude Code