gameServer/ServerState.hs
changeset 3645 c0b3f1bb9316
parent 3566 772a46ef8288
child 3741 73246d25dfe1
equal deleted inserted replaced
3644:42c5684289ae 3645:c0b3f1bb9316
    31 client's :: (ClientInfo -> a) -> StateT ServerState IO a
    31 client's :: (ClientInfo -> a) -> StateT ServerState IO a
    32 client's f = do
    32 client's f = do
    33     (Just ci) <- gets clientIndex
    33     (Just ci) <- gets clientIndex
    34     rnc <- gets roomsClients
    34     rnc <- gets roomsClients
    35     liftIO $ client'sM rnc f ci
    35     liftIO $ client'sM rnc f ci
    36     
    36 
    37 allClientsS :: StateT ServerState IO [ClientInfo]
    37 allClientsS :: StateT ServerState IO [ClientInfo]
    38 allClientsS = gets roomsClients >>= liftIO . clientsM
    38 allClientsS = gets roomsClients >>= liftIO . clientsM
    39 
    39 
    40 roomClientsS :: RoomIndex -> StateT ServerState IO [ClientInfo]
    40 roomClientsS :: RoomIndex -> StateT ServerState IO [ClientInfo]
    41 roomClientsS ri = do
    41 roomClientsS ri = do
    42     rnc <- gets roomsClients
    42     rnc <- gets roomsClients
    43     liftIO $ roomClientsM rnc ri
    43     liftIO $ roomClientsM rnc ri
    44