Add some verbosity to server's console messages
authorunc0rr
Wed, 05 Nov 2008 08:02:12 +0000
changeset 1477 001a52a108ed
parent 1476 b3b28e99570f
child 1478 8bfb417d165e
Add some verbosity to server's console messages
QTfrontend/teamselhelper.cpp
netserver/hedgewars-server.hs
--- a/QTfrontend/teamselhelper.cpp	Tue Nov 04 22:56:36 2008 +0000
+++ b/QTfrontend/teamselhelper.cpp	Wed Nov 05 08:02:12 2008 +0000
@@ -89,7 +89,6 @@
 	}
 	
 	colorButt->setEnabled(interactive);
-	//phhoger->setNonInteractive();
 	phhoger->setEnabled(interactive);
 }
 
--- a/netserver/hedgewars-server.hs	Tue Nov 04 22:56:36 2008 +0000
+++ b/netserver/hedgewars-server.hs	Wed Nov 05 08:02:12 2008 +0000
@@ -30,6 +30,7 @@
 acceptLoop :: Socket -> TChan ClientInfo -> IO ()
 acceptLoop servSock acceptChan = Control.Exception.handle (const $ putStrLn "exception on connect" >> acceptLoop servSock acceptChan) $ do
 	(cHandle, host, port) <- accept servSock
+	putStrLn "new client"
 	cChan <- atomically newTChan
 	forkIO $ clientLoop cHandle cChan
 	atomically $ writeTChan acceptChan (ClientInfo cChan cHandle "" 0 "" False False False)
@@ -74,6 +75,7 @@
 			if head answer == "BYE" then return [ch] else return []
 
 	let outHandles = concat clHandles'
+	unless (null outHandles) $ putStrLn ("bye: " ++ (show $ length outHandles) ++ "/" ++ (show $ length clients) ++ " clients")
 	mapM_ (\ch -> Control.Exception.handle (const $ putStrLn "error on hClose") (hClose ch)) outHandles
 	let mclients = remove clients outHandles