add logging to auto-report/evaluate/mark
This commit is contained in:
parent
1a5fdf2600
commit
4ff23ef27c
|
@ -52,9 +52,11 @@ final class Evaluator(
|
|||
marker ! lila.hub.actorApi.mod.MarkCheater(userId)
|
||||
reporter ! lila.hub.actorApi.report.Check(userId)
|
||||
}
|
||||
case Failure(e) ⇒ logger.warn(s"generate: $e")
|
||||
}
|
||||
|
||||
def autoGenerate(user: User, player: Player) {
|
||||
logger.info(s"auto evaluate $user")
|
||||
UserRepo isEvaluated user.id foreach { evaluated ⇒
|
||||
if (!evaluated && deviationIsLow(user.perfs) && ratingIsHigh(user.perfs))
|
||||
generate(user.id, user.perfs, false) foreach {
|
||||
|
@ -91,4 +93,6 @@ final class Evaluator(
|
|||
__.read[JsObject].map { o ⇒ o ++ Json.obj("date" -> $date(DateTime.now)) }
|
||||
) andThen
|
||||
(__ \ 'Error).json.prune
|
||||
|
||||
private val logger = play.api.Logger("Evaluator")
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ final class ModApi(
|
|||
lobbySocket: akka.actor.ActorSelection) {
|
||||
|
||||
def adjust(mod: String, username: String): Funit = withUser(username) { user ⇒
|
||||
play.api.Logger("ModApi").info(s"$mod marks $username as engine")
|
||||
logApi.engine(mod, user.id, !user.engine) zip
|
||||
UserRepo.toggleEngine(user.id) void
|
||||
}
|
||||
|
|
|
@ -26,7 +26,8 @@ final class ReportApi(evaluator: ActorSelection) {
|
|||
}
|
||||
}
|
||||
|
||||
def autoCheatReport(userId: String, text: String): Funit =
|
||||
def autoCheatReport(userId: String, text: String): Funit = {
|
||||
play.api.Logger("Report").info(s"auto cheat reaport $userId: $text")
|
||||
UserRepo byId userId zip UserRepo.lichess flatMap {
|
||||
case (Some(user), Some(lichess)) ⇒ create(ReportSetup(
|
||||
user = user,
|
||||
|
@ -36,6 +37,7 @@ final class ReportApi(evaluator: ActorSelection) {
|
|||
move = ""), lichess)
|
||||
case _ ⇒ funit
|
||||
}
|
||||
}
|
||||
|
||||
def process(id: String, by: User): Funit =
|
||||
$update.field(id, "processedBy", by.id)
|
||||
|
|
|
@ -29,6 +29,8 @@ case class User(
|
|||
case _ ⇒ false
|
||||
}
|
||||
|
||||
override def toString = s"User $username games:${count.game} rating:$rating troll:$troll engine:$engine"
|
||||
|
||||
def compare(other: User) = id compare other.id
|
||||
|
||||
def noTroll = !troll
|
||||
|
|
Loading…
Reference in a new issue