--- 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]