gameServer/Actions.hs
changeset 10058 4ed428389c4e
parent 10057 795f5f918c8c
child 10076 b235e520ea21
equal deleted inserted replaced
10057:795f5f918c8c 10058:4ed428389c4e
   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 <- if specialRoom then 
   224     newMasterId <- if specialRoom then 
   225         delegateId
   225         return delegateId
   226         else
   226         else
   227         liftM (\ids -> fromMaybe (listToMaybe . reverse . filter (/= ci) $ ids) $ liftM Just delegateId) . io $ roomClientsIndicesM rnc ri
   227         liftM (\ids -> fromMaybe (listToMaybe . reverse . filter (/= ci) $ ids) $ liftM Just delegateId) . io $ roomClientsIndicesM rnc ri
   228     newMaster <- io $ client'sM rnc id `DT.mapM` newMasterId
   228     newMaster <- io $ client'sM rnc id `DT.mapM` newMasterId
   229     oldMasterId <- io $ room'sM rnc masterID ri
   229     oldMasterId <- io $ room'sM rnc masterID ri
   230     oldRoomName <- io $ room'sM rnc name ri
   230     oldRoomName <- io $ room'sM rnc name ri