gameServer/HWProtoInRoomState.hs
changeset 8428 73ab5a17ee55
parent 8422 ec41194d4444
child 8429 f814a7c2a318
equal deleted inserted replaced
8427:95289aea4bb9 8428:73ab5a17ee55
   101 
   101 
   102         let maybeTeam = findTeam r
   102         let maybeTeam = findTeam r
   103         let team = fromJust maybeTeam
   103         let team = fromJust maybeTeam
   104 
   104 
   105         return $
   105         return $
   106             if isNothing $ findTeam r then
   106             if isNothing $ maybeTeam then
   107                 [Warning $ loc "REMOVE_TEAM: no such team"]
   107                 [Warning $ loc "REMOVE_TEAM: no such team"]
   108             else if clNick /= teamowner team then
   108             else if clNick /= teamowner team then
   109                 [ProtocolError $ loc "Not team owner!"]
   109                 [ProtocolError $ loc "Not team owner!"]
   110             else
   110             else
   111                 [RemoveTeam tName,
   111                 [RemoveTeam tName,
   130     let team = fromJust maybeTeam
   130     let team = fromJust maybeTeam
   131 
   131 
   132     return $
   132     return $
   133         if not $ isMaster cl then
   133         if not $ isMaster cl then
   134             [ProtocolError $ loc "Not room master"]
   134             [ProtocolError $ loc "Not room master"]
   135         else if hhNumber < 1 || hhNumber > 8 || isNothing maybeTeam || hhNumber > canAddNumber r + hhnum team then
   135         else if isNothing maybeTeam
       
   136             return []
       
   137         else if hhNumber < 1 || hhNumber > 8 || hhNumber > canAddNumber r + hhnum team then
   136             [AnswerClients clChan ["HH_NUM", teamName, showB $ hhnum team]]
   138             [AnswerClients clChan ["HH_NUM", teamName, showB $ hhnum team]]
   137         else
   139         else
   138             [ModifyRoom $ modifyTeam team{hhnum = hhNumber},
   140             [ModifyRoom $ modifyTeam team{hhnum = hhNumber},
   139             AnswerClients roomChans ["HH_NUM", teamName, showB hhNumber]]
   141             AnswerClients roomChans ["HH_NUM", teamName, showB hhNumber]]
   140     where
   142     where