gameServer/Actions.hs
changeset 5211 8ebf92014447
parent 5210 a5329e52a71b
child 5212 eaffb02f0053
equal deleted inserted replaced
5210:a5329e52a71b 5211:8ebf92014447
   464                 withStateT (\as -> as{clientIndex = Just ci}) $
   464                 withStateT (\as -> as{clientIndex = Just ci}) $
   465                     processAction (ByeClient "Ping timeout")
   465                     processAction (ByeClient "Ping timeout")
   466 
   466 
   467 
   467 
   468 processAction StatsAction = do
   468 processAction StatsAction = do
   469     rnc <- gets roomsClients
       
   470     si <- gets serverInfo
   469     si <- gets serverInfo
       
   470     when (not $ shutdownPending si) $ do
       
   471     rnc <- gets roomsClients
   471     (roomsNum, clientsNum) <- io $ withRoomsAndClients rnc st
   472     (roomsNum, clientsNum) <- io $ withRoomsAndClients rnc st
   472     io $ writeChan (dbQueries si) $ SendStats clientsNum (roomsNum - 1)
   473     io $ writeChan (dbQueries si) $ SendStats clientsNum (roomsNum - 1)
   473     where
   474     where
   474           st irnc = (length $ allRooms irnc, length $ allClients irnc)
   475           st irnc = (length $ allRooms irnc, length $ allClients irnc)
   475 
   476