aboutsummaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorJasper Van der Jeugt2020-08-04 20:20:12 +0200
committerJasper Van der Jeugt2020-08-04 20:20:12 +0200
commit6034f1617392d09e3a5f9af19b064cc369f546e0 (patch)
tree98f726c9a18d36f24ba7745c409caf01e58736d5 /server
parenta2e72144746fdecc0539286798c0a46a02e47d5f (diff)
Make it look decent
Diffstat (limited to 'server')
-rw-r--r--server/lib/Cafp/Main/Server.hs1
-rw-r--r--server/lib/Cafp/Messages.hs3
2 files changed, 2 insertions, 2 deletions
diff --git a/server/lib/Cafp/Main/Server.hs b/server/lib/Cafp/Main/Server.hs
index 799f26e..4b1bfe7 100644
--- a/server/lib/Cafp/Main/Server.hs
+++ b/server/lib/Cafp/Main/Server.hs
@@ -142,6 +142,7 @@ wsApp server pc = case routePendingConnection pc of
roomEmpty <- atomically $ leaveRoom room playerId
if roomEmpty then deleteRoom server roomId else syncRoom room)
(\playerId -> do
+ sink . Aeson.encode $ Welcome roomId
syncRoom room
cards <- fmap (^. gameCards) . atomically . STM.readTVar $
roomGame room
diff --git a/server/lib/Cafp/Messages.hs b/server/lib/Cafp/Messages.hs
index b572fb7..a02058f 100644
--- a/server/lib/Cafp/Messages.hs
+++ b/server/lib/Cafp/Messages.hs
@@ -62,10 +62,9 @@ data GameView = GameView
} deriving (Show)
data ServerMessage
- = Welcome !Int
+ = Welcome !Text
| SyncCards !Cards
| SyncGameView !GameView
- | Bye
deriving (Show)
data ClientMessage