Autum cup 2 decider

This commit is contained in:
Anibus
2020-11-28 19:27:33 +03:00
parent f94bf511a3
commit ec519889dc
6 changed files with 51 additions and 10 deletions
+9
View File
@@ -30,6 +30,13 @@ class LobbiesActor extends Actor with LazyLogging {
case Some(lobbyActor) => lobbyActor ! JoinLobbyAsPlayer(LobbyUser(userName, user))
case None => logger.error(s"Can't watch lobby $lobbyName - lobby not exists")
}
case ObserveLobbyByActorName(lobbyName) =>
// get or create the StockActor for the symbol and forward this message
val user = sender
context.child(lobbyName) match {
case Some(lobbyActor) => lobbyActor.tell(WatchLobby("watchIt"), user)
case None => logger.error(s"Can't watch lobby $lobbyName - lobby not exists")
}
case watchLobby@WatchLobby(lobbyName) =>
// get or create the StockActor for the symbol and forward this message
context.child(lobbyName) match {
@@ -50,4 +57,6 @@ case object GetAllLobbies
case class JoinLobbyByActorName(actorName: String, userName: String)
case class ObserveLobbyByActorName(actorName: String)
case object UnWatchAllLobbies