mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
Phase D: presence intent comment + sendZoneCombatMessages contract
D1: single block comment above the presence.go best-effort QueryRow cluster (lines 149-198). Zero-value fallbacks are correct for new users with no activity rows yet. D2: contract comment on sendZoneCombatMessages — returns a done channel, callers chaining post-flush work MUST consume it; in-flow handlers with nothing to chain MUST explicitly discard. Blocking on flush would stall command handlers behind the 2-3s/message pacing, defeating streaming. Two fire-and-forget sites (adventure_arena.go round-advance, dnd_zone_cmd.go streamFlow) now use `_ =` + comment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -244,6 +244,13 @@ func (p *AdventurePlugin) sendCombatMessages(userID id.UserID, phaseMessages []s
|
||||
|
||||
// sendZoneCombatMessages is the zone/expedition variant — same staging as
|
||||
// arena, but tighter pacing (2–3s) so dungeon advances feel snappier.
|
||||
//
|
||||
// Contract: returns a done channel that closes after the final DM has
|
||||
// been sent. Callers that need to chain post-flush work (death follow-ups,
|
||||
// hospital ads, tier countdowns) MUST consume it. Callers in the middle
|
||||
// of a command-handler flow that have no post-flush work should explicitly
|
||||
// discard with `_ = ...` — blocking on flush would stall the handler
|
||||
// behind the 2–3s/message pacing, which is the whole point of streaming.
|
||||
func (p *AdventurePlugin) sendZoneCombatMessages(userID id.UserID, phaseMessages []string, finalMessage string) <-chan struct{} {
|
||||
return p.sendCombatMessagesWithDelay(userID, phaseMessages, finalMessage, 2, 2) // 2–3s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user