only flag with the WS event

that was causing a race condition,
the game page would be loaded with the old ongoing game data,
but the new socket version from after the game was ended.
This commit is contained in:
Thibault Duplessis 2019-12-16 09:55:15 -06:00
parent 468056dcf2
commit ebc3690a07
2 changed files with 0 additions and 7 deletions

View file

@ -75,7 +75,6 @@ final class Round(
def player(fullId: String) = Open { implicit ctx => def player(fullId: String) = Open { implicit ctx =>
OptionFuResult(env.round.proxyRepo.pov(fullId)) { pov => OptionFuResult(env.round.proxyRepo.pov(fullId)) { pov =>
env.round.checkOutoftime(pov.game)
renderPlayer(pov) renderPlayer(pov)
} }
} }
@ -133,7 +132,6 @@ final class Round(
Redirect(routes.Round.watcher(gameId, "white")).fuccess Redirect(routes.Round.watcher(gameId, "white")).fuccess
} }
case None => { case None => {
env.round.checkOutoftime(pov.game)
watch(pov) watch(pov)
} }
} }

View file

@ -182,11 +182,6 @@ final class Env(
val tvBroadcast = system.actorOf(Props(classOf[TvBroadcast])) val tvBroadcast = system.actorOf(Props(classOf[TvBroadcast]))
def checkOutoftime(game: Game): Unit = {
if (game.playable && game.started && !game.isUnlimited)
tellRound(game.id, actorApi.round.QuietFlag)
}
def resign(pov: Pov): Unit = def resign(pov: Pov): Unit =
if (pov.game.abortable) tellRound(pov.gameId, Abort(pov.playerId)) if (pov.game.abortable) tellRound(pov.gameId, Abort(pov.playerId))
else if (pov.game.resignable) tellRound(pov.gameId, Resign(pov.playerId)) else if (pov.game.resignable) tellRound(pov.gameId, Resign(pov.playerId))