# HG changeset patch # User unc0rr # Date 1337801450 -14400 # Node ID 9257cf8e7af27089e80dbff07636b2537a52d733 # Parent 2737c488756bc474c3029222f4a1b88af68f4455 Mark team for deletion when letting others know it has left during game. Should help with quitters problem. diff -r 2737c488756b -r 9257cf8e7af2 gameServer/Actions.hs --- a/gameServer/Actions.hs Wed May 23 23:24:03 2012 +0400 +++ b/gameServer/Actions.hs Wed May 23 23:30:50 2012 +0400 @@ -332,8 +332,9 @@ AnswerClients chans ["EM", rmTeamMsg], ModifyRoom (\r -> r{ gameInfo = liftM (\g -> g{ - teamsInGameNumber = teamsInGameNumber g - 1, - roundMsgs = roundMsgs g Seq.|> rmTeamMsg + teamsInGameNumber = teamsInGameNumber g - 1 + , roundMsgs = roundMsgs g Seq.|> rmTeamMsg + , leftTeams = teamName : leftTeams g }) $ gameInfo r }) ] @@ -354,18 +355,13 @@ chans <- othersChans if not $ inGame then mapM_ processAction [ - AnswerClients chans ["REMOVE_TEAM", teamName], ModifyRoom (\r -> r{teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r}) + , AnswerClients chans ["REMOVE_TEAM", teamName] ] else mapM_ processAction [ - SendTeamRemovalMessage teamName, - ModifyRoom (\r -> r{ - teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r, - gameInfo = liftM (\g -> g{ - leftTeams = teamName : leftTeams g - }) $ gameInfo r - }) + ModifyRoom (\r -> r{teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r}) + , SendTeamRemovalMessage teamName ]