feat(champ): stream champion-spawn state to the sidecar board #3
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/champ-spawns"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds a live champion-spawn board to the link. Champion spawns have no ServUO
EventSink, so this adds a fourth polled stream (BridgeChamps) modeled on the existingBridgeSweeps: enumerate every spawn each tick, fold it to a small record, and emitchamp.updateonly on change. No core patch — every field used is public.Answers the goal: when/where a spawn is up, its basic details, and whether it's active or on cooldown.
Coverage — three families via a
categoryfieldchampionChampionSpawnrestartAt), level-expiry ETA (expireAt)miniMiniChamp(TerMur)seaBaseSeaChampionhits/hitsMaxand roamsstatusfolds to active / cooldown / dormant. Transient entries (a slain sea boss, a deleted controller) leave the board viachamp.remove. A sidecar (re)connection clears the diff cache so the next sweep re-emits the full board, rebuilding a sidecar that restarted on its own.Sidecar
champscurrent-state table (one row per serial), fed bychamp.update(upsert) andchamp.remove(delete).GET /champsreturns the live board (served from SQLite — no shard round-trip, survives shard outage).ChampSweepSecondsconfig (default 10s), wired into[bridge reload/sweepnow/status.Files
overlay/Scripts/Custom/Bridge/BridgeChamps.cs(new) — the sweep.overlay/Scripts/Custom/Bridge/{BridgeConfig,BridgeBoot}.cs,overlay/Config/Bridge.cfg— config + command wiring.sidecar/src/{store,main,web}.rs— board table, event folding, endpoint.docs/INTEGRATION.md— documentedchamp.update/champ.removeevents andGET /champs.Verification
cargo build+cargo testclean.BridgeChamps.csisolate-compiled against the realServUO.exe+Scripts.dll— the only errors were the twoChampSweepSecondsreferences (expected; the deployed DLL predates the config change and compiles together in a real deploy).ChampionSpawn,MiniChamp,MiniChampInfo,BaseSeaChampionand all members resolved.champ.updatelines over a simulated shard socket → all three categories appeared on/champs; a same-serial update upserted in place (no dupes);champ.removedropped the slain sea boss (3 → 2 rows); unauthenticated request → 401.🤖 Generated with Claude Code
Champion spawns have no ServUO EventSink, so add a fourth polled stream (BridgeChamps) modeled on BridgeSweeps: enumerate every spawn each tick, fold to a small record, and emit champ.update only on change. No core patch — every field used is public. Covers all three families via a `category` field: - champion: ChampionSpawn (type/level/kills/boss/cooldown ETA) - mini: MiniChamp (type/level; auto-restarts, no kill counter) - sea: BaseSeaChampion (a High Seas world-boss mobile, alive only while summoned; removed via champ.remove when slain) Status folds to active/cooldown/dormant. A (re)connection clears the diff cache so the next sweep re-emits the full board, rebuilding a sidecar that restarted on its own. Transient entries leave via champ.remove. Sidecar: a `champs` current-state table (one row per serial) fed by champ.update (upsert) and champ.remove (delete), exposed at GET /champs as the live board. New ChampSweepSeconds config (default 10s), wired into [bridge reload/sweepnow/status. Documented in docs/INTEGRATION.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0114TpmrNW4wNXsHq5CR72jQ