Decider admin

This commit is contained in:
anibus
2026-10-24 22:02:29 +03:00
parent 3cad3aec4b
commit 0212f8b6d0
18 changed files with 1362 additions and 71 deletions
+7 -10
View File
@@ -4,14 +4,11 @@ import actors.UserActor._
import akka.actor.{Actor, ActorRef}
import akka.event.LoggingReceive
import akka.util.Timeout
import com.typesafe.config.ConfigFactory
import com.typesafe.scalalogging.LazyLogging
import repository.DeciderRepository
import java.util
import scala.collection.JavaConverters.iterableAsScalaIterableConverter
import scala.collection.immutable.HashSet
import scala.concurrent.duration._
import scala.util.Try
case class LobbyUser(name: String, actorRef: ActorRef)
@@ -23,7 +20,6 @@ case class DeciderMap(map: String, description: Option[String] = None, var isBan
*/
class LobbieActor(hostUser: LobbyUser, deciderName: String) extends Actor with LazyLogging {
val config = ConfigFactory.load()
logger.info(s"Create lobby... host: ${hostUser.actorRef.path.name}")
@@ -49,11 +45,12 @@ class LobbieActor(hostUser: LobbyUser, deciderName: String) extends Actor with L
private val mapsLobby: Set[DeciderMap] = {
val configMaps = config.getList(s"deciders.$deciderName.maps").asScala
configMaps.map(e => {
val mapConfig = e.unwrapped().asInstanceOf[util.ArrayList[String]].asScala
DeciderMap(mapConfig.head, mapConfig.tail.headOption)
}).toSet
DeciderRepository.get(deciderName) match {
case Some(d) =>
d.maps.map(m => DeciderMap(m.map, m.description)).toSet
case None =>
Set.empty[DeciderMap]
}
}
hostUser.actorRef.tell(