Fix for bug where notifications were sent to the wrong clients.

This commit is contained in:
Gareth Latty
2016-06-07 19:25:07 +01:00
parent d9d2d33f15
commit 4ffe30b2e4
@@ -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)
))