gameServer/ClientIO.hs
changeset 3566 772a46ef8288
parent 3501 a3159a410e5c
child 3671 a94d1dc4a8d9
--- a/gameServer/ClientIO.hs	Sat Jun 26 16:58:19 2010 +0400
+++ b/gameServer/ClientIO.hs	Sun Jun 27 21:06:41 2010 +0400
@@ -32,7 +32,7 @@
                         Left bufTail
                         else
                         Right (B.splitWith (== '\n') bsPacket, bufTail)
-                   
+
 
 listenLoop :: Socket -> Chan CoreMessage -> ClientIndex -> IO ()
 listenLoop sock chan ci = recieveWithBufferLoop B.empty
@@ -53,7 +53,7 @@
     msg <- (listenLoop s chan ci >> return "Connection closed") `catch` (return . B.pack . show)
     clientOff msg
     where 
-        clientOff msg = writeChan chan $ ClientMessage (ci, ["QUIT", msg])
+        clientOff msg = mapM_ (writeChan chan) [ClientMessage (ci, ["QUIT", msg]), Remove ci]