Exclude inactive players from variant leaderboard
parent
1e406476ca
commit
0f7035bbd0
|
@ -20,7 +20,10 @@ case class Glicko(
|
|||
def intervalMax = (rating + deviation * 2).toInt
|
||||
def interval = intervalMin -> intervalMax
|
||||
|
||||
def rankable = deviation <= Glicko.rankableDeviation
|
||||
def rankable(variant: chess.variant.Variant) = deviation <= (variant match {
|
||||
case chess.variant.Standard => Glicko.standardRankableDeviation
|
||||
case _ => Glicko.variantRankableDeviation
|
||||
})
|
||||
def provisional = deviation >= Glicko.provisionalDeviation
|
||||
def established = !provisional
|
||||
def establishedIntRating = established option intRating
|
||||
|
@ -61,7 +64,8 @@ case object Glicko {
|
|||
val defaultIntRating = default.rating.toInt
|
||||
|
||||
val minDeviation = 50
|
||||
val rankableDeviation = 80
|
||||
val variantRankableDeviation = 60
|
||||
val standardRankableDeviation = 80
|
||||
val provisionalDeviation = 110
|
||||
val maxDeviation = 350
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ case class Perf(
|
|||
def isEmpty = nb == 0
|
||||
def nonEmpty = !isEmpty
|
||||
|
||||
def rankable = glicko.rankable
|
||||
def rankable(variant: chess.variant.Variant) = glicko.rankable(variant)
|
||||
def provisional = glicko.provisional
|
||||
def established = glicko.established
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ final class RankingApi(
|
|||
"perf" -> perfType.id,
|
||||
"rating" -> perf.intRating,
|
||||
"prog" -> perf.progress,
|
||||
"stable" -> perf.rankable,
|
||||
"stable" -> perf.rankable(PerfType variantOf perfType),
|
||||
"expiresAt" -> DateTime.now.plusDays(7)
|
||||
),
|
||||
upsert = true).void
|
||||
|
|
Loading…
Reference in New Issue