#include "client/ClientRealmResponseAdapter.hpp"

void AccountDataInitialize(bool a1) {
    // TODO
}

void ClientRealmResponseAdapter::CharacterListReceived(RealmConnection* realmConnection, const TSFixedArray<CHARACTER_INFO>& characterList, int32_t listSuccess) {
    auto clientConnection = static_cast<ClientConnection*>(realmConnection);

    if (listSuccess) {
        clientConnection->Complete(1, 44);
    } else {
        clientConnection->Complete(0, 45);
    }
}

void ClientRealmResponseAdapter::HandleAuthResponse(RealmConnection* realmConnection, uint8_t authResult) {
    auto clientConnection = static_cast<ClientConnection*>(realmConnection);

    // AUTH_WAIT_QUEUE
    if (authResult == 27) {
        clientConnection->AccountLogin_Queued();
    } else {
        clientConnection->AccountLogin_Finish(authResult);
    }

    AccountDataInitialize(true);
}
