diff --git a/src/client/ClientRealmResponseAdapter.cpp b/src/client/ClientRealmResponseAdapter.cpp index 7a835b7..f4f1d63 100644 --- a/src/client/ClientRealmResponseAdapter.cpp +++ b/src/client/ClientRealmResponseAdapter.cpp @@ -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(realmConnection); + + if (success) { + clientConnection->Complete(1, 44); + } else { + clientConnection->Complete(1, 45); + } +} diff --git a/src/client/ClientRealmResponseAdapter.hpp b/src/client/ClientRealmResponseAdapter.hpp index 1c0c2ae..4ef4569 100644 --- a/src/client/ClientRealmResponseAdapter.hpp +++ b/src/client/ClientRealmResponseAdapter.hpp @@ -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) {}; }; diff --git a/src/net/connection/RealmConnection.cpp b/src/net/connection/RealmConnection.cpp index 3886945..983f3a3 100644 --- a/src/net/connection/RealmConnection.cpp +++ b/src/net/connection/RealmConnection.cpp @@ -241,10 +241,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 @@ -260,7 +260,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; } } @@ -268,13 +268,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; } diff --git a/src/net/connection/RealmResponse.hpp b/src/net/connection/RealmResponse.hpp index 6600312..16fe499 100644 --- a/src/net/connection/RealmResponse.hpp +++ b/src/net/connection/RealmResponse.hpp @@ -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; };