# HG changeset patch # User unc0rr # Date 1235415696 0 # Node ID 025348f05b9fe44ce96bf60e58ed4c2b12b97f5e # Parent b3e9ab82c3648827a9e68523c0d3ef191be4c675 Implement two more missing protocol commands 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)"]