mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 16:22:45 +03:00
feat(client): add ClientServices::GetRealmList (#111)
Co-authored-by: fallenoak <git@fallenoak.me>
This commit is contained in:
parent
0c2db0a97d
commit
3636efec34
@ -200,6 +200,10 @@ REALM_INFO* ClientServices::GetRealmInfoByIndex(int32_t index) {
|
|||||||
return &ClientServices::GetInstance()->m_realmList[index];
|
return &ClientServices::GetInstance()->m_realmList[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClientServices::GetRealmList() {
|
||||||
|
ClientServices::Connection()->GetRealmList();
|
||||||
|
}
|
||||||
|
|
||||||
const char* ClientServices::GetSelectedRealmName() {
|
const char* ClientServices::GetSelectedRealmName() {
|
||||||
if (!ClientServices::s_realmNameVar) {
|
if (!ClientServices::s_realmNameVar) {
|
||||||
ClientServices::s_realmNameVar = CVar::Register(
|
ClientServices::s_realmNameVar = CVar::Register(
|
||||||
|
|||||||
@ -36,6 +36,7 @@ class ClientServices : public LoginResponse {
|
|||||||
static const char* GetErrorToken(int32_t errorCode);
|
static const char* GetErrorToken(int32_t errorCode);
|
||||||
static ClientServices* GetInstance();
|
static ClientServices* GetInstance();
|
||||||
static REALM_INFO* GetRealmInfoByIndex(int32_t index);
|
static REALM_INFO* GetRealmInfoByIndex(int32_t index);
|
||||||
|
static void GetRealmList();
|
||||||
static const char* GetSelectedRealmName();
|
static const char* GetSelectedRealmName();
|
||||||
static const REALM_INFO* GetSelectedRealm();
|
static const REALM_INFO* GetSelectedRealm();
|
||||||
static void Initialize();
|
static void Initialize();
|
||||||
|
|||||||
@ -91,6 +91,17 @@ void ClientConnection::GetCharacterList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClientConnection::GetRealmList() {
|
||||||
|
this->Initiate(COP_GET_REALMS, 35, nullptr);
|
||||||
|
|
||||||
|
if (ClientServices::LoginConnection()->IsLoggedOn()) {
|
||||||
|
ClientServices::LoginConnection()->GetRealmList();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ClientServices::LoginConnection()->Reconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int32_t ClientConnection::HandleConnect() {
|
int32_t ClientConnection::HandleConnect() {
|
||||||
this->Complete(1, 5);
|
this->Complete(1, 5);
|
||||||
|
|
||||||
|
|||||||
@ -37,6 +37,7 @@ class ClientConnection : public RealmConnection {
|
|||||||
int32_t Disconnect();
|
int32_t Disconnect();
|
||||||
void EnumerateCharacters(ENUMERATE_CHARACTERS_CALLBACK callback, void* param);
|
void EnumerateCharacters(ENUMERATE_CHARACTERS_CALLBACK callback, void* param);
|
||||||
void GetCharacterList();
|
void GetCharacterList();
|
||||||
|
void GetRealmList();
|
||||||
void Initiate(WOWCS_OPS op, int32_t errorCode, void (*cleanup)());
|
void Initiate(WOWCS_OPS op, int32_t errorCode, void (*cleanup)());
|
||||||
int32_t IsConnected();
|
int32_t IsConnected();
|
||||||
int32_t PollStatus(WOWCS_OPS& op, const char** msg, int32_t& result, int32_t& errorCode);
|
int32_t PollStatus(WOWCS_OPS& op, const char** msg, int32_t& result, int32_t& errorCode);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user