214 mapM_ processAction [ |
214 mapM_ processAction [ |
215 ModifyRoom (\r -> r{masterID = newMasterId |
215 ModifyRoom (\r -> r{masterID = newMasterId |
216 , name = newRoomName |
216 , name = newRoomName |
217 , isRestrictedJoins = False |
217 , isRestrictedJoins = False |
218 , isRestrictedTeams = False |
218 , isRestrictedTeams = False |
219 , isRegisteredOnly = False |
219 , isRegisteredOnly = False} |
220 , readyPlayers = if isReady newMaster then readyPlayers r else readyPlayers r + 1}) |
220 ) |
221 , ModifyClient2 newMasterId (\c -> c{isMaster = True, isReady = True}) |
221 , ModifyClient2 newMasterId (\c -> c{isMaster = True}) |
222 , AnswerClients [sendChan newMaster] ["ROOM_CONTROL_ACCESS", "1"] |
222 , AnswerClients [sendChan newMaster] ["ROOM_CONTROL_ACCESS", "1"] |
223 , AnswerClients thisRoomChans ["CLIENT_FLAGS", "-h", oldMaster] |
223 , AnswerClients thisRoomChans ["CLIENT_FLAGS", "-h", oldMaster] |
224 , AnswerClients thisRoomChans ["CLIENT_FLAGS", "+hr", nick newMaster] |
224 , AnswerClients thisRoomChans ["CLIENT_FLAGS", "+h", nick newMaster] |
225 ] |
225 ] |
226 |
226 |
227 newRoom' <- io $ room'sM rnc id ri |
227 newRoom' <- io $ room'sM rnc id ri |
228 chans <- liftM (map sendChan) $! sameProtoClientsS proto |
228 chans <- liftM (map sendChan) $! sameProtoClientsS proto |
229 processAction $ AnswerClients chans ("ROOM" : "UPD" : oldRoomName : roomInfo (nick newMaster) newRoom') |
229 processAction $ AnswerClients chans ("ROOM" : "UPD" : oldRoomName : roomInfo (nick newMaster) newRoom') |