37 lines
1 KiB
Haskell
37 lines
1 KiB
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
|
|
-- message <- receiveMessage sock
|
|
-- putStrLn $ "getting first message" <> show message
|
|
-- let clientUUID = case message of
|
|
-- (AcceptClient aclientUUID ) -> aclientUUID
|
|
-- x -> error $ "unexpected message from server: " <> show message
|
|
-- let reader = ReaderContainer sock clientUUID
|
|
-- putStrLn $ "received uuid " <> show clientUUID
|
|
-- threadDelay $ 5 * 10 ^ 6
|
|
where
|
|
opts = info (options <**> helper)
|
|
( fullDesc
|
|
<> progDesc "Run the \"wizard-wipeout\" Server."
|
|
<> header "wizard-wipeout - Last Mage standing"
|
|
)
|