Skip to content

Commit

Permalink
use tell/lobby/user
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Sep 15, 2019
1 parent 403ab51 commit 9a276af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/lobby/src/main/LobbySocket.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ final class LobbySocket(

case ReloadSimuls(html) => tellActive(makeMessage("simuls", html))

// TODO send only to lobby users
case ReloadTimelines(users) => send(P.Out.tellUsers(users.toSet, makeMessage("reload_timeline")))

case AddHook(hook) => send(P.Out.tellSris(
Expand All @@ -86,8 +87,8 @@ final class LobbySocket(

case JoinSeek(userId, seek, game, creatorColor) =>
lila.mon.lobby.seek.join()
send(P.Out.tellUser(seek.user.id, gameStartRedirect(game pov creatorColor)))
send(P.Out.tellUser(userId, gameStartRedirect(game pov !creatorColor)))
send(Out.tellLobbyUser(seek.user.id, gameStartRedirect(game pov creatorColor)))
send(Out.tellLobbyUser(userId, gameStartRedirect(game pov !creatorColor)))

case p: PoolApi.Pairing =>
send(P.Out.tellSri(p.whiteSri, gameStartRedirect(p.game pov chess.White)))
Expand Down Expand Up @@ -269,6 +270,7 @@ private object LobbySocket {
def nbRounds(nb: Int) = s"round/nb $nb"
def tellLobby(payload: JsObject) = s"tell/lobby ${Json stringify payload}"
def tellLobbyActive(payload: JsObject) = s"tell/lobby/active ${Json stringify payload}"
def tellLobbyUser(userId: String, payload: JsObject) = s"tell/lobby/user $userId ${Json stringify payload}"
}
}

Expand Down

0 comments on commit 9a276af

Please sign in to comment.