{master} in-game simul UI is only for the host
This commit is contained in:
parent
2f3124bf2d
commit
d52b9a3f67
|
@ -61,7 +61,7 @@ object Round extends LilaController with TheftPrevention {
|
|||
simul foreach Env.simul.api.onPlayerConnection(pov.game, ctx.me)
|
||||
Ok(html.round.player(pov, data,
|
||||
tour = tour,
|
||||
simul = simul,
|
||||
simul = simul.filter(_ isHost ctx.me),
|
||||
cross = crosstable,
|
||||
playing = playing,
|
||||
chatOption = chatOption,
|
||||
|
|
|
@ -109,7 +109,8 @@ case class Simul(
|
|||
|
||||
def variantRich = variants.size > 3
|
||||
|
||||
def isHost(userOption: Option[User]) = userOption ?? (_.id == hostId)
|
||||
def isHost(userOption: Option[User]): Boolean = userOption ?? isHost
|
||||
def isHost(user: User): Boolean = user.id == hostId
|
||||
|
||||
def playingPairings = pairings filterNot (_.finished)
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ final class SimulApi(
|
|||
}
|
||||
|
||||
def onPlayerConnection(game: Game, user: Option[User])(simul: Simul): Unit = {
|
||||
user.filter(_.id == simul.hostId) ifTrue simul.isRunning foreach { host =>
|
||||
user.filter(simul.isHost) ifTrue simul.isRunning foreach { host =>
|
||||
repo.setHostGameId(simul, game.id)
|
||||
sendTo(simul.id, actorApi.HostIsOn(game.id))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue