gameServer/Actions.hs
changeset 2172 80d34c0b9dfe
parent 2155 d897222d3339
child 2245 c011aecc95e5
--- a/gameServer/Actions.hs	Thu Jun 18 17:48:06 2009 +0000
+++ b/gameServer/Actions.hs	Fri Jun 19 17:55:42 2009 +0000
@@ -44,6 +44,7 @@
 	| Dump
 	| AddClient ClientInfo
 	| PingAll
+	| StatsAction
 
 type CmdHandler = Int -> Clients -> Rooms -> [String] -> [Action]
 
@@ -385,3 +386,8 @@
 				processAction (clientUID client, serverInfo, clients, rooms) $ ByeClient "Ping timeout"
 				else
 				return (clID, serverInfo, clients, rooms)
+
+
+processAction (clID, serverInfo, clients, rooms) (StatsAction) = do
+	writeChan (dbQueries serverInfo) $ SendStats (size clients) (size rooms - 1)
+	return (clID, serverInfo, clients, rooms)