mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-04-18 02:52:47 +03:00
feat(net): update RealmConnection::HandleCharEnum to use virtual call of RealmResponse::CharacterListReceived
This commit is contained in:
parent
1e8dc7aef9
commit
d536140d63
@ -16,3 +16,13 @@ void ClientRealmResponseAdapter::HandleAuthResponse(RealmConnection* realmConnec
|
||||
|
||||
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:
|
||||
// Virtual member functions
|
||||
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) {};
|
||||
};
|
||||
|
||||
|
@ -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 (!overflow) {
|
||||
success = true;
|
||||
success = 1;
|
||||
}
|
||||
} else if (!overflow) {
|
||||
// TODO: Proper implementation
|
||||
@ -259,7 +259,7 @@ int32_t RealmConnection::HandleCharEnum(uint32_t msgId, uint32_t time, CDataStor
|
||||
msg->Get(value);
|
||||
msg->Get(value);
|
||||
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();
|
||||
}
|
||||
|
||||
// TODO: Should be implemented as call of sub_6B2000
|
||||
if (success) {
|
||||
this->Complete(1, 44);
|
||||
} else {
|
||||
this->Complete(1, 45);
|
||||
}
|
||||
|
||||
this->m_realmResponse->CharacterListReceived(this, msg, success);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ class RealmResponse {
|
||||
public:
|
||||
// Virtual member functions
|
||||
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;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user