feat(net): handle account flags, logon flags, and survey id

This commit is contained in:
fallenoak 2023-02-07 12:10:44 -06:00
parent 613b2724e2
commit 191ce79fb3
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
3 changed files with 14 additions and 12 deletions

View File

@ -211,7 +211,7 @@ int32_t Grunt::ClientLink::CmdAuthLogonProof(CDataStore& msg) {
uint8_t result;
msg.Get(result);
// Auth failure (success == 0)
// Authentication failure (result for success is 0)
if (result != 0) {
if (result == 4) {
// TODO
@ -232,33 +232,33 @@ int32_t Grunt::ClientLink::CmdAuthLogonProof(CDataStore& msg) {
return 2;
}
// Auth success
// Authentication success
if (msg.m_read <= msg.m_size && msg.m_size - msg.m_read >= 24) {
void* serverProof;
msg.GetDataInSitu(serverProof, 20);
uint32_t v17 = 0;
msg.Get(v17);
uint32_t accountFlags = 0x0;
msg.Get(accountFlags);
uint32_t v14;
msg.Get(v14);
uint32_t surveyID;
msg.Get(surveyID);
if (msg.m_read <= msg.m_size && msg.m_size - msg.m_read >= 2) {
uint16_t v16 = 0;
msg.Get(v16);
uint16_t logonFlags = 0x0;
msg.Get(logonFlags);
if (msg.m_read <= msg.m_size) {
if (this->m_srpClient.VerifyServerProof(static_cast<uint8_t*>(serverProof), 20)) {
this->SetState(2);
this->m_clientResponse->LogonResult(Grunt::GRUNT_RESULT_11, nullptr, 0, 0);
} else {
this->m_accountFlags = accountFlags;
// TODO
// this->uint98 = v17;
// this->uint94 = 0;
// this->uint9C = v14;
this->m_surveyID = surveyID;
this->SetState(6);
this->m_clientResponse->LogonResult(Grunt::GRUNT_RESULT_0, this->m_srpClient.sessionKey, 40, v16);
this->m_clientResponse->LogonResult(Grunt::GRUNT_RESULT_0, this->m_srpClient.sessionKey, 40, logonFlags);
}
return 2;

View File

@ -40,6 +40,8 @@ class Grunt::ClientLink : public WowConnectionResponse, Grunt::Pending, Grunt::T
// Member variables
Grunt::Timer m_timer;
uint32_t m_accountFlags = 0x0;
uint32_t m_surveyID = 0;
uint32_t m_clientIP = 0;
int32_t m_state;
SRP6_Client m_srpClient;

View File

@ -15,7 +15,7 @@ class Grunt::ClientResponse {
virtual void SetPinInfo(bool enabled, uint32_t a3, const uint8_t* a4) = 0;
virtual void SetMatrixInfo(bool enabled, uint8_t a3, uint8_t a4, uint8_t a5, uint8_t a6, bool a7, uint8_t a8, uint64_t a9, const uint8_t* a10, uint32_t a11) = 0;
virtual void SetTokenInfo(bool enabled, uint8_t required) = 0;
virtual void LogonResult(Result result, const uint8_t* a3, uint32_t a4, uint16_t a5) = 0;
virtual void LogonResult(Result result, const uint8_t* sessionKey, uint32_t sessionKeyLen, uint16_t flags) = 0;
virtual LOGIN_STATE NextSecurityState(LOGIN_STATE state) = 0;
virtual void GetRealmList() = 0;
virtual void Logon(const char* a2, const char* a3) = 0;