feat: Bridge & CTF games, player SDK, docs site, game tests, tournament game_type#73
Merged
feat: Bridge & CTF games, player SDK, docs site, game tests, tournament game_type#73
Conversation
…Beacon plugin Phase 0 — Beacon rearchitecture: - Split MatchPollingService (744→393 lines) into MatchInitializer, MatchWorldManager - Remove all legacy fallback code from MatchPollingService and MatchEventListener - Wire EntityDamageByEntityEvent through BaseGame.handleDamage() Phase 0.5 — Public /docs route: - Add 10-page docs site at /docs with sidebar navigation - Covers getting started, bot API reference, game rules (PvP, Bridge, CTF), tournaments, and FAQ - Add "Docs" link to landing page navbar Phase 1 — Player SDK: - Create @blockwarriors/sdk with Strategy pattern API wrapping BotClient - Add starter-bot template with single-bot and multi-bot launchers - Create bot-client and game-tests packages Phase 2 — Bridge game (1v1): - Two platforms over void, build across, score by entering enemy goal zone - First to 5 wins, 5-minute time limit with sudden death Phase 3 — CTF game (4v4): - Flag pickup/carry/drop/capture/return mechanics - 80x80 arena with team bases and mid-field cover - 5-second respawn, 30-second disconnect grace period - First to 3 captures wins, 8-minute time limit - Update CTF config from 5v5 to 4v4 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…x match lifecycle Game tests: - Add forfeit-based test scenarios for PvP, Bridge, CTF (deterministic, <60s each) - Add tournament flow test verifying game_type propagation and token counts - Add process-level error handler for bot keepalive timeouts - All 4 tests pass: pvp-1v1 (37s), bridge-1v1 (49s), ctf-4v4 (102s), tournament-flow (24s) Arena building: - Add WorldEdit 7.4.0 dependency (provided scope) with SchematicLoader utility - BaseGame.loadArena() tries schematic first, falls back to programmatic generation - Catch NoClassDefFoundError when WorldEdit not installed on server - Improve Bridge arena (checkerboard floor, goal arches, pillars) - Reduce CTF arena from 80x80 to 50x50 with staggered player teleports - Add simple PvP arena platform at y=64 Tournament flow: - Add game_type field to tournaments schema - createTournament accepts gameType parameter (pvp, bridge, ctf) - createTournamentGame resolves "auto" matchType from tournament's game_type - Add Game Type selector to tournament creation UI - Fix hardcoded 'pvp' in tournament match detail page - Add winner_team_id support to match update API Match lifecycle fixes: - Fix match never finishing: Convex HTTP handler was passing undefined fields - Fix disconnect during countdown ignored: use hasEnded() instead of isActive() - Fix CTF both-teams-disconnect hanging forever: terminate match - Store team IDs on MatchManager for winner team resolution - Increase bot keepalive timeout to 180s Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fixes CI lint failure: 'CodeBlock' is defined but never used. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use explicit typed object instead of Record<string, unknown> to satisfy Convex mutation type constraints while still excluding undefined fields. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tead) The node CI job doesn't have Java installed, so mvn test fails. The beacon CI job already runs the full Maven build with tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
Self-ReviewAll CI checks pass (node, beacon, GitGuardian). Merging to staging. Verified:
Key decisions:
Note for @DIodide: Please verify the 2 manual items before promoting to main:
|
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.
Summary
Major platform update adding two new game types, a player-facing SDK, documentation site, comprehensive game tests, arena building infrastructure, and tournament game type support.
New Game Types
Beacon Plugin Rearchitecture
MatchPollingService(744→393 lines) intoMatchInitializer,MatchWorldManager, and focused pollingMatchPollingServiceandMatchEventListenerEntityDamageByEntityEventthroughBaseGame.handleDamage()SchematicLoaderfor WorldEdit.schemfile loading (with programmatic fallback when WorldEdit not installed)winner_team_idresolution inMatchManager.endMatch()for reliable Convex updatesPlayer SDK (
@blockwarriors/sdk)BotClient— players implementonSpawn,onTick,onDeath,onDamage,onChatbot-clientpackage extracted from bot-orchestratorDocumentation Site (
/docs)/docswith sidebar navigationGame Tests (
packages/game-tests)pvp-1v1(37s) — Blue attacks, red forfeits → blue winsbridge-1v1(49s) — Blue plays, red forfeits → blue winsctf-4v4(102s) — 8 bots spawn, red team forfeits → blue winstournament-flow(24s) — Creates tournament with game_type, verifies bridge/CTF token countsTournament Game Type Support
game_typefield totournamentsschemacreateTournamentacceptsgameTypeparameter (pvp, bridge, ctf)createTournamentGameresolvesmatchType: "auto"from tournament'sgame_type'pvp'in tournament match detail page and HTTP endpointwinner_team_iddirect support in match update APIArena Building Infrastructure
SchematicLoaderutilityBaseGame.loadArena()— schematic-first with programmatic fallbacksoftdepend: [WorldEdit, FastAsyncWorldEdit]in plugin.ymlNoClassDefFoundErrorhandling when WorldEdit not installedConfig Changes
tokensPerTeam: 4)Test Plan
npm run test:game— all 4 scenarios pass (pvp-1v1, bridge-1v1, ctf-4v4, tournament-flow)mvn clean package— Java BUILD SUCCESSnpx tsc --noEmit -p packages/game-tests/tsconfig.json— TypeScript cleannpm run deploy:beacon— deploys and server restarts successfully/docspages render correctly on web🤖 Generated with Claude Code