gameServer/Actions.hs
changeset 10056 cb9e07753802
parent 10017 de822cd3df3a
child 10057 795f5f918c8c
equal deleted inserted replaced
10055:f738693be9be 10056:cb9e07753802
   219     (Just ci) <- gets clientIndex
   219     (Just ci) <- gets clientIndex
   220     proto <- client's clientProto
   220     proto <- client's clientProto
   221     ri <- clientRoomA
   221     ri <- clientRoomA
   222     rnc <- gets roomsClients
   222     rnc <- gets roomsClients
   223     specialRoom <- io $ room'sM rnc isSpecial ri
   223     specialRoom <- io $ room'sM rnc isSpecial ri
   224     newMasterId <- liftM (\ids -> fromMaybe (listToMaybe . reverse . filter (/= ci) $ ids) $ liftM Just delegateId) . io $ roomClientsIndicesM rnc ri
   224     newMasterId <- if specialRoom then 
       
   225         return Nothing
       
   226         else
       
   227         liftM (\ids -> fromMaybe (listToMaybe . reverse . filter (/= ci) $ ids) $ liftM Just delegateId) . io $ roomClientsIndicesM rnc ri
   225     newMaster <- io $ client'sM rnc id `DT.mapM` newMasterId
   228     newMaster <- io $ client'sM rnc id `DT.mapM` newMasterId
   226     oldMasterId <- io $ room'sM rnc masterID ri
   229     oldMasterId <- io $ room'sM rnc masterID ri
   227     oldRoomName <- io $ room'sM rnc name ri
   230     oldRoomName <- io $ room'sM rnc name ri
   228     kicked <- client's isKickedFromServer
   231     kicked <- client's isKickedFromServer
   229     thisRoomChans <- liftM (map sendChan) $ roomClientsS ri
   232     thisRoomChans <- liftM (map sendChan) $ roomClientsS ri