gameServer/Utils.hs
changeset 5294 67278f1cba2c
parent 5269 e32fc0fcaad0
child 5880 a6573cc5903e
equal deleted inserted replaced
5247:bf6d4bc531d2 5294:67278f1cba2c
    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 [