mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-10-30 07:46:03 +03:00
feat(net): implement ClientServices::GetRealmList (second request of Realm List)
This commit is contained in:
parent
afc6c3666b
commit
06eeedbb68
@ -190,7 +190,13 @@ void ClientServices::SetMessageHandler(NETMESSAGE msgId, MESSAGE_HANDLER handler
|
||||
}
|
||||
|
||||
void ClientServices::GetRealmList() {
|
||||
// TODO
|
||||
STORM_ASSERT(ClientServices::s_currentConnection);
|
||||
ClientServices::s_currentConnection->Initiate(COP_GET_REALMS, 35, nullptr);
|
||||
if (ClientServices::s_loginObj->IsLoggedOn()) {
|
||||
ClientServices::s_loginObj->GetRealmList();
|
||||
} else {
|
||||
ClientServices::s_loginObj->Reconnect();
|
||||
}
|
||||
}
|
||||
|
||||
void ClientServices::GetCharacterList() {
|
||||
@ -367,6 +373,7 @@ void ClientServices::LoginServerStatus(LOGIN_STATE state, LOGIN_RESULT result, c
|
||||
|
||||
void ClientServices::RealmEnumCallback(uint32_t a2) {
|
||||
auto connection = ClientServices::Connection();
|
||||
STORM_ASSERT(connection);
|
||||
|
||||
if (a2 == 1) {
|
||||
connection->Complete(0, 23);
|
||||
@ -378,7 +385,13 @@ void ClientServices::RealmEnumCallback(uint32_t a2) {
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO statusCop checks
|
||||
// TODO: Proper implementation
|
||||
if (connection->m_statusCop != COP_CONNECT) {
|
||||
if (connection->m_statusCop == COP_GET_REALMS) {
|
||||
connection->Complete(1, 36);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (ClientServices::LoginConnection()->GetLoginServerType() == 1) {
|
||||
// TODO Battlenet logic
|
||||
|
||||
@ -20,6 +20,7 @@ class Grunt::ClientResponse {
|
||||
virtual void RealmListResult(CDataStore* msg) = 0;
|
||||
virtual LOGIN_STATE NextSecurityState(LOGIN_STATE state) = 0;
|
||||
virtual int32_t GetServerId() = 0;
|
||||
virtual void Reconnect() = 0;
|
||||
virtual void GetRealmList() = 0;
|
||||
virtual void Logon(const char* a2, const char* a3) = 0;
|
||||
virtual void ProveVersion(const uint8_t* versionChecksum) = 0;
|
||||
|
||||
@ -88,6 +88,10 @@ int32_t GruntLogin::GetServerId() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void GruntLogin::Reconnect() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void GruntLogin::GetVersionProof(const uint8_t* versionChallenge) {
|
||||
if (this->IsReconnect()) {
|
||||
// TODO
|
||||
|
||||
@ -22,6 +22,7 @@ class GruntLogin : public Login {
|
||||
virtual void LogonResult(Grunt::Result result, const uint8_t* sessionKey, uint32_t sessionKeyLen, uint16_t flags);
|
||||
virtual LOGIN_STATE NextSecurityState(LOGIN_STATE state);
|
||||
virtual int32_t GetServerId();
|
||||
virtual void Reconnect();
|
||||
virtual void GetRealmList();
|
||||
virtual void Logon(const char* a2, const char* a3);
|
||||
virtual void ProveVersion(const uint8_t* versionChecksum);
|
||||
|
||||
@ -13,6 +13,10 @@ bool Login::IsReconnect() {
|
||||
return this->m_reconnect;
|
||||
}
|
||||
|
||||
bool Login::IsLoggedOn() {
|
||||
return this->m_loggedOn;
|
||||
}
|
||||
|
||||
bool Login::OnlineIdle() {
|
||||
// TODO
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ class Login : public Grunt::ClientResponse {
|
||||
virtual bool OnlineIdle();
|
||||
virtual void RealmListResult(CDataStore* msg);
|
||||
virtual bool IsReconnect();
|
||||
virtual bool IsLoggedOn();
|
||||
|
||||
// Member functions
|
||||
void SetLogonCreds(const char* accountName, const char* password);
|
||||
|
||||
@ -11,7 +11,8 @@
|
||||
#include <storm/String.hpp>
|
||||
|
||||
int32_t Script_RequestRealmList(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
CGlueMgr::GetRealmList(StringToBOOL(L, 1, 0));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t Script_RealmListUpdateRate(lua_State* L) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user