reduce debug output
This commit is contained in:
parent
9b164e4f65
commit
9a2786fa2d
3 changed files with 5 additions and 5 deletions
|
@ -59,7 +59,7 @@ handleMessages = do
|
||||||
msgs <- liftIO $ STM.atomically $ STM.flushTQueue queue
|
msgs <- liftIO $ STM.atomically $ STM.flushTQueue queue
|
||||||
mapM_
|
mapM_
|
||||||
(\msg -> do
|
(\msg -> do
|
||||||
liftIO $ putStrLn $ "Handling following: " <> show msg
|
-- liftIO $ putStrLn $ "Handling following: " <> show msg
|
||||||
handleMessage msg
|
handleMessage msg
|
||||||
)
|
)
|
||||||
msgs
|
msgs
|
||||||
|
|
|
@ -112,7 +112,7 @@ dropClient clientList sock = do
|
||||||
maybe
|
maybe
|
||||||
(putStrLn $ "closing unknown socket: " <> show sock)
|
(putStrLn $ "closing unknown socket: " <> show sock)
|
||||||
(\client -> do
|
(\client -> do
|
||||||
putStrLn $ "dropping client: " <> show (ccUUID client)
|
putStrLn $ "dropping client: " <> show (fromJust $ ccUUID client)
|
||||||
killThread (ccListener client)
|
killThread (ccListener client)
|
||||||
)
|
)
|
||||||
mclient
|
mclient
|
||||||
|
@ -156,7 +156,7 @@ sendMessage msg uuid clientList = do
|
||||||
let mSock = ccSocket <$> find (\client -> ccUUID client == Just uuid) clients
|
let mSock = ccSocket <$> find (\client -> ccUUID client == Just uuid) clients
|
||||||
msgJson = A.encode msg
|
msgJson = A.encode msg
|
||||||
msgVector = VS.fromList $ B.unpack $ B.toStrict $ ('<' `B8.cons` (msgJson `B8.snoc` '>'))
|
msgVector = VS.fromList $ B.unpack $ B.toStrict $ ('<' `B8.cons` (msgJson `B8.snoc` '>'))
|
||||||
putStrLn $ "Sending: " <> B8.unpack msgJson
|
-- putStrLn $ "Sending: " <> B8.unpack msgJson
|
||||||
maybe
|
maybe
|
||||||
(putStrLn $ "unknown client UUID: " <> show uuid)
|
(putStrLn $ "unknown client UUID: " <> show uuid)
|
||||||
(\sock ->
|
(\sock ->
|
||||||
|
@ -235,7 +235,7 @@ handleMessage
|
||||||
handleMessage stateContainer readerContainer msg = do
|
handleMessage stateContainer readerContainer msg = do
|
||||||
let clientList = scClientSockets stateContainer
|
let clientList = scClientSockets stateContainer
|
||||||
clients <- liftIO $ STM.atomically $ STM.readTMVar clientList
|
clients <- liftIO $ STM.atomically $ STM.readTMVar clientList
|
||||||
putStrLn $ "Handling: " <> show msg
|
-- putStrLn $ "Handling: " <> show msg
|
||||||
case msg of
|
case msg of
|
||||||
IdRequest -> do
|
IdRequest -> do
|
||||||
clientId <- nextRandom
|
clientId <- nextRandom
|
||||||
|
|
|
@ -35,7 +35,7 @@ runGame = do
|
||||||
before <- gets scServerLastTick
|
before <- gets scServerLastTick
|
||||||
now <- liftIO getCurrentTime
|
now <- liftIO getCurrentTime
|
||||||
let delta = realToFrac $ diffUTCTime now before
|
let delta = realToFrac $ diffUTCTime now before
|
||||||
liftIO $ B8.hPutStr stdout $ "tick: " <> fromString (show delta) <> " \r"
|
-- liftIO $ B8.hPutStr stdout $ "tick: " <> fromString (show delta) <> " \r"
|
||||||
handleMessages
|
handleMessages
|
||||||
updateSpawners delta
|
updateSpawners delta
|
||||||
updateWizards delta
|
updateWizards delta
|
||||||
|
|
Loading…
Reference in a new issue