Commit graph

9 commits

Author SHA1 Message Date
9c47bac33a Fix setup registration: names appear as each player joins
Parser: detect name registration from user input during setup
(sender == name constraint prevents false matches on gameplay messages).

Bridge: extract _process_buffer() to handle leftover lines after
_wait_for_players returns, preventing messages from being stuck.

Player bots: proactively send name on join (not just first player
sending count) so they respond even if they missed the 'say me' prompt.

All tests pass (1551/1553 parser checkpoints, 38 player unit tests).
2026-02-21 11:54:53 +00:00
7a4346a53f Fix trade race condition: move trade/roll decision to -- Command: handler
The root cause: checkpoint handler queued .trade via say_delayed, but
monop sends '-- Command:' before processing the trade. The old handler
reset in_trade and queued .roll, so both commands got sent.

Fix: checkpoint handler no longer sends commands. The -- Command:
prompt is where the bot decides to trade or roll, matching how monop
actually works (-- Command: is the interactive prompt).

Also: no trades while in jail (jail has no -- Command: before roll).

Updated all tests to reflect the new flow.
2026-02-21 10:55:33 +00:00
8bbadba7d9 Fix trade-in-jail bug: jail handler must not roll during active trade
Added guard in jail turn handler to skip rolling when in_trade is True.
The roll happens later when '-- Command:' arrives after trade completes.

Added 5 regression tests for the exact failing sequence.
2026-02-21 10:45:15 +00:00
d31a09e754 Fix trade logic in player bots
- Handle 'Which player do you wish to trade with?' prompt when
  in_trade is True (was silently returning, causing bot to roll
  during an active trade prompt)
- Simplify property trade offers to always say 'done' (cash-only
  trades) to avoid getting stuck on property list prompts
2026-02-21 10:42:57 +00:00
c8e5a83010 Add unit tests for autopilot players (32 tests), fix trade force=True and duplicate handler 2026-02-21 09:53:09 +00:00
0af3184590 Add random trading (~10% chance per turn, 50/50 accept/reject) 2026-02-21 09:46:29 +00:00
775bbde030 Fix mortgage flow: send ? for property list, done when solvent 2026-02-21 09:23:33 +00:00
2ffd7c3845 Add Cardinal player plugin + fix autopilot: force setup responses, suppress out-of-turn rolls, fix tax input, fix double-roll from -- Command handler 2026-02-21 09:17:42 +00:00
5aa96d2163 Add standalone autopilot players script 2026-02-21 08:57:10 +00:00