2 new map, fix map name 4+ players
This commit is contained in:
@@ -112,7 +112,7 @@ class HomeController @Inject()(cc: ControllerComponents) extends AbstractControl
|
||||
val (webSocketOut: ActorRef, webSocketIn: Publisher[JsValue]) = createWebSocketConnections()
|
||||
|
||||
// Create a user actor off the request id and attach it to the source
|
||||
val userActorFuture = createUserActor(request.id.toString, webSocketOut)
|
||||
val userActorFuture = createUserActor(request.id.toString, request.remoteAddress, webSocketOut)
|
||||
|
||||
// Once we have an actor available, create a flow...
|
||||
userActorFuture.map { userActor =>
|
||||
@@ -190,11 +190,11 @@ class HomeController @Inject()(cc: ControllerComponents) extends AbstractControl
|
||||
* @param webSocketOut the "write" side of the websocket, that the user actor sends JsValue to.
|
||||
* @return a user actor for this ws connection.
|
||||
*/
|
||||
private def createUserActor(name: String, webSocketOut: ActorRef): Future[ActorRef] = {
|
||||
private def createUserActor(name: String, remoteAddress: String, webSocketOut: ActorRef): Future[ActorRef] = {
|
||||
// Use guice assisted injection to instantiate and configure the child actor.
|
||||
val userActorFuture = {
|
||||
implicit val timeout = Timeout(100.millis)
|
||||
(userParentActor ? UserParentActor.Create(name, webSocketOut)).mapTo[ActorRef]
|
||||
(userParentActor ? UserParentActor.Create(name, remoteAddress, webSocketOut)).mapTo[ActorRef]
|
||||
}
|
||||
userActorFuture
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user