mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 08:42:45 +03:00
feat(connection): add ClientConnection::GetRealmList
This commit is contained in:
parent
6f07492c7b
commit
9ebb798bda
@ -200,6 +200,10 @@ REALM_INFO* ClientServices::GetRealmInfoByIndex(int32_t index) {
|
||||
return &ClientServices::GetInstance()->m_realmList[index];
|
||||
}
|
||||
|
||||
void ClientServices::GetRealmList() {
|
||||
ClientServices::Connection()->GetRealmList();
|
||||
}
|
||||
|
||||
const char* ClientServices::GetSelectedRealmName() {
|
||||
if (!ClientServices::s_realmNameVar) {
|
||||
ClientServices::s_realmNameVar = CVar::Register(
|
||||
|
||||
@ -36,6 +36,7 @@ class ClientServices : public LoginResponse {
|
||||
static const char* GetErrorToken(int32_t errorCode);
|
||||
static ClientServices* GetInstance();
|
||||
static REALM_INFO* GetRealmInfoByIndex(int32_t index);
|
||||
static void GetRealmList();
|
||||
static const char* GetSelectedRealmName();
|
||||
static const REALM_INFO* GetSelectedRealm();
|
||||
static void Initialize();
|
||||
|
||||
@ -91,6 +91,22 @@ void ClientConnection::GetCharacterList() {
|
||||
}
|
||||
}
|
||||
|
||||
void ClientConnection::GetRealmList() {
|
||||
this->m_cleanup = nullptr;
|
||||
this->m_statusCop = COP_GET_REALMS;
|
||||
this->m_errorCode = 35;
|
||||
this->m_statusComplete = 0;
|
||||
|
||||
// TODO LogConnectionStatus(this->m_statusCop, this->m_errorCode, 1);
|
||||
|
||||
if (ClientServices::LoginConnection()->IsLoggedOn()) {
|
||||
ClientServices::LoginConnection()->GetRealmList();
|
||||
}
|
||||
else {
|
||||
ClientServices::LoginConnection()->Reconnect();
|
||||
}
|
||||
}
|
||||
|
||||
int32_t ClientConnection::HandleConnect() {
|
||||
this->Complete(1, 5);
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@ class ClientConnection : public RealmConnection {
|
||||
int32_t Disconnect();
|
||||
void EnumerateCharacters(ENUMERATE_CHARACTERS_CALLBACK callback, void* param);
|
||||
void GetCharacterList();
|
||||
void GetRealmList();
|
||||
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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user