don't wake up round actors without a good reason - fixes #558

This commit is contained in:
Thibault Duplessis 2015-06-09 23:34:57 +02:00
parent 0d3ee94abc
commit f67e3dda94
2 changed files with 5 additions and 4 deletions

View file

@ -84,7 +84,7 @@ object Round extends LilaController with TheftPrevention {
def player(fullId: String) = Open { implicit ctx =>
OptionFuResult(GameRepo pov fullId) { pov =>
env.checkOutoftime(pov.gameId)
env.checkOutoftime(pov.game)
renderPlayer(pov)
}
}
@ -133,7 +133,7 @@ object Round extends LilaController with TheftPrevention {
def watcher(gameId: String, color: String) = Open { implicit ctx =>
OptionFuResult(GameRepo.pov(gameId, color)) { pov =>
env.checkOutoftime(pov.gameId)
env.checkOutoftime(pov.game)
watch(pov)
}
}

View file

@ -180,8 +180,9 @@ final class Env(
lazy val tvBroadcast = system.actorOf(Props(classOf[TvBroadcast]))
def checkOutoftime(gameId: String) {
roundMap ! Tell(gameId, actorApi.round.Outoftime)
def checkOutoftime(game: lila.game.Game) {
if (game.playable && game.started && !game.isUnlimited)
roundMap ! Tell(game.id, actorApi.round.Outoftime)
}
}