diff --git a/src-lib/Library/Types/Communication.hs b/src-lib/Library/Types/Communication.hs index b576373..73c559c 100644 --- a/src-lib/Library/Types/Communication.hs +++ b/src-lib/Library/Types/Communication.hs @@ -14,9 +14,6 @@ import Library.Types.Map data ServerMessage = ServerQuit -- ^ Message notifying a client that the server is about to shut down. - | Ping -- ^ A servers's heartbeat request - { pingID :: UUID -- ^ The random ID of the heartbeat request. NOT THE CLIENT'S 'UUID'! - } | AcceptClient -- ^ Message notifying the client of being accepted and providing it's -- newly registered 'UUID' { acClientUUID :: UUID @@ -24,6 +21,9 @@ data ServerMessage | ProvideInitialWizard -- ^ Message containing a newly created player character { initWizard :: Wizard } + | Ping -- ^ A servers's heartbeat request + { pingID :: UUID -- ^ The random ID of the heartbeat request. NOT THE CLIENT'S 'UUID'! + } | TickUpdate -- ^ The Server's state update to the clients { tuMapSlice :: MapSlice -- ^ The player's field of vision , tuWizard :: Wizard -- ^ the player's updated character @@ -39,6 +39,9 @@ data ClientMessagePayload | ClientRequestWizard -- ^ Message for requesting a new player character | ClientReady -- ^ Message requesting the server to position the client's character on the -- map + | Pong -- ^ A client's reply to a heartbeat request + { pongId :: UUID -- ^ The 'UUID' of the original heartbeat request + } deriving (Eq, Show, Generic) data ClientMessage