Fix ghost players (used Prelude.catch instead of Control.Exception.catch)
authorunc0rr
Mon, 21 Mar 2011 21:38:44 +0300
changeset 5037 1edc06d2247c
parent 5036 cb5fa93c7ae0
child 5038 c77241027071
Fix ghost players (used Prelude.catch instead of Control.Exception.catch)
gameServer/ClientIO.hs
gameServer/hedgewars-server.cabal
--- a/gameServer/ClientIO.hs	Mon Mar 21 21:23:39 2011 +0300
+++ b/gameServer/ClientIO.hs	Mon Mar 21 21:38:44 2011 +0300
@@ -44,7 +44,10 @@
 
 clientRecvLoop :: Socket -> Chan CoreMessage -> ClientIndex -> IO ()
 clientRecvLoop s chan ci =
-        (listenLoop s chan ci >> return "Connection closed") `catch` (return . B.pack . show) >>= clientOff >> remove
+        (listenLoop s chan ci >> return "Connection closed")
+        `Exception.catch` (\(e :: ShutdownThreadException) -> return . B.pack . show $ e)
+        `Exception.catch` (\(e :: Exception.IOException) -> return . B.pack . show $ e)
+        >>= clientOff >> remove
     where
         clientOff msg = writeChan chan $ ClientMessage (ci, ["QUIT", msg])
         remove = writeChan chan $ Remove ci
--- a/gameServer/hedgewars-server.cabal	Mon Mar 21 21:23:39 2011 +0300
+++ b/gameServer/hedgewars-server.cabal	Mon Mar 21 21:38:44 2011 +0300
@@ -25,7 +25,7 @@
     network,
     time,
     stm,
-    mtl,
+    mtl >= 2,
     dataenc,
     hslogger,
     process,