gameServer/Utils.hs
branchserver_refactor
changeset 4581 af2e231bd9be
parent 4569 a835465b4fd2
child 4583 ab82045ea083
equal deleted inserted replaced
4579:4e61c2a42121 4581:af2e231bd9be
    75             team : teams
    75             team : teams
    76         else
    76         else
    77             t : replaceTeam team teams
    77             t : replaceTeam team teams
    78 
    78 
    79 illegalName :: B.ByteString -> Bool
    79 illegalName :: B.ByteString -> Bool
    80 illegalName = all isSpace . B.unpack
    80 illegalName b = null s || all isSpace s || isSpace (head s) || isSpace (last s)
       
    81     where
       
    82         s = B.unpack b
    81 
    83 
    82 protoNumber2ver :: Word16 -> B.ByteString
    84 protoNumber2ver :: Word16 -> B.ByteString
    83 protoNumber2ver v = Map.findWithDefault "Unknown" v vermap
    85 protoNumber2ver v = Map.findWithDefault "Unknown" v vermap
    84     where
    86     where
    85         vermap = Map.fromList [
    87         vermap = Map.fromList [