gameServer/Actions.hs
changeset 3653 c0d94fedbd86
parent 3645 c0b3f1bb9316
child 3654 18189fbc7530
--- a/gameServer/Actions.hs	Sun Jul 18 03:58:06 2010 +0200
+++ b/gameServer/Actions.hs	Mon Jul 19 22:37:47 2010 +0400
@@ -434,9 +434,13 @@
                 else
                 return (clID, serverInfo, rnc)
 
+-}
 
-processAction (clID, serverInfo, rnc) (StatsAction) = do
-    writeChan (dbQueries serverInfo) $ SendStats (size clients) (size rooms - 1)
-    return (clID, serverInfo, rnc)
+processAction (StatsAction) = do
+    rnc <- gets roomsClients
+    si <- gets serverInfo
+    (roomsNum, clientsNum) <- liftIO $ withRoomsAndClients rnc stats
+    liftIO $ writeChan (dbQueries si) $ SendStats clientsNum (roomsNum - 1)
+    where
+          stats irnc = (length $ allRooms irnc, length $ allClients irnc)
 
--}