equal
deleted
inserted
replaced
330 chans <- othersChans |
330 chans <- othersChans |
331 mapM_ processAction [ |
331 mapM_ processAction [ |
332 AnswerClients chans ["EM", rmTeamMsg], |
332 AnswerClients chans ["EM", rmTeamMsg], |
333 ModifyRoom (\r -> r{ |
333 ModifyRoom (\r -> r{ |
334 gameInfo = liftM (\g -> g{ |
334 gameInfo = liftM (\g -> g{ |
335 teamsInGameNumber = teamsInGameNumber g - 1, |
335 teamsInGameNumber = teamsInGameNumber g - 1 |
336 roundMsgs = roundMsgs g Seq.|> rmTeamMsg |
336 , roundMsgs = roundMsgs g Seq.|> rmTeamMsg |
|
337 , leftTeams = teamName : leftTeams g |
337 }) $ gameInfo r |
338 }) $ gameInfo r |
338 }) |
339 }) |
339 ] |
340 ] |
340 |
341 |
341 rnc <- gets roomsClients |
342 rnc <- gets roomsClients |
352 ri <- clientRoomA |
353 ri <- clientRoomA |
353 inGame <- io $ room'sM rnc (isJust . gameInfo) ri |
354 inGame <- io $ room'sM rnc (isJust . gameInfo) ri |
354 chans <- othersChans |
355 chans <- othersChans |
355 if not $ inGame then |
356 if not $ inGame then |
356 mapM_ processAction [ |
357 mapM_ processAction [ |
357 AnswerClients chans ["REMOVE_TEAM", teamName], |
|
358 ModifyRoom (\r -> r{teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r}) |
358 ModifyRoom (\r -> r{teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r}) |
|
359 , AnswerClients chans ["REMOVE_TEAM", teamName] |
359 ] |
360 ] |
360 else |
361 else |
361 mapM_ processAction [ |
362 mapM_ processAction [ |
362 SendTeamRemovalMessage teamName, |
363 ModifyRoom (\r -> r{teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r}) |
363 ModifyRoom (\r -> r{ |
364 , SendTeamRemovalMessage teamName |
364 teams = Prelude.filter (\t -> teamName /= teamname t) $ teams r, |
|
365 gameInfo = liftM (\g -> g{ |
|
366 leftTeams = teamName : leftTeams g |
|
367 }) $ gameInfo r |
|
368 }) |
|
369 ] |
365 ] |
370 |
366 |
371 |
367 |
372 processAction (RemoveClientTeams clId) = do |
368 processAction (RemoveClientTeams clId) = do |
373 rnc <- gets roomsClients |
369 rnc <- gets roomsClients |