gameServer/ServerCore.hs
changeset 3947 709fdb89f76c
parent 3741 73246d25dfe1
child 4242 5e3c5fe2cb14
--- a/gameServer/ServerCore.hs	Sun Oct 10 12:53:16 2010 -0400
+++ b/gameServer/ServerCore.hs	Sun Oct 10 21:32:18 2010 +0400
@@ -32,10 +32,11 @@
 
 mainLoop :: StateT ServerState IO ()
 mainLoop = forever $ do
+    get >>= \s -> put $! s
+
     si <- gets serverInfo
     r <- liftIO $ readChan $ coreChan si
 
-    liftIO $ putStrLn $ "Core msg: " ++ show r
     case r of
         Accept ci -> processAction (AddClient ci)
 
@@ -44,7 +45,8 @@
 
             removed <- gets removedClients
             when (not $ ci `Set.member` removed) $ do
-                modify (\as -> as{clientIndex = Just ci})
+                as <- get
+                put $! as{clientIndex = Just ci}
                 reactCmd cmd
 
         Remove ci -> do
@@ -60,7 +62,8 @@
             rnc <- gets roomsClients
             exists <- liftIO $ clientExists rnc ci
             when (exists) $ do
-                modify (\as -> as{clientIndex = Just ci})
+                as <- get
+                put $! as{clientIndex = Just ci}
                 processAction (ProcessAccountInfo info)
                 return ()