From 4ffe30b2e4d9075f4eead8ce8d72b9cbf170524d Mon Sep 17 00:00:00 2001 From: Gareth Latty Date: Tue, 7 Jun 2016 19:25:07 +0100 Subject: [PATCH] Fix for bug where notifications were sent to the wrong clients. --- app/controllers/massivedecks/notifications/Notifiers.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/massivedecks/notifications/Notifiers.scala b/app/controllers/massivedecks/notifications/Notifiers.scala index 789e1af..1f1e48a 100644 --- a/app/controllers/massivedecks/notifications/Notifiers.scala +++ b/app/controllers/massivedecks/notifications/Notifiers.scala @@ -34,7 +34,7 @@ class Notifiers (implicit context: ExecutionContext) { (secret) => { val lobbyAndHand = onIdentify(secret) identified += (secret.id -> notifier) - sync(lobbyAndHand) + sync(secret.id, lobbyAndHand) }, () => { identified.find(item => notifier == item._2).foreach { item => @@ -48,8 +48,8 @@ class Notifiers (implicit context: ExecutionContext) { } - def sync(lobbyAndHand: Lobby.LobbyAndHand): Unit = - notifyAll(Json.obj( + def sync(playerId: Player.Id, lobbyAndHand: Lobby.LobbyAndHand): Unit = + notify(playerId, Json.obj( "event" -> "Sync", "lobbyAndHand" -> Json.toJson(lobbyAndHand) ))