# HG changeset patch # User unc0rr # Date 1386617577 -14400 # Node ID 5706b637bae2e366dce94e5c714c81d4ee6575ab # Parent 5814e0c47c994f0cdd1dd956182713b13d9512fe - Restrict game config changes in special rooms - /unfix command diff -r 5814e0c47c99 -r 5706b637bae2 gameServer/HWProtoCore.hs --- a/gameServer/HWProtoCore.hs Mon Dec 09 10:59:38 2013 -0500 +++ b/gameServer/HWProtoCore.hs Mon Dec 09 23:32:57 2013 +0400 @@ -52,6 +52,7 @@ return [AnswerClients chans ["CHAT", "[global notice]", p] | isAdministrator cl] h "WATCH" f = return [QueryReplay f] h "FIX" _ = handleCmd ["FIX"] + h "UNFIX" _ = handleCmd ["UNFIX"] h c p = return [Warning $ B.concat ["Unknown cmd: /", c, p]] handleCmd cmd = do diff -r 5814e0c47c99 -r 5706b637bae2 gameServer/HWProtoInRoomState.hs --- a/gameServer/HWProtoInRoomState.hs Mon Dec 09 10:59:38 2013 -0500 +++ b/gameServer/HWProtoInRoomState.hs Mon Dec 09 23:32:57 2013 +0400 @@ -31,7 +31,11 @@ | otherwise = do chans <- roomOthersChans cl <- thisClient - if isMaster cl then + rm <- thisRoom + + if isSpecial rm then + return [Warning $ loc "Restricted"] + else if isMaster cl then return [ ModifyRoom f, AnswerClients chans ("CFG" : paramName : paramStrs)] @@ -291,7 +295,7 @@ if illegalName newName then [Warning $ loc "Illegal room name"] else - if isSpecial rm then + if isSpecial rm then [Warning $ loc "Restricted"] else if isJust $ find (\r -> newName == name r) rs then @@ -370,6 +374,10 @@ cl <- thisClient return [ModifyRoom (\r -> r{isSpecial = True}) | isAdministrator cl] +handleCmd_inRoom ["UNFIX"] = do + cl <- thisClient + return [ModifyRoom (\r -> r{isSpecial = False}) | isAdministrator cl] + handleCmd_inRoom ["LIST"] = return [] -- for old clients (<= 0.9.17)