Fix OnClientDisconnect() hook of network modules.

It wasn't called for them.
This commit is contained in:
Alexey Sokolov
2011-09-25 03:50:05 +07:00
parent c5578f875d
commit 2dcb3efcc3

View File

@@ -189,7 +189,6 @@ void CClient::ReadLine(const CString& sData) {
// Block PONGs, we already responded to the pings
return;
} else if (sCommand.Equals("QUIT")) {
SetNetwork(NULL, true, false);
Close(Csock::CLT_AFTERWRITE); // Treat a client quit as a detach
return; // Don't forward this msg. We don't want the client getting us disconnected.
} else if (sCommand.Equals("PROTOCTL")) {
@@ -657,10 +656,11 @@ void CClient::ConnectionRefused() {
void CClient::Disconnected() {
DEBUG(GetSockName() << " == Disconnected()");
CIRCNetwork* pNetwork = m_pNetwork;
SetNetwork(NULL, true, false);
if (m_pUser) {
NETWORKMODULECALL(OnClientDisconnect(), m_pUser, m_pNetwork, this, NOTHING);
NETWORKMODULECALL(OnClientDisconnect(), m_pUser, pNetwork, this, NOTHING);
}
}