# HG changeset patch # User unc0rr # Date 1299785320 -10800 # Node ID cdcdf37e55324b70b9809318017bd5981328e190 # Parent 28c670367e6c3818533a3ffd97cf900aef15851d Send QUIT on exception too. This leads to double QUIT for a usual disconnection, yet is safe. Should fix crashes. diff -r 28c670367e6c -r cdcdf37e5532 gameServer/Actions.hs --- a/gameServer/Actions.hs Wed Mar 09 22:39:35 2011 +0100 +++ b/gameServer/Actions.hs Thu Mar 10 22:28:40 2011 +0300 @@ -138,6 +138,8 @@ put $! s{removedClients = ci `Set.insert` removedClients s} processAction (DeleteClient ci) = do + io $ debugM "Clients" $ "DeleteClient: " ++ show ci + rnc <- gets roomsClients io $ removeClient rnc ci diff -r 28c670367e6c -r cdcdf37e5532 gameServer/ClientIO.hs --- a/gameServer/ClientIO.hs Wed Mar 09 22:39:35 2011 +0100 +++ b/gameServer/ClientIO.hs Thu Mar 10 22:28:40 2011 +0300 @@ -51,6 +51,8 @@ msg <- (listenLoop s chan ci >> return "Connection closed") `catch` (return . B.pack . show) clientOff msg `Exception.finally` + do + clientOff "Connection closed ()" remove where clientOff msg = writeChan chan $ ClientMessage (ci, ["QUIT", msg]) diff -r 28c670367e6c -r cdcdf37e5532 gameServer/ServerCore.hs --- a/gameServer/ServerCore.hs Wed Mar 09 22:39:35 2011 +0100 +++ b/gameServer/ServerCore.hs Thu Mar 10 22:28:40 2011 +0300 @@ -49,8 +49,7 @@ put $! as{clientIndex = Just ci} reactCmd cmd - Remove ci -> do - liftIO $ debugM "Clients" $ "DeleteClient: " ++ show ci + Remove ci -> processAction (DeleteClient ci) ClientAccountInfo ci uid info -> do