# HG changeset patch # User unc0rr # Date 1338056877 -14400 # Node ID 8daa5c8e84c0896e122db07943a8877bd57bd7bd # Parent cfee057128969556897eef835f4122d343e0a301 Bring leftTeams back (with a fix) as it is apparently needed for spectators. diff -r cfee05712896 -r 8daa5c8e84c0 gameServer/Actions.hs --- a/gameServer/Actions.hs Fri May 25 00:06:42 2012 +0400 +++ b/gameServer/Actions.hs Sat May 26 22:27:57 2012 +0400 @@ -312,17 +312,19 @@ ri <- clientRoomA thisRoomChans <- liftM (map sendChan) $ roomClientsS ri clNick <- client's nick - - mapM_ processAction [ + answerRemovedTeams <- io $ + room'sM rnc (map (\t -> AnswerClients thisRoomChans ["REMOVE_TEAM", t]) . leftTeams . fromJust . gameInfo) ri + + mapM_ processAction $ SaveReplay - , ModifyRoom + : ModifyRoom (\r -> r{ gameInfo = Nothing, readyPlayers = 0 } ) - , UnreadyRoomClients - ] + : UnreadyRoomClients + : answerRemovedTeams processAction (SendTeamRemovalMessage teamName) = do @@ -352,7 +354,10 @@ inGame <- io $ room'sM rnc (isJust . gameInfo) ri chans <- othersChans mapM_ processAction $ - ModifyRoom (\r -> r{teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r}) + ModifyRoom (\r -> r{ + teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r + , gameInfo = liftM (\g -> g{leftTeams = teamName : leftTeams g}) $ gameInfo r + }) : AnswerClients chans ["REMOVE_TEAM", teamName] : [SendTeamRemovalMessage teamName | inGame] diff -r cfee05712896 -r 8daa5c8e84c0 gameServer/CoreTypes.hs --- a/gameServer/CoreTypes.hs Fri May 25 00:06:42 2012 +0400 +++ b/gameServer/CoreTypes.hs Sat May 26 22:27:57 2012 +0400 @@ -67,6 +67,7 @@ GameInfo { roundMsgs :: Seq B.ByteString, + leftTeams :: [B.ByteString], teamsAtStart :: [TeamInfo], teamsInGameNumber :: Int, allPlayersHaveRegisteredAccounts :: Bool, @@ -78,6 +79,7 @@ newGameInfo = GameInfo Data.Sequence.empty + [] data RoomInfo = RoomInfo