gameServer/HWProtoCore.hs
changeset 11465 0ae2e4c13bd1
parent 11054 6e575b29881c
child 11466 4b5c7a5c49fd
--- a/gameServer/HWProtoCore.hs	Mon Dec 28 09:06:29 2015 +0300
+++ b/gameServer/HWProtoCore.hs	Mon Dec 28 21:21:02 2015 +0300
@@ -92,6 +92,11 @@
         h "MAXTEAMS" n | not $ B.null n = handleCmd ["MAXTEAMS", n]
         h "INFO" n | not $ B.null n = handleCmd ["INFO", n]
         h "RESTART_SERVER" "YES" = handleCmd ["RESTART_SERVER"]
+        h "REGISTERED_ONLY" _ = do
+            cl <- thisClient
+            return [ModifyServerInfo(\s -> s{isRegisteredUsersOnly = not $ isRegisteredUsersOnly s})
+                , AnswerClients [sendChan cl] ["CHAT", "[server]", "'Registered only' state toggled"]
+                ]
         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)