gameServer/ClientIO.hs
changeset 5001 312f4dd41753
parent 5000 72d8fb26223d
child 5011 73c5839d4447
--- a/gameServer/ClientIO.hs	Sat Mar 12 22:42:01 2011 +0300
+++ b/gameServer/ClientIO.hs	Sat Mar 12 22:55:25 2011 +0300
@@ -66,11 +66,14 @@
     if isQuit answer then
         do
         Exception.handle (\(_ :: Exception.IOException) -> putStrLn "error on sClose") $ sClose s
-        killReciever "Connection closed"
+        killReciever . B.unpack $ quitMessage answer
         else
         clientSendLoop s tId cChan chan ci
 
     where
         killReciever = Exception.throwTo tId . ShutdownThreadException
+        quitMessage ["BYE"] = "bye"
+        quitMessage ("BYE":msg:_) = msg
+        quitMessage _ = error "quitMessage"
         isQuit ("BYE":_) = True
         isQuit _ = False