gameServer/ServerState.hs
changeset 8452 170afc3ac39f
parent 8371 0551b5c3de9a
child 9973 7589978c9912
equal deleted inserted replaced
8451:8c7da08df048 8452:170afc3ac39f
     3     module RoomsAndClients,
     3     module RoomsAndClients,
     4     clientRoomA,
     4     clientRoomA,
     5     ServerState(..),
     5     ServerState(..),
     6     client's,
     6     client's,
     7     allClientsS,
     7     allClientsS,
       
     8     allRoomsS,
     8     roomClientsS,
     9     roomClientsS,
     9     sameProtoClientsS,
    10     sameProtoClientsS,
    10     io
    11     io
    11     ) where
    12     ) where
    12 
    13 
    38     io $ client'sM rnc f ci
    39     io $ client'sM rnc f ci
    39 
    40 
    40 allClientsS :: StateT ServerState IO [ClientInfo]
    41 allClientsS :: StateT ServerState IO [ClientInfo]
    41 allClientsS = gets roomsClients >>= liftIO . clientsM
    42 allClientsS = gets roomsClients >>= liftIO . clientsM
    42 
    43 
       
    44 allRoomsS :: StateT ServerState IO [RoomInfo]
       
    45 allRoomsS = gets roomsClients >>= liftIO . roomsM
       
    46 
    43 roomClientsS :: RoomIndex -> StateT ServerState IO [ClientInfo]
    47 roomClientsS :: RoomIndex -> StateT ServerState IO [ClientInfo]
    44 roomClientsS ri = do
    48 roomClientsS ri = do
    45     rnc <- gets roomsClients
    49     rnc <- gets roomsClients
    46     io $ roomClientsM rnc ri
    50     io $ roomClientsM rnc ri
    47 
    51