gameServer/HWProtoLobbyState.hs
changeset 11055 c1c3f86af19e
parent 11046 47a8c19ecb60
child 11056 62cc7f67105f
equal deleted inserted replaced
11054:6e575b29881c 11055:c1c3f86af19e
   111             ++ answerFullConfig cl jRoom
   111             ++ answerFullConfig cl jRoom
   112             ++ answerTeams cl jRoom
   112             ++ answerTeams cl jRoom
   113             ++ watchRound cl jRoom chans
   113             ++ watchRound cl jRoom chans
   114             ++ [AnswerClients [sendChan cl] ["CHAT", "[greeting]", greeting jRoom] | greeting jRoom /= ""]
   114             ++ [AnswerClients [sendChan cl] ["CHAT", "[greeting]", greeting jRoom] | greeting jRoom /= ""]
   115             ++ map (\t -> AnswerClients chans ["EM", toEngineMsg $ 'G' `B.cons` t]) clTeams
   115             ++ map (\t -> AnswerClients chans ["EM", toEngineMsg $ 'G' `B.cons` t]) clTeams
       
   116             ++ [AnswerClients [sendChan cl] ["EM", toEngineMsg "I"] | isPaused `fmap` gameInfo jRoom == Just True]
   116 
   117 
   117         where
   118         where
   118         moveTeams :: [B.ByteString] -> GameInfo -> ([TeamInfo], GameInfo)
   119         moveTeams :: [B.ByteString] -> GameInfo -> ([TeamInfo], GameInfo)
   119         moveTeams cts g = (deleteFirstsBy2 (\a b -> teamname a == b) (teamsAtStart g) (leftTeams g \\ cts)
   120         moveTeams cts g = (deleteFirstsBy2 (\a b -> teamname a == b) (teamsAtStart g) (leftTeams g \\ cts)
   120             , g{leftTeams = leftTeams g \\ cts, rejoinedTeams = rejoinedTeams g ++ cts, teamsInGameNumber = teamsInGameNumber g + length cts})
   121             , g{leftTeams = leftTeams g \\ cts, rejoinedTeams = rejoinedTeams g ++ cts, teamsInGameNumber = teamsInGameNumber g + length cts})