Fix 'non-exhaustive pattern' crash
authorunc0rr
Sat, 24 Aug 2013 10:07:34 +0400
changeset 9421 90fe753b3654
parent 9419 fa8324ed4702
child 9423 43798a77f1d1
Fix 'non-exhaustive pattern' crash
gameServer/OfficialServer/checker.hs
gameServer/OfficialServer/extdbinterface.hs
--- a/gameServer/OfficialServer/checker.hs	Sat Aug 24 13:33:34 2013 +0200
+++ b/gameServer/OfficialServer/checker.hs	Sat Aug 24 10:07:34 2013 +0400
@@ -73,6 +73,7 @@
                 , "--prefix", "/usr/home/unC0Rr/Sources/Hedgewars/Releases/0.9.19/share/hedgewars/Data"
                 , "--nomusic"
                 , "--nosound"
+                , "--stats-only"
                 ])
             {std_err = CreatePipe}
     hSetBuffering hOut LineBuffering
--- a/gameServer/OfficialServer/extdbinterface.hs	Sat Aug 24 13:33:34 2013 +0200
+++ b/gameServer/OfficialServer/extdbinterface.hs	Sat Aug 24 10:07:34 2013 +0400
@@ -60,6 +60,7 @@
 parseStats :: B.ByteString -> [(B.ByteString, B.ByteString)] -> [B.ByteString] -> [[SqlValue]]
 parseStats fileName teams = ps
     where
+    ps [] = []
     ps ("DRAW" : bs) = ps bs
     ps ("WINNERS" : n : bs) = ps $ drop (readInt_ n) bs
     ps ("ACHIEVEMENT" : typ : teamname : location : value : bs) =
@@ -69,6 +70,8 @@
         , SqlByteString fileName
         , SqlByteString location
         ] : ps bs
+    ps (b:bs) = ps bs
+
 
 dbConnectionLoop mySQLConnectionInfo =
     Control.Exception.handle (\(e :: IOException) -> hPutStrLn stderr $ show e) $ handleSqlError $