gameServer/Actions.hs
changeset 2172 80d34c0b9dfe
parent 2155 d897222d3339
child 2245 c011aecc95e5
equal deleted inserted replaced
2171:8208946331ba 2172:80d34c0b9dfe
    42 	| ClearAccountsCache
    42 	| ClearAccountsCache
    43 	| ProcessAccountInfo AccountInfo
    43 	| ProcessAccountInfo AccountInfo
    44 	| Dump
    44 	| Dump
    45 	| AddClient ClientInfo
    45 	| AddClient ClientInfo
    46 	| PingAll
    46 	| PingAll
       
    47 	| StatsAction
    47 
    48 
    48 type CmdHandler = Int -> Clients -> Rooms -> [String] -> [Action]
    49 type CmdHandler = Int -> Clients -> Rooms -> [String] -> [Action]
    49 
    50 
    50 replaceID a (b, c, d, e) = (a, c, d, e)
    51 replaceID a (b, c, d, e) = (a, c, d, e)
    51 
    52 
   383 		kickTimeouted (clID, serverInfo, clients, rooms) client =
   384 		kickTimeouted (clID, serverInfo, clients, rooms) client =
   384 			if pingsQueue client > 0 then
   385 			if pingsQueue client > 0 then
   385 				processAction (clientUID client, serverInfo, clients, rooms) $ ByeClient "Ping timeout"
   386 				processAction (clientUID client, serverInfo, clients, rooms) $ ByeClient "Ping timeout"
   386 				else
   387 				else
   387 				return (clID, serverInfo, clients, rooms)
   388 				return (clID, serverInfo, clients, rooms)
       
   389 
       
   390 
       
   391 processAction (clID, serverInfo, clients, rooms) (StatsAction) = do
       
   392 	writeChan (dbQueries serverInfo) $ SendStats (size clients) (size rooms - 1)
       
   393 	return (clID, serverInfo, clients, rooms)