no longer make reports for games terminated as cheated

This commit is contained in:
Thibault Duplessis 2016-12-16 16:16:01 +01:00
parent a3e863eee4
commit 4fb0824ff0
3 changed files with 3 additions and 7 deletions

View file

@ -94,7 +94,7 @@ object Main extends LilaController {
val referer = HTTPRequest.referer(ctx.req)
val name = get("n", ctx.req) | "?"
lila.mon.cheat.cssBot()
ctx.userId.ifFalse(known) ?? {
ctx.userId.ifTrue(!known && name != "ceval") ?? {
Env.report.api.autoBotReport(_, referer, name)
}
lila.game.GameRepo pov id flatMap {

View file

@ -5,9 +5,7 @@ import chess.Color
import lila.game.{ Game, GameRepo, Pov }
private[round] final class CheatDetector(reporter: ActorSelection) {
private val createReport = false
private[round] final class CheatDetector {
def apply(game: Game): Fu[Option[Color]] = interesting(game) ?? {
GameRepo findMirror game map {
@ -15,8 +13,6 @@ private[round] final class CheatDetector(reporter: ActorSelection) {
mirror.players map (p => p -> p.userId) collectFirst {
case (player, Some(userId)) => game.players find (_.userId == player.userId) map { cheater =>
lila.log("cheat").info(s"${cheater.color} ($userId) @ ${game.id} uses ${mirror.id}")
if (createReport) reporter ! lila.hub.actorApi.report.Cheater(userId,
s"Cheat detected on ${gameUrl(game.id)}, using lichess AI: ${gameUrl(mirror.id)}")
cheater.color
}
} flatten

View file

@ -162,7 +162,7 @@ final class Env(
messenger = messenger,
finisher = finisher)
private lazy val cheatDetector = new CheatDetector(reporter = hub.actor.report)
private lazy val cheatDetector = new CheatDetector
lazy val messenger = new Messenger(
chat = hub.actor.chat,