mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(net): add Grunt::ClientLink::LogonStoredSession
This commit is contained in:
parent
f97bf4a876
commit
8e1df61749
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user