Forbid /delegate to room admin
authorunc0rr
Mon, 25 Nov 2013 01:03:14 +0400
changeset 9715 30a303d226f9
parent 9713 cd1d63c355a6
child 9716 f1698baccaef
Forbid /delegate to room admin
gameServer/HWProtoInRoomState.hs
--- a/gameServer/HWProtoInRoomState.hs	Sun Nov 24 14:03:33 2013 -0500
+++ b/gameServer/HWProtoInRoomState.hs	Mon Nov 25 01:03:14 2013 +0400
@@ -323,6 +323,7 @@
     maybeClientId <- clientByNick newAdmin
     master <- liftM isMaster thisClient
     serverAdmin <- liftM isAdministrator thisClient
+    thisRoomMasterId <- liftM masterID thisRoom
     let newAdminId = fromJust maybeClientId
     let sameRoom = clientRoom rnc thisClientId == clientRoom rnc newAdminId
     return
@@ -330,6 +331,7 @@
             (master || serverAdmin)
                 && isJust maybeClientId
                 && ((newAdminId /= thisClientId) || (serverAdmin && not master))
+                && (newAdminId /= thisRoomMasterId)
                 && sameRoom]