Implement two more missing protocol commands
authorunc0rr
Mon, 23 Feb 2009 19:01:36 +0000
changeset 1831 025348f05b9f
parent 1830 b3e9ab82c364
child 1832 1fb61a53a2c2
Implement two more missing protocol commands
gameServer/HWProtoInRoomState.hs
--- 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)"]