gameServer/HWProtoInRoomState.hs
branchflibqtfrontend
changeset 8227 3a2ce574aa3b
parent 8189 328f429c3ecc
child 8244 0f8893faeb00
--- a/gameServer/HWProtoInRoomState.hs	Wed Dec 05 13:31:08 2012 -0500
+++ b/gameServer/HWProtoInRoomState.hs	Wed Dec 05 23:25:11 2012 +0400
@@ -264,6 +264,14 @@
             [ModifyRoom (\r -> r{isRestrictedTeams = not $ isRestrictedTeams r})]
 
 
+handleCmd_inRoom ["TOGGLE_REGISTERED_ONLY"] = do
+    cl <- thisClient
+    return $
+        if not $ isMaster cl then
+            [ProtocolError "Not room master"]
+        else
+            [ModifyRoom (\r -> r{isRegisteredOnly = not $ isRegisteredOnly r})]
+
 handleCmd_inRoom ["ROOM_NAME", newName] = do
     cl <- thisClient
     rs <- allRoomInfos