don't wake up round actors without a good reason - fixes #558
This commit is contained in:
parent
0d3ee94abc
commit
f67e3dda94
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue