From 30cd90b07595b4600a7f26084083af551818111e Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Thu, 1 May 2014 16:04:20 +0200 Subject: [PATCH] don't abort tournament games anymore --- modules/round/src/main/Meddler.scala | 4 ---- modules/round/src/main/Round.scala | 4 ---- modules/round/src/main/actorApi.scala | 1 - modules/tournament/src/main/TournamentApi.scala | 10 ++++------ public/stylesheets/tournament.css | 1 - 5 files changed, 4 insertions(+), 16 deletions(-) diff --git a/modules/round/src/main/Meddler.scala b/modules/round/src/main/Meddler.scala index c8bc15744b..ab4a3288ed 100644 --- a/modules/round/src/main/Meddler.scala +++ b/modules/round/src/main/Meddler.scala @@ -8,10 +8,6 @@ import lila.hub.actorApi.map.Tell private[round] final class Meddler(roundMap: ActorRef, socketHub: ActorRef) { - def forceAbort(gameId: String) { - roundMap ! Tell(gameId, AbortForce) - } - def resign(pov: Pov) { roundMap ! Tell(pov.gameId, Resign(pov.playerId)) } diff --git a/modules/round/src/main/Round.scala b/modules/round/src/main/Round.scala index e0a3bba1ca..782d2d8af4 100644 --- a/modules/round/src/main/Round.scala +++ b/modules/round/src/main/Round.scala @@ -46,10 +46,6 @@ private[round] final class Round( pov.game.abortable ?? finisher(pov.game, _.Aborted) } - case AbortForce => handle { game => - game.playable ?? finisher(game, _.Aborted) - } - case Resign(playerId) => handle(playerId) { pov => pov.game.resignable ?? finisher(pov.game, _.Resign, Some(!pov.color)) } diff --git a/modules/round/src/main/actorApi.scala b/modules/round/src/main/actorApi.scala index 473aabc3bb..05e012047d 100644 --- a/modules/round/src/main/actorApi.scala +++ b/modules/round/src/main/actorApi.scala @@ -85,7 +85,6 @@ package round { case class PlayResult(events: Events, fen: String, lastMove: Option[String]) case class Abort(playerId: String) - case object AbortForce case class Resign(playerId: String) case class ResignColor(color: Color) case class ResignForce(playerId: String) diff --git a/modules/tournament/src/main/TournamentApi.scala b/modules/tournament/src/main/TournamentApi.scala index 65db893cfb..290ca052a7 100644 --- a/modules/tournament/src/main/TournamentApi.scala +++ b/modules/tournament/src/main/TournamentApi.scala @@ -14,7 +14,7 @@ import lila.game.{ Game, GameRepo } import lila.hub.actorApi.lobby.ReloadTournaments import lila.hub.actorApi.map.Tell import lila.hub.actorApi.router.Tourney -import lila.round.actorApi.round.{ AbortForce, ResignColor } +import lila.round.actorApi.round.ResignColor import lila.socket.actorApi.SendToFlag import lila.user.{ User, UserRepo } import makeTimeout.short @@ -86,15 +86,13 @@ private[tournament] final class TournamentApi( def finish(started: Started): Fu[Tournament] = if (started.pairings.isEmpty) $remove(started) >>- reloadSiteSocket >>- lobbyReload inject started else started.readyToFinish.fold({ - val pairingsToAbort = started.playingPairings val finished = started.finish $update(finished) >>- sendTo(started.id, ReloadPage) >>- reloadSiteSocket >>- - (pairingsToAbort foreach { pairing => - roundMap ! Tell(pairing.gameId, AbortForce) - }) >> - finished.players.filter(_.score > 0).map(p => UserRepo.incToints(p.id, p.score)).sequenceFu inject finished + finished.players.filter(_.score > 0).map { p => + UserRepo.incToints(p.id, p.score) + }.sequenceFu inject finished }, fuccess(started)) def join(tour: Enterable, me: User, password: Option[String]): Funit = diff --git a/public/stylesheets/tournament.css b/public/stylesheets/tournament.css index ad3151b425..6b909b5cb5 100644 --- a/public/stylesheets/tournament.css +++ b/public/stylesheets/tournament.css @@ -141,7 +141,6 @@ } #tournament form.plain .error { - margin-left: 160px; color: red; }