diff -r f4c51ab8f46d -r 5fb3bb2de9d2 gameServer/Actions.hs --- a/gameServer/Actions.hs Thu Mar 20 22:14:30 2014 +0400 +++ b/gameServer/Actions.hs Sun Mar 23 23:35:33 2014 +0400 @@ -34,9 +34,7 @@ import ConfigFile import EngineInteraction import FloodDetection - - -type CmdHandler = [B.ByteString] -> Reader (ClientIndex, IRnC) [Action] +import HWProtoCore othersChans :: StateT ServerState IO [ClientChan] @@ -798,3 +796,10 @@ processAction (RegisterEvent e) = do actions <- registerEvent e mapM_ processAction actions + + +processAction (ReactCmd cmd) = do + (Just ci) <- gets clientIndex + rnc <- gets roomsClients + actions <- liftIO $ withRoomsAndClients rnc (\irnc -> runReader (handleCmd cmd) (ci, irnc)) + forM_ (actions `deepseq` actions) processAction