gameServer/HWProtoCore.hs
changeset 11466 4b5c7a5c49fd
parent 11465 0ae2e4c13bd1
child 11467 f2c36df8c7b1
--- a/gameServer/HWProtoCore.hs	Mon Dec 28 21:21:02 2015 +0300
+++ b/gameServer/HWProtoCore.hs	Mon Dec 28 21:51:12 2015 +0300
@@ -94,9 +94,12 @@
         h "RESTART_SERVER" "YES" = handleCmd ["RESTART_SERVER"]
         h "REGISTERED_ONLY" _ = do
             cl <- thisClient
-            return [ModifyServerInfo(\s -> s{isRegisteredUsersOnly = not $ isRegisteredUsersOnly s})
+            return $ if isAdministrator cl then 
+                [ModifyServerInfo(\s -> s{isRegisteredUsersOnly = not $ isRegisteredUsersOnly s})
                 , AnswerClients [sendChan cl] ["CHAT", "[server]", "'Registered only' state toggled"]
                 ]
+                else
+                []
         h c p = return [Warning $ B.concat ["Unknown cmd: /", c, " ", p]]
 
         extractParameters p = let (a, b) = B.break (== ' ') p in (upperCase a, B.dropWhile (== ' ') b)