Invalidate rated unlimited lobby games in backend

This commit is contained in:
Thibault Duplessis 2012-07-28 17:31:42 +02:00
parent 666c68bfe5
commit 8797187725
3 changed files with 5 additions and 2 deletions

View file

@ -60,7 +60,9 @@ final class FormFactory(
"mode" -> mode(ctx.isAuth), "mode" -> mode(ctx.isAuth),
"eloRange" -> eloRange, "eloRange" -> eloRange,
"color" -> nonEmptyText.verifying(Color.names contains _) "color" -> nonEmptyText.verifying(Color.names contains _)
)(HookConfig.<<)(_.>>) verifying ("Invalid clock", _.validClock) )(HookConfig.<<)(_.>>)
.verifying("Invalid clock", _.validClock)
.verifying("Can't create rated unlimited in lobby", _.noRatedUnlimited)
) )
def hookConfig(implicit ctx: Context): IO[HookConfig] = ctx.me.fold( def hookConfig(implicit ctx: Context): IO[HookConfig] = ctx.me.fold(

View file

@ -32,6 +32,8 @@ case class HookConfig(
i = increment, i = increment,
m = mode.id, m = mode.id,
e = eloRange.toString) e = eloRange.toString)
def noRatedUnlimited = mode.casual || clock
} }
object HookConfig extends BaseHumanConfig { object HookConfig extends BaseHumanConfig {

1
todo
View file

@ -36,6 +36,5 @@ admin ip search interface
analyse: show main line for every move http://en.lichess.org/forum/lichess-feedback/about-the-analysis-feature#5 analyse: show main line for every move http://en.lichess.org/forum/lichess-feedback/about-the-analysis-feature#5
analyse: show cp every move analyse: show cp every move
clock in AI game clock in AI game
disable rated unlimited in lobby http://en.lichess.org/forum/lichess-feedback/unlimited-time-limit?page=2#13
try to show last analysis cp on graph (move 26) http://en.lichess.org/analyse/bwxnx0al try to show last analysis cp on graph (move 26) http://en.lichess.org/analyse/bwxnx0al
elo range must contain player elo elo range must contain player elo