gameServer/Utils.hs
changeset 8780 486edbbe72b5
parent 8401 87410ae372f6
child 9086 77f471657230
equal deleted inserted replaced
8776:ef64fd1f79a7 8780:486edbbe72b5
    54             tm : ts
    54             tm : ts
    55         else
    55         else
    56             t : replaceTeam tm ts
    56             t : replaceTeam tm ts
    57 
    57 
    58 illegalName :: B.ByteString -> Bool
    58 illegalName :: B.ByteString -> Bool
    59 illegalName s = B.null s || B.all isSpace s || isSpace (B.head s) || isSpace (B.last s) || B.any isIllegalChar s
    59 illegalName s = B.null s || B.length s > 40 || B.all isSpace s || isSpace (B.head s) || isSpace (B.last s) || B.any isIllegalChar s
    60     where
    60     where
    61         isIllegalChar c = c `List.elem` "$()*+?[]^{|}"
    61         isIllegalChar c = c `List.elem` "$()*+?[]^{|}"
    62 
    62 
    63 protoNumber2ver :: Word16 -> B.ByteString
    63 protoNumber2ver :: Word16 -> B.ByteString
    64 protoNumber2ver v = Map.findWithDefault "Unknown" v vermap
    64 protoNumber2ver v = Map.findWithDefault "Unknown" v vermap