gameServer/Actions.hs
changeset 3741 73246d25dfe1
parent 3673 45778b16b224
child 3947 709fdb89f76c
equal deleted inserted replaced
3739:97cf933e5bd2 3741:73246d25dfe1
     9 import System.Log.Logger
     9 import System.Log.Logger
    10 import Control.Monad
    10 import Control.Monad
    11 import Data.Time
    11 import Data.Time
    12 import Data.Maybe
    12 import Data.Maybe
    13 import Control.Monad.Reader
    13 import Control.Monad.Reader
    14 import Control.Monad.State
    14 import Control.Monad.State.Strict
    15 import qualified Data.ByteString.Char8 as B
    15 import qualified Data.ByteString.Char8 as B
    16 -----------------------------
    16 -----------------------------
    17 import CoreTypes
    17 import CoreTypes
    18 import Utils
    18 import Utils
    19 import ClientIO
    19 import ClientIO
    55 
    55 
    56 processAction :: Action -> StateT ServerState IO ()
    56 processAction :: Action -> StateT ServerState IO ()
    57 
    57 
    58 
    58 
    59 processAction (AnswerClients chans msg) = do
    59 processAction (AnswerClients chans msg) = do
    60     liftIO (putStr $ "AnswerClients... " ++ (show $ length chans) ++ " (" ++ (show msg) ++")")
    60     liftIO $ map (flip seq ()) chans `seq` map (flip seq ()) msg `seq` mapM_ (flip writeChan msg) chans
    61     liftIO $ map (flip seq ()) chans `seq` mapM_ (flip writeChan msg) chans
       
    62     liftIO (putStrLn "done")
       
    63 
    61 
    64 
    62 
    65 processAction SendServerMessage = do
    63 processAction SendServerMessage = do
    66     chan <- client's sendChan
    64     chan <- client's sendChan
    67     protonum <- client's clientProto
    65     protonum <- client's clientProto