Видосы и параметризованный выбор кол-ва рас
This commit is contained in:
@@ -16,8 +16,10 @@ import play.api.mvc._
|
||||
|
||||
import scala.concurrent.duration._
|
||||
import scala.concurrent.{ExecutionContext, Future}
|
||||
import scala.util.Try
|
||||
|
||||
case class LastMapsSelectConfig(last1: Boolean, last3: Boolean, last5: Boolean, last7: Boolean)
|
||||
case class RaceSelect(select: Boolean, showAtStart: Boolean)
|
||||
|
||||
/**
|
||||
* This class creates the actions and the websocket needed.
|
||||
@@ -41,9 +43,10 @@ class HomeController @Inject()(cc: ControllerComponents) extends AbstractControl
|
||||
logger.info(s"Received request from: ${request.remoteAddress}")
|
||||
val deciderHumanName = config.getString(s"deciders.$deciderName.name")
|
||||
val deciderDescription = config.getString(s"deciders.$deciderName.rules")
|
||||
val necronPresence = config.getBoolean(s"deciders.$deciderName.necronrestrict")
|
||||
val raceCount = Try(config.getInt(s"deciders.$deciderName.raceCount")).getOrElse(1)
|
||||
val lastmapsSettings = LastMapsSelectConfig(true, true, true, true)
|
||||
Ok(views.html.index(deciderName, deciderHumanName, deciderDescription, necronPresence, lastmapsSettings))
|
||||
val raceSelect = RaceSelect(true, false)
|
||||
Ok(views.html.index(deciderName, deciderHumanName, raceCount, deciderDescription, raceSelect, lastmapsSettings))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +101,7 @@ class HomeController @Inject()(cc: ControllerComponents) extends AbstractControl
|
||||
* Returns true if the value of the Origin header contains an acceptable value.
|
||||
*/
|
||||
def originMatches(origin: String, remoteAddress: String): Boolean = {
|
||||
origin.contains("139.59.210.74") || origin.contains("localhost") || origin.contains("localhost:9000") || origin.contains("localhost:19001")
|
||||
origin.contains("89.108.83.108") || origin.contains("crosspick.ru") || origin.contains("localhost") || origin.contains("localhost:9000") || origin.contains("localhost:19001")
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user