feat(net): implement GruntLogin::Reconnect

This commit is contained in:
fallenoak 2025-09-30 16:26:20 -05:00
parent eccd46684f
commit f97bf4a876
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
3 changed files with 8 additions and 6 deletions

View File

@ -510,7 +510,7 @@ int32_t Grunt::ClientLink::CmdXferInitiate(CDataStore& msg) {
return 0; return 0;
} }
void Grunt::ClientLink::Connect(const char* a2) { void Grunt::ClientLink::Connect(const char* loginServer) {
if (this->m_state) { if (this->m_state) {
return; return;
} }
@ -523,11 +523,11 @@ void Grunt::ClientLink::Connect(const char* a2) {
this->m_connection = connection; this->m_connection = connection;
this->m_connection->SetType(WOWC_TYPE_STREAM); this->m_connection->SetType(WOWC_TYPE_STREAM);
auto port = SStrChr(a2, ':'); auto port = SStrChr(loginServer, ':');
if (port) { if (port) {
this->m_connection->Connect(a2, 5000); this->m_connection->Connect(loginServer, 5000);
} else { } else {
this->m_connection->Connect(a2, 3724, 5000); this->m_connection->Connect(loginServer, 3724, 5000);
} }
} }

View File

@ -79,7 +79,7 @@ class Grunt::ClientLink : public WowConnectionResponse, Grunt::Pending, Grunt::T
int32_t CmdRealmList(CDataStore& msg); int32_t CmdRealmList(CDataStore& msg);
int32_t CmdXferData(CDataStore& msg); int32_t CmdXferData(CDataStore& msg);
int32_t CmdXferInitiate(CDataStore& msg); int32_t CmdXferInitiate(CDataStore& msg);
void Connect(const char* a2); void Connect(const char* loginServer);
void Disconnect(); void Disconnect();
void GetRealmList(); void GetRealmList();
void LogonNewSession(const Logon& logon); void LogonNewSession(const Logon& logon);

View File

@ -291,7 +291,9 @@ void GruntLogin::ProveVersion(const uint8_t* versionChecksum) {
} }
void GruntLogin::Reconnect() { void GruntLogin::Reconnect() {
// TODO this->m_reconnect = true;
this->m_clientLink->Connect(this->m_loginResponse->GetLoginServer());
} }
void GruntLogin::ReconnectResult(Grunt::Result result, const uint8_t* sessionKey, uint32_t sessionKeyLen, uint16_t flags) { void GruntLogin::ReconnectResult(Grunt::Result result, const uint8_t* sessionKey, uint32_t sessionKeyLen, uint16_t flags) {