mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
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:
@@ -971,6 +971,12 @@ func (p *HoldemPlugin) broadcastDM(game *HoldemGame, msg string) {
|
|||||||
if pl.IsNPC || pl.State == PlayerSatOut {
|
if pl.IsNPC || pl.State == PlayerSatOut {
|
||||||
continue
|
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)
|
p.SendMessage(pl.DMRoomID, msg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user