Update checker a bit
authorunc0rr
Sun, 19 Nov 2017 22:35:16 +0100
changeset 12840 ad2d448bbcab
parent 12839 7f9a861ac88a
child 12841 afd312fc270d
Update checker a bit
gameServer/OfficialServer/checker.hs
--- a/gameServer/OfficialServer/checker.hs	Fri Nov 17 21:15:13 2017 +0100
+++ b/gameServer/OfficialServer/checker.hs	Sun Nov 19 22:35:16 2017 +0100
@@ -37,6 +37,7 @@
 import qualified Codec.Binary.Base64 as Base64
 import System.Process
 import Data.Maybe
+import Data.Either
 import qualified Data.List as L
 #if !defined(mingw32_HOST_OS)
 import System.Posix
@@ -54,7 +55,7 @@
     deriving Show
 
 serverAddress = "netserver.hedgewars.org"
-protocolNumber = "51"
+protocolNumber = "53"
 
 getLines :: Handle -> IO [B.ByteString]
 getLines h = g
@@ -92,7 +93,7 @@
 checkReplay home exe prefix coreChan msgs = do
     tempDir <- getTemporaryDirectory
     (fileName, h) <- openBinaryTempFile tempDir "checker-demo"
-    B.hPut h . BW.pack . concat . map (fromMaybe [] . Base64.decode . B.unpack) $ msgs
+    B.hPut h . B.concat . map (either (const B.empty) id . Base64.decode) $ msgs
     hFlush h
     hClose h