Fix outOfTime messages from spectators
This commit is contained in:
parent
c943a445cb
commit
babc478a85
|
@ -109,10 +109,14 @@ private[round] final class Round(
|
|||
}
|
||||
}
|
||||
|
||||
case Outoftime(playerId) => handle(playerId) { pov =>
|
||||
case Outoftime(Some(playerId)) => handle(playerId) { pov =>
|
||||
pov.game.outoftime(withGrace = !pov.isMyTurn) ?? finisher.outOfTime(pov.game)
|
||||
}
|
||||
|
||||
case Outoftime(None) => handle { game =>
|
||||
game.outoftime(withGrace = true) ?? finisher.outOfTime(game)
|
||||
}
|
||||
|
||||
// exceptionally we don't block nor publish events
|
||||
// if the game is abandoned, then nobody is around to see it
|
||||
// we can also terminate this actor
|
||||
|
|
|
@ -49,7 +49,7 @@ private[round] final class SocketHandler(
|
|||
member.playerIdOption.fold[Handler.Controller](({
|
||||
case ("p", o) => ping(o)
|
||||
case ("talk", o) => o str "d" foreach { messenger.watcher(gameId, member, _) }
|
||||
case ("outoftime", _) => send(Outoftime)
|
||||
case ("outoftime", _) => send(Outoftime(None))
|
||||
}: Handler.Controller) orElse evalCacheHandler(member, me) orElse lila.chat.Socket.in(
|
||||
chatId = s"$gameId/w",
|
||||
member = member,
|
||||
|
@ -88,7 +88,7 @@ private[round] final class SocketHandler(
|
|||
case ("draw-force", _) => send(DrawForce(playerId))
|
||||
case ("abort", _) => send(Abort(playerId))
|
||||
case ("moretime", _) => send(Moretime(playerId))
|
||||
case ("outoftime", _) => send(Outoftime(playerId))
|
||||
case ("outoftime", _) => send(Outoftime(playerId.some))
|
||||
case ("bye2", _) => socket ! Bye(ref.color)
|
||||
case ("talk", o) => o str "d" foreach { messenger.owner(gameId, member, _) }
|
||||
case ("hold", o) => for {
|
||||
|
|
|
@ -129,7 +129,7 @@ package round {
|
|||
case class TakebackYes(playerId: String)
|
||||
case class TakebackNo(playerId: String)
|
||||
case class Moretime(playerId: String)
|
||||
case class Outoftime(playerId: String)
|
||||
case class Outoftime(playerId: Option[String])
|
||||
case object Abandon
|
||||
case class ForecastPlay(lastMove: chess.Move)
|
||||
case class Cheat(color: Color)
|
||||
|
|
Loading…
Reference in a new issue