# HG changeset patch # User unc0rr # Date 1369684492 -14400 # Node ID a65492ca158719948b049ed052e216b381af05f6 # Parent 38e8787483dbcebc6eb598fa7a28821ee03b6b9c Fix room admin rights delegation by server admin when he isn't room admin diff -r 38e8787483db -r a65492ca1587 gameServer/Actions.hs --- a/gameServer/Actions.hs Mon May 27 23:24:35 2013 +0400 +++ b/gameServer/Actions.hs Mon May 27 23:54:52 2013 +0400 @@ -207,8 +207,9 @@ rnc <- gets roomsClients newMasterId <- liftM (\ids -> fromMaybe (last . filter (/= ci) $ ids) delegateId) . io $ roomClientsIndicesM rnc ri newMaster <- io $ client'sM rnc id newMasterId + oldMasterId <- io $ room'sM rnc masterID ri + oldMaster <- io $ client'sM rnc id oldMasterId oldRoomName <- io $ room'sM rnc name ri - oldMaster <- client's nick kicked <- client's isKickedFromServer thisRoomChans <- liftM (map sendChan) $ roomClientsS ri let newRoomName = if (proto < 42) || kicked then nick newMaster else oldRoomName @@ -220,9 +221,9 @@ , isRegisteredOnly = False} ) , ModifyClient2 newMasterId (\c -> c{isMaster = True}) - , ModifyClient (\c -> c{isMaster = False}) + , ModifyClient2 oldMasterId (\c -> c{isMaster = False}) , AnswerClients [sendChan newMaster] ["ROOM_CONTROL_ACCESS", "1"] - , AnswerClients thisRoomChans ["CLIENT_FLAGS", "-h", oldMaster] + , AnswerClients thisRoomChans ["CLIENT_FLAGS", "-h", nick oldMaster] , AnswerClients thisRoomChans ["CLIENT_FLAGS", "+h", nick newMaster] ]