No need to separate connection and logIn now that names are non-unique and the PlayerID is known from the start

This commit is contained in:
Tissevert 2019-11-05 18:13:13 +01:00
parent 9c5c80fb3a
commit 775abd3ac4

View file

@ -68,11 +68,10 @@ instance ToJSON Hanafuda.Card where
toEncoding = genericToEncoding defaultOptions toEncoding = genericToEncoding defaultOptions
data FromClient = data FromClient =
Hello Hello {name :: Text}
| Tadaima {myID :: PlayerID} | Tadaima {myID :: PlayerID, name :: Text}
| Answer {accept :: Bool, to :: PlayerID} | Answer {accept :: Bool, to :: PlayerID}
| Invitation {to :: PlayerID} | Invitation {to :: PlayerID}
| LogIn {name :: Text}
| LogOut | LogOut
| Play {move :: KoiKoi.Move, onGame :: PublicGame} | Play {move :: KoiKoi.Move, onGame :: PublicGame}
| Quit | Quit