disable simul support in tournament games
This commit is contained in:
parent
713c5974de
commit
6bd7b256e0
|
@ -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))
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue