diff -r b3e9ab82c364 -r 025348f05b9f 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)"]