disable simul support in tournament games

This commit is contained in:
Thibault Duplessis 2015-01-05 13:43:19 +01:00
parent 713c5974de
commit 6bd7b256e0
3 changed files with 4 additions and 3 deletions

View file

@ -54,7 +54,7 @@ object Round extends LilaController with TheftPrevention {
PreventTheft(pov) {
(pov.game.tournamentId ?? TournamentRepo.byId) zip
Env.game.crosstableApi(pov.game) zip
otherPovs(pov.gameId) flatMap {
(!pov.game.isTournament ?? otherPovs(pov.gameId)) flatMap {
case ((tour, crosstable), playing) =>
Env.api.roundApi.player(pov, Env.api.version, playing) map { data =>
Ok(html.round.player(pov, data, tour = tour, cross = crosstable, playing = playing))

View file

@ -62,7 +62,8 @@ final class JsonView(
"check" -> game.check.map(_.key),
"rematch" -> game.next,
"source" -> game.source.map(sourceJson),
"status" -> statusJson(game.status)),
"status" -> statusJson(game.status),
"tournamentId" -> game.tournamentId),
"clock" -> game.clock.map(clockJson),
"correspondence" -> game.correspondenceClock.map(correspondenceJson),
"player" -> Json.obj(

View file

@ -34,7 +34,7 @@ module.exports = function(ctrl, key) {
}.bind(this);
this.next = function(id) {
if (!this.value || ctrl.data.player.spectator || game.isPlayerTurn(ctrl.data)) return;
if (!this.value || ctrl.data.player.spectator || ctrl.data.game.tournamentId || game.isPlayerTurn(ctrl.data)) return;
if (id) goToId(id);
else xhr.next(ctrl).then(function(data) {
if (data.next) goToId(data.next);