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,15 +42,26 @@ case class UserRecord(
|
||||||
}
|
}
|
||||||
|
|
||||||
def bannable(accountCreationDate: DateTime): Option[TempBan] = {
|
def bannable(accountCreationDate: DateTime): Option[TempBan] = {
|
||||||
outcomes.lastOption.exists(_ != Outcome.Good) && {
|
rageSitRecidive || {
|
||||||
// too many bad overall
|
outcomes.lastOption.exists(_ != Outcome.Good) && {
|
||||||
badOutcomeScore >= (badOutcomeRatio * nbOutcomes atLeast minBadOutcomes) || {
|
// too many bad overall
|
||||||
// bad result streak
|
badOutcomeScore >= (badOutcomeRatio * nbOutcomes atLeast minBadOutcomes) || {
|
||||||
outcomes.size >= badOutcomesStreakSize &&
|
// bad result streak
|
||||||
outcomes.takeRight(badOutcomesStreakSize).forall(Outcome.Good !=)
|
outcomes.size >= badOutcomesStreakSize &&
|
||||||
|
outcomes.takeRight(badOutcomesStreakSize).forall(Outcome.Good !=)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} option TempBan.make(bans, accountCreationDate)
|
} 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(
|
case class TempBan(
|
||||||
|
@ -114,6 +125,8 @@ object Outcome {
|
||||||
case object SitMoving extends Outcome(5, "Waits then moves at last moment")
|
case object SitMoving extends Outcome(5, "Waits then moves at last moment")
|
||||||
case object Sandbag extends Outcome(6, "Deliberately lost the game")
|
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 all = List(Good, Abort, NoPlay, RageQuit, Sitting, SitMoving, Sandbag)
|
||||||
|
|
||||||
val byId = all map { v => (v.id, v) } toMap
|
val byId = all map { v => (v.id, v) } toMap
|
||||||
|
|
Loading…
Reference in New Issue