From 775abd3ac452eb6c0b20fc6aa76af577a89e96e6 Mon Sep 17 00:00:00 2001 From: Tissevert Date: Tue, 5 Nov 2019 18:13:13 +0100 Subject: [PATCH] No need to separate connection and logIn now that names are non-unique and the PlayerID is known from the start --- src/Hanafuda/Message.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Hanafuda/Message.hs b/src/Hanafuda/Message.hs index 35556ac..4271451 100644 --- a/src/Hanafuda/Message.hs +++ b/src/Hanafuda/Message.hs @@ -68,11 +68,10 @@ instance ToJSON Hanafuda.Card where toEncoding = genericToEncoding defaultOptions data FromClient = - Hello - | Tadaima {myID :: PlayerID} + Hello {name :: Text} + | Tadaima {myID :: PlayerID, name :: Text} | Answer {accept :: Bool, to :: PlayerID} | Invitation {to :: PlayerID} - | LogIn {name :: Text} | LogOut | Play {move :: KoiKoi.Move, onGame :: PublicGame} | Quit