gameServer/Utils.hs
changeset 3555 4c5ca656d1bb
parent 3501 a3159a410e5c
child 3671 a94d1dc4a8d9
equal deleted inserted replaced
3553:eed7ab6a5087 3555:4c5ca656d1bb
    50 maybeRead :: Read a => String -> Maybe a
    50 maybeRead :: Read a => String -> Maybe a
    51 maybeRead s = case reads s of
    51 maybeRead s = case reads s of
    52     [(x, rest)] | all isSpace rest -> Just x
    52     [(x, rest)] | all isSpace rest -> Just x
    53     _         -> Nothing
    53     _         -> Nothing
    54 
    54 
    55 teamToNet :: Word16 -> TeamInfo -> [B.ByteString]
    55 teamToNet :: TeamInfo -> [B.ByteString]
    56 teamToNet protocol team 
    56 teamToNet team =
    57     | protocol < 30 =
       
    58         "ADD_TEAM"
       
    59         : teamname team
       
    60         : teamgrave team
       
    61         : teamfort team
       
    62         : teamvoicepack team
       
    63         : teamowner team
       
    64         : (B.pack $ show $ difficulty team)
       
    65         : hhsInfo
       
    66     | otherwise = 
       
    67         "ADD_TEAM"
    57         "ADD_TEAM"
    68         : teamname team
    58         : teamname team
    69         : teamgrave team
    59         : teamgrave team
    70         : teamfort team
    60         : teamfort team
    71         : teamvoicepack team
    61         : teamvoicepack team