gameServer/ServerCore.hs
changeset 4932 f11d80bac7ed
parent 4918 c6d3aec73f93
child 4955 84543ecae8c3
--- a/gameServer/ServerCore.hs	Sun Feb 06 18:59:53 2011 +0300
+++ b/gameServer/ServerCore.hs	Sun Feb 06 21:50:29 2011 +0300
@@ -41,10 +41,10 @@
         Accept ci -> processAction (AddClient ci)
 
         ClientMessage (ci, cmd) -> do
-            liftIO $ debugM "Clients" $ (show ci) ++ ": " ++ (show cmd)
+            liftIO $ debugM "Clients" $ show ci ++ ": " ++ show cmd
 
             removed <- gets removedClients
-            when (not $ ci `Set.member` removed) $ do
+            unless (ci `Set.member` removed) $ do
                 as <- get
                 put $! as{clientIndex = Just ci}
                 reactCmd cmd
@@ -61,11 +61,11 @@
         ClientAccountInfo ci uid info -> do
             rnc <- gets roomsClients
             exists <- liftIO $ clientExists rnc ci
-            when (exists) $ do
+            when exists $ do
                 as <- get
                 put $! as{clientIndex = Just ci}
                 uid' <- client's clUID
-                when (uid == (hashUnique uid')) $ processAction (ProcessAccountInfo info)
+                when (uid == hashUnique uid') $ processAction (ProcessAccountInfo info)
                 return ()
 
         TimerAction tick ->
@@ -77,19 +77,19 @@
 startServer si serverSocket = do
     putStrLn $ "Listening on port " ++ show (listenPort si)
 
-    forkIO $
+    _ <- forkIO $
         acceptLoop
             serverSocket
             (coreChan si)
 
     return ()
 
-    forkIO $ timerLoop 0 $ coreChan si
+    _ <- forkIO $ timerLoop 0 $ coreChan si
 
     startDBConnection si
 
     rnc <- newRoomsAndClients newRoom
 
-    forkIO $ evalStateT mainLoop (ServerState Nothing si Set.empty rnc)
+    _ <- forkIO $ evalStateT mainLoop (ServerState Nothing si Set.empty rnc)
 
     forever $ threadDelay 3600000000 -- one hour