feat(net): add Grunt::ClientLink dtor

This commit is contained in:
fallenoak 2025-10-09 22:49:20 -05:00
parent 16de9b2cbd
commit 02b709fda8
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 24 additions and 0 deletions

View File

@ -39,6 +39,14 @@ Grunt::ClientLink::ClientLink(Grunt::ClientResponse& clientResponse) {
} }
} }
Grunt::ClientLink::~ClientLink() {
// TODO
this->Shutdown();
// TODO
}
void Grunt::ClientLink::Call() { void Grunt::ClientLink::Call() {
// TODO // TODO
// this->CheckExpired(false); // this->CheckExpired(false);
@ -758,6 +766,20 @@ void Grunt::ClientLink::SetState(STATE state) {
this->m_critSect.Leave(); this->m_critSect.Leave();
} }
void Grunt::ClientLink::Shutdown() {
this->m_critSect.Enter();
if (this->m_connection) {
this->m_connection->Disconnect();
// TODO this->m_connection->SetResponse(nullptr, false);
this->m_connection->Release();
this->m_connection = nullptr;
}
this->m_critSect.Leave();
}
void Grunt::ClientLink::WCCantConnect(WowConnection* conn, uint32_t timeStamp, NETCONNADDR* addr) { void Grunt::ClientLink::WCCantConnect(WowConnection* conn, uint32_t timeStamp, NETCONNADDR* addr) {
// TODO // TODO
} }

View File

@ -64,6 +64,7 @@ class Grunt::ClientLink : public WowConnectionResponse, Grunt::Pending, Grunt::T
uint8_t m_reconnectSessionKey[40]; uint8_t m_reconnectSessionKey[40];
// Virtual member functions // Virtual member functions
virtual ~ClientLink();
virtual void WCMessageReady(WowConnection *conn, uint32_t timeStamp, CDataStore* msg) {}; virtual void WCMessageReady(WowConnection *conn, uint32_t timeStamp, CDataStore* msg) {};
virtual void WCConnected(WowConnection* conn, WowConnection* inbound, uint32_t timeStamp, const NETCONNADDR* addr); virtual void WCConnected(WowConnection* conn, WowConnection* inbound, uint32_t timeStamp, const NETCONNADDR* addr);
virtual void WCCantConnect(WowConnection* conn, uint32_t timeStamp, NETCONNADDR* addr); virtual void WCCantConnect(WowConnection* conn, uint32_t timeStamp, NETCONNADDR* addr);
@ -88,6 +89,7 @@ class Grunt::ClientLink : public WowConnectionResponse, Grunt::Pending, Grunt::T
void ProveVersion(const uint8_t* versionChecksum); void ProveVersion(const uint8_t* versionChecksum);
void Send(CDataStore& msg); void Send(CDataStore& msg);
void SetState(STATE state); void SetState(STATE state);
void Shutdown();
}; };
#endif #endif