netserver/hedgewars-server.hs
changeset 1465 08e98772235c
parent 1464 693db7cd6f25
child 1466 c68b0a0969d3
--- a/netserver/hedgewars-server.hs	Mon Nov 03 09:49:25 2008 +0000
+++ b/netserver/hedgewars-server.hs	Mon Nov 03 09:55:30 2008 +0000
@@ -61,7 +61,7 @@
 	unless (null recipients) $ putStrLn ("< " ++ (show answer))
 
 	clHandles' <- forM recipients $
-		\ch -> Control.Exception.handle (handleException ch) $ -- cannot just remove
+		\ch -> Control.Exception.handle (\e -> putStrLn ("handle exception: " ++ show e) >> if head answer == "BYE" then return [ch] else return []) $ -- cannot just remove
 			do
 			forM_ answer (\str -> hPutStrLn ch str)
 			hPutStrLn ch ""
@@ -73,15 +73,6 @@
 	sendAnswers answers client mclients rooms
 	where
 		remove list rmClHandles = deleteFirstsBy2t (\ a b -> (Miscutils.handle a) == b) list rmClHandles
-		handleException ch e = do
-			putStrLn ("handle exception: " ++ show e)
-			handleInfo <- hShow ch
-			putStrLn ("handle info: " ++ handleInfo)
-			
-			cl <- hIsClosed ch
-			unless cl (hClose ch)
-			
-			if head answer == "BYE" then return [ch] else return []
 
 
 reactCmd :: [String] -> ClientInfo -> [ClientInfo] -> [RoomInfo] -> IO ([ClientInfo], [RoomInfo])