new Irwin ambiguity field

pull/3017/head
Thibault Duplessis 2017-05-02 14:26:50 +02:00
parent c62cd731c8
commit f173b1bd81
3 changed files with 4 additions and 5 deletions

View File

@ -22,9 +22,6 @@ object Irwin extends LilaController {
}
}
import scala.concurrent.duration._
private lazy val irwinProcessedUserIds = new lila.memo.ExpireSetMemo(ttl = 30 minutes)
def getRequest = Open { implicit ctx =>
ModExternalBot {
Env.irwin.api.requests.getAndStart map {
@ -60,6 +57,6 @@ object Irwin extends LilaController {
}
private def ModExternalBot(f: => Fu[Result])(implicit ctx: Context) =
if (!get("api_key").contains(Env.mod.ApiKey)) fuccess(NotFound)
else f
if (get("api_key") contains Env.mod.ApiKey) f
else fuccess(NotFound)
}

View File

@ -9,6 +9,7 @@ case class IrwinReport(
isLegit: Option[Boolean],
activation: Int, // 0 = clean, 100 = cheater
games: List[IrwinReport.GameReport],
pv0ByAmbiguity: Option[List[Int]],
date: DateTime
) {

View File

@ -15,6 +15,7 @@ object JSONHandlers {
(__ \ "isLegit").readNullable[Boolean] and
(__ \ "activation").read[Int] and
(__ \ "games").read[List[GameReport]] and
(__ \ "pv0ByAmbiguity").read[List[Int]].map(some) and
Reads(_ => JsSuccess(DateTime.now))
)(IrwinReport.apply _)
}