gameServer/HWProtoLobbyState.hs
changeset 4989 4771fed9272e
parent 4984 20da3c5c7dee
child 5030 42746c5d4a80
equal deleted inserted replaced
4988:bd540ba66599 4989:4771fed9272e
    13 import Utils
    13 import Utils
    14 import HandlerUtils
    14 import HandlerUtils
    15 import RoomsAndClients
    15 import RoomsAndClients
    16 
    16 
    17 
    17 
    18 answerAllTeams :: ClientInfo -> [TeamInfo] -> [Action c]
    18 answerAllTeams :: ClientInfo -> [TeamInfo] -> [Action]
    19 answerAllTeams cl = concatMap toAnswer
    19 answerAllTeams cl = concatMap toAnswer
    20     where
    20     where
    21         clChan = sendChan cl
    21         clChan = sendChan cl
    22         toAnswer team =
    22         toAnswer team =
    23             [AnswerClients [clChan] $ teamToNet team,
    23             [AnswerClients [clChan] $ teamToNet team,
    24             AnswerClients [clChan] ["TEAM_COLOR", teamname team, teamcolor team],
    24             AnswerClients [clChan] ["TEAM_COLOR", teamname team, teamcolor team],
    25             AnswerClients [clChan] ["HH_NUM", teamname team, B.pack . show $ hhnum team]]
    25             AnswerClients [clChan] ["HH_NUM", teamname team, B.pack . show $ hhnum team]]
    26 
    26 
    27 handleCmd_lobby :: CmdHandler c
    27 handleCmd_lobby :: CmdHandler
    28 
    28 
    29 
    29 
    30 handleCmd_lobby ["LIST"] = do
    30 handleCmd_lobby ["LIST"] = do
    31     (ci, irnc) <- ask
    31     (ci, irnc) <- ask
    32     let cl = irnc `client` ci
    32     let cl = irnc `client` ci