mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 03:02:30 +00:00
feat(net): update RealmConnection::HandleCharEnum to use virtual call of RealmResponse::CharacterListReceived
This commit is contained in:
parent
1e8dc7aef9
commit
d536140d63
4 changed files with 16 additions and 10 deletions
|
|
@ -16,3 +16,13 @@ void ClientRealmResponseAdapter::HandleAuthResponse(RealmConnection* realmConnec
|
||||||
|
|
||||||
AccountDataInitialize(true);
|
AccountDataInitialize(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClientRealmResponseAdapter::CharacterListReceived(RealmConnection* realmConnection, void* a2, int32_t success) {
|
||||||
|
auto clientConnection = static_cast<ClientConnection*>(realmConnection);
|
||||||
|
|
||||||
|
if (success) {
|
||||||
|
clientConnection->Complete(1, 44);
|
||||||
|
} else {
|
||||||
|
clientConnection->Complete(1, 45);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ class ClientRealmResponseAdapter : public RealmResponse {
|
||||||
public:
|
public:
|
||||||
// Virtual member functions
|
// Virtual member functions
|
||||||
virtual void HandleAuthResponse(RealmConnection* realmConnection, uint8_t authResult);
|
virtual void HandleAuthResponse(RealmConnection* realmConnection, uint8_t authResult);
|
||||||
|
virtual void CharacterListReceived(RealmConnection* realmConnection, void* a2, int32_t success);
|
||||||
virtual void GameServerResult(RealmConnection* realmConnection, const char* a2, const char* a3, const char* a4) {};
|
virtual void GameServerResult(RealmConnection* realmConnection, const char* a2, const char* a3, const char* a4) {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -240,10 +240,10 @@ int32_t RealmConnection::HandleCharEnum(uint32_t msgId, uint32_t time, CDataStor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool success = false;
|
int32_t success = 0;
|
||||||
if (msg->IsRead()) {
|
if (msg->IsRead()) {
|
||||||
if (!overflow) {
|
if (!overflow) {
|
||||||
success = true;
|
success = 1;
|
||||||
}
|
}
|
||||||
} else if (!overflow) {
|
} else if (!overflow) {
|
||||||
// TODO: Proper implementation
|
// TODO: Proper implementation
|
||||||
|
|
@ -259,7 +259,7 @@ int32_t RealmConnection::HandleCharEnum(uint32_t msgId, uint32_t time, CDataStor
|
||||||
msg->Get(value);
|
msg->Get(value);
|
||||||
msg->Get(value);
|
msg->Get(value);
|
||||||
if (msg->IsRead()) {
|
if (msg->IsRead()) {
|
||||||
success = true;
|
success = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -267,13 +267,7 @@ int32_t RealmConnection::HandleCharEnum(uint32_t msgId, uint32_t time, CDataStor
|
||||||
m_characterList.Clear();
|
m_characterList.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Should be implemented as call of sub_6B2000
|
this->m_realmResponse->CharacterListReceived(this, msg, success);
|
||||||
if (success) {
|
|
||||||
this->Complete(1, 44);
|
|
||||||
} else {
|
|
||||||
this->Complete(1, 45);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ class RealmResponse {
|
||||||
public:
|
public:
|
||||||
// Virtual member functions
|
// Virtual member functions
|
||||||
virtual void HandleAuthResponse(RealmConnection* connection, uint8_t authResult) = 0;
|
virtual void HandleAuthResponse(RealmConnection* connection, uint8_t authResult) = 0;
|
||||||
|
virtual void CharacterListReceived(RealmConnection* connection, void* a2, int32_t success) = 0;
|
||||||
virtual void GameServerResult(RealmConnection* connection, const char* a3, const char* a4, const char* a5) = 0;
|
virtual void GameServerResult(RealmConnection* connection, const char* a3, const char* a4, const char* a5) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue