wizard-wipeout/src-client/Main.hs
2023-12-11 09:49:24 +01:00

31 lines
770 B
Haskell

{-# LANGUAGE LambdaCase #-}
module Main where
import Control.Concurrent (threadDelay)
import Options.Applicative
-- internal imports
import Client.Communication
import Client.Types
import Library.Types
main :: IO ()
main = do
putStrLn "Hello, Arena!"
(Options socketLocation) <- execParser opts
putStrLn $ "connecting to Socket " <> socketLocation
sock <- connectSocket socketLocation
putStrLn "connected"
sendMessage (IdRequest) sock
threadDelay $ 5 * 10 ^ 6
clientId <- receiveMessage sock
putStrLn $ "received client UUID: " <> show (acClientUUID clientId)
where
opts = info (options <**> helper)
( fullDesc
<> progDesc "Run the \"wizard-wipeout\" Server."
<> header "wizard-wipeout - Last Mage standing"
)