ragesit immediate playban - closes #5602
If a player ragesits (ragequit or sit or sit-move) Then if their ragesit score is < -200 they get a playban Else if their ragesit score is < -100 and they have another recent ragesit (last 30 games) then they get a playban Else if their ragesit score is < -50 and they have two other recent ragesits (last 30 games) then they get a playbanstudy-remote-socket
parent
ec4cbd3f6c
commit
7e6fd1b87d
|
@ -42,6 +42,7 @@ case class UserRecord(
|
|||
}
|
||||
|
||||
def bannable(accountCreationDate: DateTime): Option[TempBan] = {
|
||||
rageSitRecidive || {
|
||||
outcomes.lastOption.exists(_ != Outcome.Good) && {
|
||||
// too many bad overall
|
||||
badOutcomeScore >= (badOutcomeRatio * nbOutcomes atLeast minBadOutcomes) || {
|
||||
|
@ -50,7 +51,17 @@ case class UserRecord(
|
|||
outcomes.takeRight(badOutcomesStreakSize).forall(Outcome.Good !=)
|
||||
}
|
||||
}
|
||||
}
|
||||
} option TempBan.make(bans, accountCreationDate)
|
||||
|
||||
def rageSitRecidive =
|
||||
outcomes.lastOption.exists(Outcome.rageSitLike.contains) && {
|
||||
rageSit.isTerrible || {
|
||||
rageSit.isVeryBad && outcomes.count(Outcome.rageSitLike.contains) > 1
|
||||
} || {
|
||||
rageSit.isBad && outcomes.count(Outcome.rageSitLike.contains) > 2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case class TempBan(
|
||||
|
@ -114,6 +125,8 @@ object Outcome {
|
|||
case object SitMoving extends Outcome(5, "Waits then moves at last moment")
|
||||
case object Sandbag extends Outcome(6, "Deliberately lost the game")
|
||||
|
||||
val rageSitLike: Set[Outcome] = Set(RageQuit, Sitting, SitMoving)
|
||||
|
||||
val all = List(Good, Abort, NoPlay, RageQuit, Sitting, SitMoving, Sandbag)
|
||||
|
||||
val byId = all map { v => (v.id, v) } toMap
|
||||
|
|
Loading…
Reference in New Issue