gameServer/HWProtoInRoomState.hs
changeset 8525 81630d47dc0f
parent 8514 896b283f41a2
child 8531 5e7f01d78ab0
equal deleted inserted replaced
8523:f13ae07d82d7 8525:81630d47dc0f
    75             else
    75             else
    76                 [ModifyRoom (\r -> r{teams = teams r ++ [newTeam]}),
    76                 [ModifyRoom (\r -> r{teams = teams r ++ [newTeam]}),
    77                 SendUpdateOnThisRoom,
    77                 SendUpdateOnThisRoom,
    78                 ModifyClient (\c -> c{teamsInGame = teamsInGame c + 1, clientClan = Just teamColor}),
    78                 ModifyClient (\c -> c{teamsInGame = teamsInGame c + 1, clientClan = Just teamColor}),
    79                 AnswerClients clChan ["TEAM_ACCEPTED", tName],
    79                 AnswerClients clChan ["TEAM_ACCEPTED", tName],
    80                 AnswerClients clChan ["HH_NUM", tName, showB $ hhnum newTeam],
       
    81                 AnswerClients othChans $ teamToNet $ newTeam,
    80                 AnswerClients othChans $ teamToNet $ newTeam,
    82                 AnswerClients roomChans ["TEAM_COLOR", tName, teamColor]
    81                 AnswerClients roomChans ["TEAM_COLOR", tName, teamColor],
       
    82                 ModifyClient $ \c -> c{actionsPending = actionsPending cl
       
    83                     ++ AnswerClients clChan ["HH_NUM", tName, showB $ hhnum newTeam]},
       
    84                 AnswerClients [sendChan cl] ["PING"]
    83                 ]
    85                 ]
    84         where
    86         where
    85         canAddNumber rt = (48::Int) - (sum $ map hhnum rt)
    87         canAddNumber rt = (48::Int) - (sum $ map hhnum rt)
    86         findTeam = find (\t -> tName == teamname t) . teams
    88         findTeam = find (\t -> tName == teamname t) . teams
    87         dif = readInt_ difStr
    89         dif = readInt_ difStr