gameServer/HWProtoInRoomState.hs
changeset 10730 eac6a4d53752
parent 10511 c33b2f001730
child 10732 7c4f9e5e447c
equal deleted inserted replaced
10728:d58d7d8b5392 10730:eac6a4d53752
    85 
    85 
    86         if isSpecial rm then
    86         if isSpecial rm then
    87             return [Warning $ loc "Restricted"]
    87             return [Warning $ loc "Restricted"]
    88         else if isMaster cl then
    88         else if isMaster cl then
    89            return [
    89            return [
    90                 ModifyRoom f,
    90                 ModifyRoom $ f (clientProto cl),
    91                 AnswerClients chans ("CFG" : paramName : paramStrs)]
    91                 AnswerClients chans ("CFG" : paramName : paramStrs)]
    92             else
    92             else
    93             return [ProtocolError $ loc "Not room master"]
    93             return [ProtocolError $ loc "Not room master"]
    94     where
    94     where
    95         f r = if paramName `Map.member` (mapParams r) then
    95         f clproto r = if paramName `Map.member` (mapParams r) then
    96                 r{mapParams = Map.insert paramName (head paramStrs) (mapParams r)}
    96                 r{mapParams = Map.insert paramName (head paramStrs) (mapParams r)}
    97                 else
    97                 else
    98                 r{params = Map.insert paramName paramStrs (params r)}
    98                 r{params = Map.insert paramName (fixedParamStr clproto) (params r)}
       
    99         fixedParamStr clproto
       
   100             | clproto /= 49 = paramStrs
       
   101             | paramName /= "SCHEME" = paramStrs
       
   102             | otherwise = L.init paramStrs ++ [B.replicate 50 'X' `B.append` L.last paramStrs]
    99 
   103 
   100 
   104 
   101 handleCmd_inRoom ("ADD_TEAM" : tName : color : grave : fort : voicepack : flag : difStr : hhsInfo)
   105 handleCmd_inRoom ("ADD_TEAM" : tName : color : grave : fort : voicepack : flag : difStr : hhsInfo)
   102     | length hhsInfo /= 16 = return [ProtocolError $ loc "Corrupted hedgehogs info"]
   106     | length hhsInfo /= 16 = return [ProtocolError $ loc "Corrupted hedgehogs info"]
   103     | otherwise = do
   107     | otherwise = do