--- 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)