equal
deleted
inserted
replaced
112 return () |
112 return () |
113 |
113 |
114 liftIO $ do |
114 liftIO $ do |
115 infoM "Clients" (show ci ++ " quits: " ++ msg) |
115 infoM "Clients" (show ci ++ " quits: " ++ msg) |
116 |
116 |
117 ri <- clientRoomM rnc ci |
117 chan <- withRoomsAndClients rnc (getChan ci) |
118 |
118 |
119 --mapM_ (processAction (ci, serverInfo, rnc)) $ answerOthersQuit ++ answerInformRoom |
119 --mapM_ (processAction (ci, serverInfo, rnc)) $ answerOthersQuit ++ answerInformRoom |
120 --writeChan (sendChan $ clients ! clID) ["BYE", msg] |
120 writeChan chan ["BYE", msg] |
121 modifyRoom rnc (\r -> r{ |
121 modifyRoom rnc (\r -> r{ |
122 --playersIDs = IntSet.delete ci (playersIDs r) |
122 --playersIDs = IntSet.delete ci (playersIDs r) |
123 playersIn = (playersIn r) - 1 |
123 playersIn = (playersIn r) - 1 |
124 --readyPlayers = if isReady client then readyPlayers r - 1 else readyPlayers r |
124 --readyPlayers = if isReady client then readyPlayers r - 1 else readyPlayers r |
125 }) ri |
125 }) ri |
126 removeClient rnc ci |
126 removeClient rnc ci |
|
127 where |
|
128 getChan ci irnc = let cl = irnc `client` ci in (sendChan cl) |
127 |
129 |
128 |
130 |
129 {- |
131 {- |
130 where |
132 where |
131 client = clients ! clID |
133 client = clients ! clID |