huffman beta regex
This commit is contained in:
parent
d0d6be5840
commit
ffe0f800c1
|
@ -33,8 +33,8 @@ final class Env(
|
|||
|
||||
lazy val pgnEncodingSetting = settingStore[String](
|
||||
"pgnEncodingSetting",
|
||||
default = "none",
|
||||
text = "Use Huffman encoding for game PGN [none|beta|all]".some
|
||||
default = "thibault|revoof|isaacly", // `[a-h].*` for users starting with a,b,c...h
|
||||
text = "Use Huffman encoding for game PGN [none|all|regex]".some
|
||||
)
|
||||
|
||||
lazy val gameColl = db(CollectionGame)
|
||||
|
|
|
@ -73,12 +73,12 @@ private object PgnStorage {
|
|||
castles: Castles // irrelevant after game ends
|
||||
)
|
||||
|
||||
private val betaTesters = Set("thibault", "revoof", "isaacly")
|
||||
private def shouldUseHuffman(variant: Variant, playerUserIds: List[lila.user.User.ID]) = variant.standard && {
|
||||
try {
|
||||
lila.game.Env.current.pgnEncodingSetting.get() match {
|
||||
case "all" => true
|
||||
case "beta" if playerUserIds.exists(betaTesters.contains) => true
|
||||
case "none" => false
|
||||
case regex if playerUserIds.exists(_ matches regex) => true
|
||||
case _ => false
|
||||
}
|
||||
} catch {
|
||||
|
|
Loading…
Reference in a new issue