netserver/hedgewars-server.hs
changeset 1598 c853e02ed663
parent 1558 3370b7ffeb5c
child 1686 f42dbc52225c
--- a/netserver/hedgewars-server.hs	Thu Jan 08 13:04:04 2009 +0000
+++ b/netserver/hedgewars-server.hs	Thu Jan 08 15:26:12 2009 +0000
@@ -51,7 +51,21 @@
 	forkIO $ clientRecvLoop cHandle cChan
 	forkIO $ clientSendLoop cHandle cChan sendChan
 	
-	atomically $ writeTChan acceptChan (ClientInfo cChan sendChan cHandle host currentTime "" 0 "" False False False)
+	atomically $ writeTChan acceptChan
+			(ClientInfo
+				cChan
+				sendChan
+				cHandle
+				host
+				currentTime
+				""
+				0
+				""
+				False
+				False
+				False
+				False)
+
 	atomically $ writeTChan cChan ["ASKME"]
 	acceptLoop servSock acceptChan
 
@@ -123,8 +137,9 @@
 
 	clientsIn <- sendAnswers answers mclient mclients mrooms
 	mapM_ (\cl -> atomically $ writeTChan (chan cl) ["QUIT", "Kicked"]) $ filter forceQuit $ clientsIn
-	
-	return (clientsIn, mrooms)
+
+	let clientsFinal = map (\cl -> if partRoom cl then cl{room = [], partRoom = False} else cl) clientsIn
+	return (clientsFinal, mrooms)
 
 
 mainLoop :: ServerInfo -> TChan ClientInfo -> TChan [String] -> [ClientInfo] -> [RoomInfo] -> IO ()