gameServer/HWProtoInRoomState.hs
changeset 1831 025348f05b9f
parent 1818 4391c7037281
child 1866 36aa0ca6e8af
--- a/gameServer/HWProtoInRoomState.hs	Mon Feb 23 18:58:22 2009 +0000
+++ b/gameServer/HWProtoInRoomState.hs	Mon Feb 23 19:01:36 2009 +0000
@@ -177,4 +177,22 @@
 		answerRemovedTeams = map (\t -> AnswerThisRoom ["REMOVE_TEAM", t]) $ leftTeams room
 
 
+handleCmd_inRoom clID clients _ ["TOGGLE_RESTRICT_JOINS"] =
+	if isMaster client then
+		[ModifyRoom (\r -> r{isRestrictedJoins = not $ isRestrictedJoins r})]
+	else
+		[ProtocolError "Not room master"]
+	where
+		client = clients IntMap.! clID
+
+
+handleCmd_inRoom clID clients _ ["TOGGLE_RESTRICT_TEAMS"] =
+	if isMaster client then
+		[ModifyRoom (\r -> r{isRestrictedTeams = not $ isRestrictedTeams r})]
+	else
+		[ProtocolError "Not room master"]
+	where
+		client = clients IntMap.! clID
+
+
 handleCmd_inRoom clID _ _ _ = [ProtocolError "Incorrect command (state: in room)"]