Hold'em: deduplicate broadcast in solo-vs-bot games

Win/end announcements were sent twice in solo-vs-bot: once via
SendMessage(game.RoomID, ...) for the public room, once via broadcastDM
which iterated the human player's DMRoomID — but in solo-vs-bot the
game.RoomID IS the player's DM. Skip players whose DMRoomID matches
game.RoomID in broadcastDM so the room post isn't echoed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-04-26 20:38:16 -07:00
parent a1ede53fa9
commit 9d949dc649

View File

@@ -971,6 +971,12 @@ func (p *HoldemPlugin) broadcastDM(game *HoldemGame, msg string) {
if pl.IsNPC || pl.State == PlayerSatOut {
continue
}
// Skip players whose DM room IS the game room — they already saw
// the message via the public-room post (solo-vs-bot case, where
// game.RoomID == player's DM).
if pl.DMRoomID == game.RoomID {
continue
}
p.SendMessage(pl.DMRoomID, msg)
}
}