Skip to content

Keep the serverinfo timer and round embed alive when verification is unavailable - #39

Merged
valzargaming merged 1 commit into
mainfrom
claude/serverinfo-timer-no-crash
Oct 29, 2026
Merged

valzargaming merged 1 commit into
mainfrom
claude/serverinfo-timer-no-crash

Conversation

@valzargaming

@valzargaming valzargaming commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #38. After deploying #38 (5c6e2b8) the portable bot still died within 3 minutes with a player connected:

PHP Fatal error:  Uncaught Civ13\Exceptions\VerifierException: Hosted verification unavailable in src/Civ13/Verifier.php:1187
#0 src/Civ13/Verifier.php(1052): Civ13\Verifier->get('ss13', 'valzargaming')
#1 src/Civ13/Civ13.php(1889): Civ13\Verifier->getVerifiedItem('valzargaming')
#2 src/Civ13/Moderator.php(138): Civ13\Civ13->ckeyinfo('valzargaming')
#3 src/Civ13/GameServer.php(510): Civ13\Moderator->scrutinizeCkey('valzargaming')

scrutinizeCkey() also reaches Verifier::get() through Civ13::ckeyinfo(), and the serverinfo timer is a plain loop timer, so any throw is fatal.

  • GameServer::serverinfoTimer(): catch any \Throwable per ckey and log a warning, so one player's check can never kill the bot.
  • GameServer::createCurrentRoundEmbedMessageBuilder(): the verified-player list called Verifier::get() inside array_map; while verification is unavailable it threw and the round embed was never built (Could not create a MessageBuilder for test1714). Omit that list instead.

Testing

  • php -l src/Civ13/GameServer.php: no syntax errors.
  • No automated test (GameServer needs a full Civ13 instance). Live check after merge: portable bot stays up across several 180 s serverinfo cycles with a player connected and hosted verification unavailable.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Server status updates now continue when an individual player’s information cannot be checked, so one issue is less likely to interrupt processing.
    • Round summaries can still be generated when verified-player details are unavailable; in that case, the verified-player list is omitted.

…unavailable

#38 caught VerifierException in Moderator's own verifier lookups, but
scrutinizeCkey reaches Verifier::get through Civ13::ckeyinfo() too, and the
plain loop timer turned that throw into a PHP fatal again (2026-10-29 13:19).
Catch any throwable per ckey in the serverinfo timer and log it. The round
embed's verified-player list also threw from the same lookup, so the embed
was never built; omit that list while verification is unavailable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

The server info timer now handles exceptions from player scrutiny by logging a warning and continuing. The round embed builder handles verified-player lookup failures and omits the verified-player field when no IDs are available.

Changes: Verifier failure handling

Layer / File(s) Summary
Handle verifier failures
src/Civ13/GameServer.php
The timer logs the ckey and exception message when scrutiny throws. The embed builder catches VerifierException and adds the verified-player field only when the lookup returns IDs.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Moderate · up to ae9d2

The change keeps the bot and round embed running when verification is unavailable. However, a player who connects during a verification outage is marked as already checked, so alt-ban and IP checks are skipped for them until the bot restarts. Record the player as seen only after the first-time checks finish.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@valzargaming
valzargaming merged commit c21eb26 into main Oct 29, 2026
43 of 44 checks passed
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