Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude inactive players from variant leaderboards #5708

Merged
merged 1 commit into from Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions modules/rating/src/main/Glicko.scala
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion modules/rating/src/main/Perf.scala
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion modules/user/src/main/RankingApi.scala
Expand Up @@ -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
Expand Down