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) {
|
PreventTheft(pov) {
|
||||||
(pov.game.tournamentId ?? TournamentRepo.byId) zip
|
(pov.game.tournamentId ?? TournamentRepo.byId) zip
|
||||||
Env.game.crosstableApi(pov.game) zip
|
Env.game.crosstableApi(pov.game) zip
|
||||||
otherPovs(pov.gameId) flatMap {
|
(!pov.game.isTournament ?? otherPovs(pov.gameId)) flatMap {
|
||||||
case ((tour, crosstable), playing) =>
|
case ((tour, crosstable), playing) =>
|
||||||
Env.api.roundApi.player(pov, Env.api.version, playing) map { data =>
|
Env.api.roundApi.player(pov, Env.api.version, playing) map { data =>
|
||||||
Ok(html.round.player(pov, data, tour = tour, cross = crosstable, playing = playing))
|
Ok(html.round.player(pov, data, tour = tour, cross = crosstable, playing = playing))
|
||||||
|
|
|
@ -62,7 +62,8 @@ final class JsonView(
|
||||||
"check" -> game.check.map(_.key),
|
"check" -> game.check.map(_.key),
|
||||||
"rematch" -> game.next,
|
"rematch" -> game.next,
|
||||||
"source" -> game.source.map(sourceJson),
|
"source" -> game.source.map(sourceJson),
|
||||||
"status" -> statusJson(game.status)),
|
"status" -> statusJson(game.status),
|
||||||
|
"tournamentId" -> game.tournamentId),
|
||||||
"clock" -> game.clock.map(clockJson),
|
"clock" -> game.clock.map(clockJson),
|
||||||
"correspondence" -> game.correspondenceClock.map(correspondenceJson),
|
"correspondence" -> game.correspondenceClock.map(correspondenceJson),
|
||||||
"player" -> Json.obj(
|
"player" -> Json.obj(
|
||||||
|
|
|
@ -34,7 +34,7 @@ module.exports = function(ctrl, key) {
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
this.next = function(id) {
|
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);
|
if (id) goToId(id);
|
||||||
else xhr.next(ctrl).then(function(data) {
|
else xhr.next(ctrl).then(function(data) {
|
||||||
if (data.next) goToId(data.next);
|
if (data.next) goToId(data.next);
|
||||||
|
|
Loading…
Reference in a new issue