Reimplement statistics
authorunc0rr
Mon, 19 Jul 2010 22:37:47 +0400
changeset 3653 c0d94fedbd86
parent 3652 df76ccda0648
child 3654 18189fbc7530
Reimplement statistics
gameServer/Actions.hs
--- 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)
 
--}