fix user rank should not count disabled players
This commit is contained in:
parent
11d936da3e
commit
7fad9015d9
|
@ -30,7 +30,7 @@ case class UserInfo(
|
|||
|
||||
object UserInfo {
|
||||
|
||||
private val rankMinElo = 1600
|
||||
private val rankMinElo = 1700
|
||||
|
||||
def apply(
|
||||
userRepo: UserRepo,
|
||||
|
|
|
@ -34,7 +34,7 @@ extends SalatDAO[User, String](collection) {
|
|||
}
|
||||
|
||||
def rank(user: User): IO[Int] = io {
|
||||
count("elo" $gt user.elo).toInt + 1
|
||||
count(DBObject("enabled" -> true) ++ ("elo" $gt user.elo)).toInt + 1
|
||||
}
|
||||
|
||||
def setElo(id: String, elo: Int): IO[Unit] = io {
|
||||
|
|
Loading…
Reference in a new issue