tremulous-query 1.0 → 1.0.1
raw patch · 3 files changed
+8/−9 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Network.Tremulous.NameInsensitive: mkColorAlpha :: ByteString -> TI
Files
- Network/Tremulous/NameInsensitive.hs +1/−4
- Network/Tremulous/Protocol.hs +6/−4
- tremulous-query.cabal +1/−1
Network/Tremulous/NameInsensitive.hs view
@@ -1,5 +1,5 @@ module Network.Tremulous.NameInsensitive (- TI(..), mk, mkColor, mkAlphaNum, mkColorAlpha, unpackorig+ TI(..), mk, mkColor, mkAlphaNum, unpackorig ) where import Control.DeepSeq import Data.ByteString.Char8 as B@@ -34,9 +34,6 @@ mkAlphaNum :: ByteString -> TI mkAlphaNum bs = TI bs (B.map toLower $ B.filter isAlphaNum bs)--mkColorAlpha :: ByteString -> TI-mkColorAlpha bs = TI bs (B.map toLower $ B.filter isPrint $ removeColors bs) removeColors :: ByteString -> ByteString removeColors = B.pack . rc . B.unpack
Network/Tremulous/Protocol.hs view
@@ -111,7 +111,7 @@ skipSpace ping <- signed decimal skipSpace- name <- mkColor <$> quoted+ name <- mkColor . clean <$> quoted return Player {..} -- cvar P@@ -143,7 +143,7 @@ mkGameServer :: SockAddr -> [ByteString] -> [(ByteString, ByteString)] -> Maybe GameServer mkGameServer address rawplayers = tupleReader $ do timelimit <- option Nothing maybeInt "timelimit"- hostname <- mkColorAlpha <$> require "sv_hostname"+ hostname <- mkColor . clean <$> require "sv_hostname" protocol <- requireWith maybeInt "protocol" mapname <- option (TI "" "") (mk . clean) "mapname" gamemod <- option Nothing mkMod "gamename"@@ -158,8 +158,7 @@ return GameServer { gameping = -1, nplayers = P.length players, .. } where mkMod "base" = Nothing- mkMod a = Just (mk a)- clean = stripw . B.filter isPrint+ mkMod a = Just (mk (clean a)) parseMasterServer :: ByteString -> [SockAddr] @@ -191,3 +190,6 @@ parseMaybe f xs = case parseOnly f xs of Right a -> Just a Left _ -> Nothing++clean :: ByteString -> ByteString+clean = stripw . B.filter isPrint
tremulous-query.cabal view
@@ -1,5 +1,5 @@ Name: tremulous-query-Version: 1.0+Version: 1.0.1 Author: Christoffer Öjeling Maintainer: Christoffer Öjeling <christoffer@ojeling.net> License: GPL-3