mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-16 12:42:30 +00:00
feat(net): parse realm list
This commit is contained in:
parent
fc7fa1dbdc
commit
22bfe894d2
10 changed files with 222 additions and 3 deletions
|
|
@ -282,8 +282,86 @@ int32_t Grunt::ClientLink::CmdAuthReconnectProof(CDataStore& msg) {
|
|||
}
|
||||
|
||||
int32_t Grunt::ClientLink::CmdRealmList(CDataStore& msg) {
|
||||
// TODO
|
||||
return 0;
|
||||
if (msg.m_read > msg.m_size || msg.m_size - msg.m_read < 2) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint16_t size;
|
||||
msg.Get(size);
|
||||
|
||||
if (msg.m_read > msg.m_size || msg.m_size - msg.m_read < size) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t startData = msg.m_read;
|
||||
|
||||
uint32_t padding;
|
||||
msg.Get(padding);
|
||||
|
||||
uint32_t startList = msg.m_read;
|
||||
|
||||
uint16_t count;
|
||||
msg.Get(count);
|
||||
|
||||
for (uint32_t i = 0; i < count && msg.m_read < msg.m_size; i++) {
|
||||
uint8_t realmType;
|
||||
msg.Get(realmType);
|
||||
|
||||
uint8_t locked;
|
||||
msg.Get(locked);
|
||||
|
||||
uint8_t realmFlags;
|
||||
msg.Get(realmFlags);
|
||||
|
||||
char realmName[256];
|
||||
msg.GetString(realmName, sizeof(realmName));
|
||||
|
||||
char realmAddress[256];
|
||||
msg.GetString(realmAddress, sizeof(realmAddress));
|
||||
|
||||
float population;
|
||||
msg.Get(population);
|
||||
|
||||
uint8_t numChars;
|
||||
msg.Get(numChars);
|
||||
|
||||
uint8_t realmCategory;
|
||||
msg.Get(realmCategory);
|
||||
|
||||
uint8_t sort;
|
||||
msg.Get(sort);
|
||||
|
||||
// TODO SPECIFY_BUILD
|
||||
if (realmFlags & 0x4) {
|
||||
uint8_t major;
|
||||
msg.Get(major);
|
||||
|
||||
uint8_t minor;
|
||||
msg.Get(minor);
|
||||
|
||||
uint8_t patch;
|
||||
msg.Get(patch);
|
||||
|
||||
uint16_t revision;
|
||||
msg.Get(revision);
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t padding2;
|
||||
msg.Get(padding2);
|
||||
|
||||
if (msg.m_read <= msg.m_size && msg.m_read - startData == size) {
|
||||
uint32_t endData = msg.m_read;
|
||||
msg.m_read = startList;
|
||||
|
||||
this->m_clientResponse->RealmListResult(&msg);
|
||||
|
||||
msg.m_read = endData;
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t Grunt::ClientLink::CmdXferData(CDataStore& msg) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include "net/grunt/Grunt.hpp"
|
||||
#include "net/Types.hpp"
|
||||
|
||||
class CDataStore;
|
||||
class LoginResponse;
|
||||
|
||||
class Grunt::ClientResponse {
|
||||
|
|
@ -16,6 +17,7 @@ class Grunt::ClientResponse {
|
|||
virtual void SetMatrixInfo(bool enabled, uint8_t a3, uint8_t a4, uint8_t a5, uint8_t a6, bool a7, uint8_t a8, uint64_t a9, const uint8_t* a10, uint32_t a11) = 0;
|
||||
virtual void SetTokenInfo(bool enabled, uint8_t required) = 0;
|
||||
virtual void LogonResult(Result result, const uint8_t* sessionKey, uint32_t sessionKeyLen, uint16_t flags) = 0;
|
||||
virtual void RealmListResult(CDataStore* msg) = 0;
|
||||
virtual LOGIN_STATE NextSecurityState(LOGIN_STATE state) = 0;
|
||||
virtual int32_t GetServerId() = 0;
|
||||
virtual void GetRealmList() = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue