Tournaments can be configured now

This commit is contained in:
Viktor Kholodov
2021-10-23 14:13:36 +03:00
parent 52baef061b
commit aa692419cf
8 changed files with 93 additions and 41 deletions
+2 -2
View File
@@ -17,10 +17,10 @@ class LobbiesActor extends Actor with LazyLogging {
val lobbies: ListBuffer[String] = ListBuffer()
def receive: Receive = LoggingReceive {
case CreateLobby(hostName) =>
case CreateLobby(hostName, deciderName) =>
val hostActorRef = sender
logger.info(s"Player ${hostActorRef.path.name} create lobby.")
val lobbyActor = context.actorOf(Props(new LobbieActor(LobbyUser(hostName, hostActorRef))),
val lobbyActor = context.actorOf(Props(new LobbieActor(LobbyUser(hostName, hostActorRef), deciderName)),
s"lobbyActor-${(math.random * 100000000L).toLong}")
lobbyActor.tell(WatchLobby("watchIt"), hostActorRef)
case JoinLobbyByActorName(lobbyName, userName) =>