mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 11:12:29 +00:00
feat(client): implement auth response handler in realm adapter
This commit is contained in:
parent
23d537103e
commit
1b27761d0c
5 changed files with 58 additions and 26 deletions
|
|
@ -110,15 +110,22 @@ const char* s_errorCodeTokens[] = {
|
|||
"CHAR_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME",
|
||||
};
|
||||
|
||||
void ClientConnection::AccountLogin_Finish(int32_t errorCode) {
|
||||
this->Complete(errorCode == 12, errorCode);
|
||||
}
|
||||
|
||||
void ClientConnection::AccountLogin_Queued() {
|
||||
this->m_statusCop = COP_WAIT_QUEUE;
|
||||
this->m_errorCode = 27;
|
||||
this->m_statusComplete = 0;
|
||||
|
||||
// TODO LogConnectionStatus(this->m_statusCop, 27, 1);
|
||||
|
||||
// TODO CGlueMgr::UpdateWaitQueue(this->m_queuePosition);
|
||||
}
|
||||
|
||||
void ClientConnection::Cancel(int32_t errorCode) {
|
||||
this->Cleanup();
|
||||
|
||||
this->m_statusResult = 0;
|
||||
this->m_errorCode = errorCode;
|
||||
this->m_statusComplete = 1;
|
||||
|
||||
// TODO
|
||||
// LogConnectionStatus(this->m_statusCop, errorCode, 0);
|
||||
this->Complete(0, errorCode);
|
||||
}
|
||||
|
||||
void ClientConnection::Cleanup() {
|
||||
|
|
@ -128,6 +135,16 @@ void ClientConnection::Cleanup() {
|
|||
}
|
||||
}
|
||||
|
||||
void ClientConnection::Complete(int32_t result, int32_t errorCode) {
|
||||
this->Cleanup();
|
||||
|
||||
this->m_statusResult = result;
|
||||
this->m_errorCode = errorCode;
|
||||
this->m_statusComplete = 1;
|
||||
|
||||
// TODO LogConnectionStatus(this->m_statusCop, errorCode, 0);
|
||||
}
|
||||
|
||||
void ClientConnection::Connect() {
|
||||
// TODO
|
||||
|
||||
|
|
@ -146,6 +163,15 @@ int32_t ClientConnection::Disconnect() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void ClientConnection::Initiate(WOWCS_OPS op, int32_t errorCode, void (*cleanup)()) {
|
||||
this->m_cleanup = cleanup;
|
||||
this->m_statusCop = op;
|
||||
this->m_errorCode = errorCode;
|
||||
this->m_statusComplete = 0;
|
||||
|
||||
// TODO LogConnectionStatus(this->m_statusCop, errorCode, 1);
|
||||
}
|
||||
|
||||
int32_t ClientConnection::IsConnected() {
|
||||
return this->m_connected;
|
||||
}
|
||||
|
|
@ -179,13 +205,3 @@ int32_t ClientConnection::PollStatus(WOWCS_OPS& op, const char** msg, int32_t& r
|
|||
|
||||
return this->m_statusComplete;
|
||||
}
|
||||
|
||||
void ClientConnection::SetStatus(int32_t result, int32_t errorCode) {
|
||||
this->Cleanup();
|
||||
|
||||
this->m_statusResult = result;
|
||||
this->m_errorCode = errorCode;
|
||||
this->m_statusComplete = 1;
|
||||
|
||||
// TODO LogConnectionStatus(this->m_statusCop, errorCode, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,13 +20,16 @@ class ClientConnection : public RealmConnection {
|
|||
ClientConnection(RealmResponse* realmResponse)
|
||||
: RealmConnection(realmResponse)
|
||||
{};
|
||||
void AccountLogin_Finish(int32_t authResult);
|
||||
void AccountLogin_Queued();
|
||||
void Cancel(int32_t errorCode);
|
||||
void Cleanup();
|
||||
void Complete(int32_t result, int32_t errorCode);
|
||||
void Connect();
|
||||
int32_t Disconnect();
|
||||
void Initiate(WOWCS_OPS op, int32_t errorCode, void (*cleanup)());
|
||||
int32_t IsConnected();
|
||||
int32_t PollStatus(WOWCS_OPS& op, const char** msg, int32_t& result, int32_t& errorCode);
|
||||
void SetStatus(int32_t result, int32_t errorCode);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue