mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(net): implement remaining failure cases in GruntLogin::LogonResult
This commit is contained in:
parent
ecc43fe40b
commit
8b4cc6121a
@ -314,7 +314,7 @@ int32_t Grunt::ClientLink::CmdAuthLogonProof(CDataStore& msg) {
|
||||
if (verifyResult != SRP6_OK) {
|
||||
this->SetState(STATE_CONNECTED);
|
||||
|
||||
this->m_clientResponse->LogonResult(Grunt::GRUNT_RESULT_11, nullptr, 0, 0x0);
|
||||
this->m_clientResponse->LogonResult(Result::GRUNT_RESULT_11, nullptr, 0, 0x0);
|
||||
|
||||
return 2;
|
||||
}
|
||||
@ -328,7 +328,7 @@ int32_t Grunt::ClientLink::CmdAuthLogonProof(CDataStore& msg) {
|
||||
|
||||
this->SetState(STATE_AUTHENTICATED);
|
||||
|
||||
this->m_clientResponse->LogonResult(Grunt::GRUNT_RESULT_0, this->m_srpClient.sessionKey, 40, logonFlags);
|
||||
this->m_clientResponse->LogonResult(Result::SUCCESS, this->m_srpClient.sessionKey, 40, logonFlags);
|
||||
|
||||
return 2;
|
||||
}
|
||||
@ -412,7 +412,7 @@ int32_t Grunt::ClientLink::CmdAuthReconnectProof(CDataStore& msg) {
|
||||
|
||||
this->SetState(STATE_AUTHENTICATED);
|
||||
|
||||
this->m_clientResponse->ReconnectResult(Grunt::GRUNT_RESULT_0, this->m_reconnectSessionKey, 40, reconnectFlags);
|
||||
this->m_clientResponse->ReconnectResult(Result::SUCCESS, this->m_reconnectSessionKey, 40, reconnectFlags);
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
@ -12,40 +12,41 @@ namespace Grunt {
|
||||
extern Command<ClientLink> s_clientCommands[];
|
||||
|
||||
enum Result {
|
||||
GRUNT_RESULT_0 = 0,
|
||||
GRUNT_RESULT_1 = 1,
|
||||
GRUNT_RESULT_2 = 2,
|
||||
GRUNT_RESULT_3 = 3,
|
||||
GRUNT_RESULT_4 = 4,
|
||||
GRUNT_RESULT_5 = 5,
|
||||
GRUNT_RESULT_6 = 6,
|
||||
GRUNT_RESULT_7 = 7,
|
||||
GRUNT_RESULT_8 = 8,
|
||||
GRUNT_RESULT_9 = 9,
|
||||
GRUNT_RESULT_10 = 10,
|
||||
GRUNT_RESULT_11 = 11,
|
||||
GRUNT_RESULT_12 = 12,
|
||||
GRUNT_RESULT_13 = 13,
|
||||
GRUNT_RESULT_14 = 14,
|
||||
GRUNT_RESULT_15 = 15,
|
||||
GRUNT_RESULT_16 = 16,
|
||||
GRUNT_RESULT_17 = 17,
|
||||
GRUNT_RESULT_18 = 18,
|
||||
GRUNT_RESULT_19 = 19,
|
||||
GRUNT_RESULT_20 = 20,
|
||||
GRUNT_RESULT_21 = 21,
|
||||
GRUNT_RESULT_22 = 22,
|
||||
GRUNT_RESULT_23 = 23,
|
||||
GRUNT_RESULT_24 = 24,
|
||||
GRUNT_RESULT_25 = 25,
|
||||
GRUNT_RESULT_26 = 26,
|
||||
GRUNT_RESULT_27 = 27,
|
||||
GRUNT_RESULT_28 = 28,
|
||||
GRUNT_RESULT_29 = 29,
|
||||
GRUNT_RESULT_30 = 30,
|
||||
GRUNT_RESULT_31 = 31,
|
||||
GRUNT_RESULT_32 = 32,
|
||||
SUCCESS = 0,
|
||||
GRUNT_RESULT_1 = 1,
|
||||
GRUNT_RESULT_2 = 2,
|
||||
BANNED = 3,
|
||||
GRUNT_RESULT_4 = 4,
|
||||
GRUNT_RESULT_5 = 5,
|
||||
ALREADYONLINE = 6,
|
||||
NOTIME = 7,
|
||||
DBBUSY = 8,
|
||||
BADVERSION = 9,
|
||||
DOWNLOADFILE = 10,
|
||||
GRUNT_RESULT_11 = 11,
|
||||
SUSPENDED = 12,
|
||||
GRUNT_RESULT_13 = 13,
|
||||
SUCCESS_SURVEY = 14,
|
||||
PARENTALCONTROL = 15,
|
||||
LOCKED_ENFORCED = 16,
|
||||
TRIAL_EXPIRED = 17,
|
||||
ACCOUNT_CONVERTED = 18,
|
||||
GRUNT_RESULT_19 = 19,
|
||||
GRUNT_RESULT_20 = 20,
|
||||
GRUNT_RESULT_21 = 21,
|
||||
CHARGEBACK = 22,
|
||||
IGR_WITHOUT_BNET = 23,
|
||||
GAME_ACCOUNT_LOCKED = 24,
|
||||
UNLOCKABLE_LOCK = 25,
|
||||
GRUNT_RESULT_26 = 26,
|
||||
GRUNT_RESULT_27 = 27,
|
||||
GRUNT_RESULT_28 = 28,
|
||||
GRUNT_RESULT_29 = 29,
|
||||
GRUNT_RESULT_30 = 30,
|
||||
GRUNT_RESULT_31 = 31,
|
||||
CONVERSION_REQUIRED = 32,
|
||||
GRUNT_RESULT_LAST,
|
||||
DISCONNECTED = 255
|
||||
};
|
||||
|
||||
extern const char* g_LoginResultStringNames[];
|
||||
|
||||
@ -162,7 +162,10 @@ void GruntLogin::Logon(const char* loginServer, const char* loginPortal) {
|
||||
}
|
||||
|
||||
void GruntLogin::LogonResult(Grunt::Result result, const uint8_t* sessionKey, uint32_t sessionKeyLen, uint16_t flags) {
|
||||
using ::Grunt::Result;
|
||||
|
||||
// Reconnect
|
||||
|
||||
if (this->IsReconnect()) {
|
||||
// TODO
|
||||
// this->m_loginResponse->HandleRealmData(1, 0);
|
||||
@ -172,7 +175,8 @@ void GruntLogin::LogonResult(Grunt::Result result, const uint8_t* sessionKey, ui
|
||||
}
|
||||
|
||||
// Authentication success
|
||||
if (result == Grunt::GRUNT_RESULT_0 || result == Grunt::GRUNT_RESULT_14) {
|
||||
|
||||
if (result == Result::SUCCESS || result == Result::SUCCESS_SURVEY) {
|
||||
// TODO
|
||||
// this->uint8 = 0;
|
||||
// LOBYTE(this->uint105C) = 0;
|
||||
@ -206,12 +210,12 @@ void GruntLogin::LogonResult(Grunt::Result result, const uint8_t* sessionKey, ui
|
||||
// TODO this->uint8 = 1;
|
||||
|
||||
switch (result) {
|
||||
case 3:
|
||||
case Result::BANNED:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_BANNED, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case 5: {
|
||||
case Result::GRUNT_RESULT_4:
|
||||
case Result::GRUNT_RESULT_5: {
|
||||
LOGIN_RESULT loginResult = LOGIN_UNKNOWN_ACCOUNT;
|
||||
|
||||
// TODO
|
||||
@ -224,58 +228,69 @@ void GruntLogin::LogonResult(Grunt::Result result, const uint8_t* sessionKey, ui
|
||||
break;
|
||||
}
|
||||
|
||||
case 6:
|
||||
case Result::ALREADYONLINE:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_ALREADYONLINE, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
case 7:
|
||||
case Result::NOTIME:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_NOTIME, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
case 8:
|
||||
case Result::DBBUSY:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_DBBUSY, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
case Result::BADVERSION:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_BADVERSION, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
case Result::DOWNLOADFILE:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_DOWNLOADFILE, LOGIN_OK, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
case 12:
|
||||
case Result::SUSPENDED:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_SUSPENDED, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
case 15:
|
||||
// TODO
|
||||
case Result::PARENTALCONTROL:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_PARENTALCONTROL, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
// TODO
|
||||
case Result::LOCKED_ENFORCED:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_LOCKED_ENFORCED, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
case 17:
|
||||
// TODO
|
||||
case Result::TRIAL_EXPIRED:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_TRIAL_EXPIRED, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
case 18:
|
||||
// TODO
|
||||
case Result::ACCOUNT_CONVERTED:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_ACCOUNT_CONVERTED, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
case 22:
|
||||
// TODO
|
||||
case Result::CHARGEBACK:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_CHARGEBACK, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
case 23:
|
||||
// TODO
|
||||
case Result::IGR_WITHOUT_BNET:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_IGR_WITHOUT_BNET, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
case 24:
|
||||
// TODO
|
||||
case Result::GAME_ACCOUNT_LOCKED:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_GAME_ACCOUNT_LOCKED, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
case 25:
|
||||
// TODO
|
||||
case Result::UNLOCKABLE_LOCK:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_UNLOCKABLE_LOCK, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
case 32:
|
||||
// TODO
|
||||
case Result::CONVERSION_REQUIRED:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_CONVERSION_REQUIRED, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
// TODO case 255
|
||||
case Result::DISCONNECTED:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_DISCONNECTED, nullptr, 0x0);
|
||||
break;
|
||||
|
||||
default:
|
||||
this->m_loginResponse->UpdateLoginStatus(LOGIN_STATE_FAILED, LOGIN_FAILED, nullptr, 0x0);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user