diff -r 078cd026a7b1 -r 31da8979e5b1 gameServer/Actions.hs --- a/gameServer/Actions.hs Mon Feb 28 22:28:43 2011 +0300 +++ b/gameServer/Actions.hs Thu Mar 03 22:15:13 2011 +0300 @@ -22,7 +22,7 @@ import ServerState import Consts -data Action = +data Action c = AnswerClients ![ClientChan] ![B.ByteString] | SendServerMessage | SendServerVars @@ -44,7 +44,7 @@ | ModifyClient (ClientInfo -> ClientInfo) | ModifyClient2 ClientIndex (ClientInfo -> ClientInfo) | ModifyRoom (RoomInfo -> RoomInfo) - | ModifyServerInfo (ServerInfo -> ServerInfo) + | ModifyServerInfo (ServerInfo c -> ServerInfo c) | AddRoom B.ByteString B.ByteString | CheckRegistered | ClearAccountsCache @@ -56,9 +56,9 @@ | RestartServer Bool -type CmdHandler = [B.ByteString] -> Reader (ClientIndex, IRnC) [Action] +type CmdHandler c = [B.ByteString] -> Reader (ClientIndex, IRnC) [Action c] -instance NFData Action where +instance NFData (Action c) where rnf (AnswerClients chans msg) = chans `deepseq` msg `deepseq` () rnf a = a `seq` () @@ -66,13 +66,13 @@ instance NFData (Chan a) -othersChans :: StateT ServerState IO [ClientChan] +othersChans :: StateT (ServerState c) IO [ClientChan] othersChans = do cl <- client's id ri <- clientRoomA liftM (map sendChan . filter (/= cl)) $ roomClientsS ri -processAction :: Action -> StateT ServerState IO () +processAction :: Action c -> StateT (ServerState c) IO () processAction (AnswerClients chans msg) =