Two-tier inactivity: mutual idle blocks force-concede at 10 min

Tier 1 (5 min, unchanged):
- Active player: game.inactive_warning — "you may be forfeited"
- Waiting player: game.opponent_inactive — "Accept Forfeit / Wait"

Tier 2 (10 min — mutual idle):
- If the game is still stalled after 10 min the waiting player also
  hasn't claimed forfeit, so both are treated as mutually idle
- Sends game.both_idle_warning to BOTH players
- Client closes any open tier-1 dialogs and shows "Wait" only —
  no concede or force-concede available
- Prevents the tactic of both players going idle to pressure the
  other into conceding

Monitor service now prunes notified sets on each poll so sessions
that become active again can be re-notified if they stall again.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-03-21 06:16:13 -04:00
co-authored by Claude Happy
parent 6de3e6b79d
commit c93aaf64c0
4 changed files with 103 additions and 36 deletions
+10
View File
@@ -33,6 +33,10 @@ signal opponent_inactive(session_id: String)
## Show a warning — the opponent may accept a forfeit.
signal inactive_warning(session_id: String)
## Emitted when both players have been idle for 10 minutes (mutual idle).
## Both players must wait — no concede or force-concede is allowed.
signal both_idle_warning(session_id: String)
# ── State ─────────────────────────────────────────────────────────────────────
var session_id : String = ""
@@ -345,3 +349,9 @@ func _on_server_push(type: String, payload: Variant) -> void:
var sid : String = str(d.get("sessionId", ""))
print("[Game] PUSH inactive_warning session=", sid)
inactive_warning.emit(sid)
"game.both_idle_warning":
var d := payload as Dictionary
var sid : String = str(d.get("sessionId", ""))
print("[Game] PUSH both_idle_warning session=", sid)
both_idle_warning.emit(sid)