gameServer/Actions.hs
changeset 10057 795f5f918c8c
parent 10056 cb9e07753802
child 10058 4ed428389c4e
equal deleted inserted replaced
10056:cb9e07753802 10057:795f5f918c8c
   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         return Nothing
   225         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