gameServer/Utils.hs
changeset 5269 e32fc0fcaad0
parent 5060 7d0f6e5b1c1c
child 5880 a6573cc5903e
equal deleted inserted replaced
5268:eedc0f8ed38b 5269:e32fc0fcaad0
    73             tm : ts
    73             tm : ts
    74         else
    74         else
    75             t : replaceTeam tm ts
    75             t : replaceTeam tm ts
    76 
    76 
    77 illegalName :: B.ByteString -> Bool
    77 illegalName :: B.ByteString -> Bool
    78 illegalName s = B.null s || B.all isSpace s || isSpace (B.head s) || isSpace (B.last s)
    78 illegalName s = B.null s || B.all isSpace s || isSpace (B.head s) || isSpace (B.last s) || B.any isIllegalChar s
       
    79     where
       
    80         isIllegalChar c = c `List.elem` "$()*+?[]^{|}"
    79 
    81 
    80 protoNumber2ver :: Word16 -> B.ByteString
    82 protoNumber2ver :: Word16 -> B.ByteString
    81 protoNumber2ver v = Map.findWithDefault "Unknown" v vermap
    83 protoNumber2ver v = Map.findWithDefault "Unknown" v vermap
    82     where
    84     where
    83         vermap = Map.fromList [
    85         vermap = Map.fromList [