Skip to content

Commit

Permalink
dedup game end event in bot/board API - closes #61
Browse files Browse the repository at this point in the history
ignore the move event if the game is finished,
because we also get a FinishGame event then.
  • Loading branch information
ornicar committed Sep 24, 2020
1 parent 63a9680 commit d9a8f7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/bot/src/main/GameStateStream.scala
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ final class GameStateStream(
}

def receive = {
case MoveGameEvent(g, _, _) if g.id == id => pushState(g)
case MoveGameEvent(g, _, _) if g.id == id && !g.finished => pushState(g)
case lila.chat.actorApi.ChatLine(chatId, UserLine(username, _, text, false, false)) =>
pushChatLine(username, text, chatId.value.lengthIs == Game.gameIdSize)
case FinishGame(g, _, _) if g.id == id => onGameOver(g.some)
Expand Down

0 comments on commit d9a8f7a

Please sign in to comment.