# HG changeset patch # User unc0rr # Date 1260822231 0 # Node ID 12dc696f1c817e357ab77bca233366a123e580de # Parent 9689c6ee9114b83e905f0447a545283c2f37861c Implement "team" chat between spectators diff -r 9689c6ee9114 -r 12dc696f1c81 gameServer/Actions.hs --- a/gameServer/Actions.hs Mon Dec 14 18:52:04 2009 +0000 +++ b/gameServer/Actions.hs Mon Dec 14 20:23:51 2009 +0000 @@ -100,10 +100,12 @@ processAction (clID, serverInfo, clients, rooms) (AnswerSameClan msg) = do - mapM_ (\cl -> writeChan (sendChan cl) msg) sameClanClients + mapM_ (\cl -> writeChan (sendChan cl) msg) sameClanOrSpec return (clID, serverInfo, clients, rooms) where otherRoomClients = Prelude.map ((!) clients) $ IntSet.elems $ clID `IntSet.delete` (playersIDs room) + sameClanOrSpec = if teamsInGame client > 0 then sameClanClients else spectators + spectators = Prelude.filter (\cl -> teamsInGame cl == 0) otherRoomClients sameClanClients = Prelude.filter (\cl -> teamsInGame cl > 0 && clientClan cl == thisClan) otherRoomClients thisClan = clientClan client room = rooms ! rID