gameServer/Utils.hs
changeset 5060 7d0f6e5b1c1c
parent 5030 42746c5d4a80
child 5269 e32fc0fcaad0
equal deleted inserted replaced
5059:68a5415ca8ea 5060:7d0f6e5b1c1c
   122 readInt_ :: (Num a) => B.ByteString -> a
   122 readInt_ :: (Num a) => B.ByteString -> a
   123 readInt_ str =
   123 readInt_ str =
   124   case B.readInt str of
   124   case B.readInt str of
   125        Just (i, t) | B.null t -> fromIntegral i
   125        Just (i, t) | B.null t -> fromIntegral i
   126        _                      -> 0 
   126        _                      -> 0 
       
   127 
       
   128 cutHost :: B.ByteString -> B.ByteString
       
   129 cutHost = B.intercalate "." .  flip (++) ["*","*"] . List.take 2 . B.split '.'