feat(net): add Grunt::ClientLink::LogonStoredSession

This commit is contained in:
fallenoak 2025-09-30 19:55:31 -05:00
parent f97bf4a876
commit 8e1df61749
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
3 changed files with 29 additions and 1 deletions

View File

@ -592,6 +592,30 @@ void Grunt::ClientLink::LogonNewSession(const Grunt::ClientLink::Logon& logon) {
this->Send(clientChallenge);
}
void Grunt::ClientLink::LogonStoredSession(const Grunt::ClientLink::Logon& logon) {
this->SetState(STATE_AUTH_CHALLENGE);
SStrCopy(this->m_accountName, logon.accountName, sizeof(this->m_accountName));
SStrUpper(this->m_accountName);
// logon.password is copy of session key from original session
memcpy(this->m_reconnectSessionKey, logon.password, sizeof(this->m_reconnectSessionKey));
CDataStoreCache<1024> clientChallenge;
uint8_t opcode = CMD_AUTH_RECONNECT_CHALLENGE;
clientChallenge.Put(opcode);
uint8_t protocol = 8;
clientChallenge.Put(protocol);
this->PackLogon(clientChallenge, logon);
clientChallenge.Finalize();
this->Send(clientChallenge);
}
void Grunt::ClientLink::PackLogon(CDataStore& msg, const Logon& logon) {
uint32_t startPos = msg.Size();
uint16_t tmpSize = 0;

View File

@ -83,6 +83,7 @@ class Grunt::ClientLink : public WowConnectionResponse, Grunt::Pending, Grunt::T
void Disconnect();
void GetRealmList();
void LogonNewSession(const Logon& logon);
void LogonStoredSession(const Logon& logon);
void PackLogon(CDataStore& msg, const Logon& logon);
void ProveVersion(const uint8_t* versionChecksum);
void Send(CDataStore& msg);

View File

@ -60,7 +60,10 @@ void GruntLogin::GetLogonMethod() {
// TODO
if (this->IsReconnect()) {
// TODO
logon.accountName = this->m_accountName;
logon.password = reinterpret_cast<const char*>(this->m_sessionKey);
this->m_clientLink->LogonStoredSession(logon);
} else if (this->m_password) {
this->m_loginResponse->UpdateLoginStatus(
LOGIN_STATE_AUTHENTICATING,