Пример #1
0
void WorldSession::SendAuthResponse(uint8 code, bool queued, uint32 queuePos)
{
    WorldPackets::Auth::AuthResponse response;
    response.Result = code;

    if (queued)
    {
        response.WaitInfo = boost::in_place();
        response.WaitInfo->WaitCount = queuePos;
    }

    if (code == AUTH_OK)
    {
        response.SuccessInfo = boost::in_place();

        response.SuccessInfo->AccountExpansionLevel = GetExpansion();
        response.SuccessInfo->ActiveExpansionLevel = GetExpansion();
        response.SuccessInfo->VirtualRealmAddress = GetVirtualRealmAddress();

        std::string realmName = sObjectMgr->GetRealmName(realmHandle.Index);

        // Send current home realm. Also there is no need to send it later in realm queries.
        response.SuccessInfo->VirtualRealms.emplace_back(GetVirtualRealmAddress(), true, false, realmName, realmName);

        if (HasPermission(rbac::RBAC_PERM_USE_CHARACTER_TEMPLATES))
            for (auto& templ : sObjectMgr->GetCharacterTemplates())
                response.SuccessInfo->Templates.emplace_back(templ.second);

        response.SuccessInfo->AvailableClasses = &sObjectMgr->GetClassExpansionRequirements();
        response.SuccessInfo->AvailableRaces = &sObjectMgr->GetRaceExpansionRequirements();
    }

    SendPacket(response.Write());
}
Пример #2
0
void WorldSocket::SendAuthResponseError(uint8 code)
{
    WorldPackets::Auth::AuthResponse response;
    response.SuccessInfo.HasValue = false;
    response.WaitInfo.HasValue = false;
    response.Result = code;
    SendPacketAndLogOpcode(*response.Write());
}
Пример #3
0
void WorldSession::SendAuthWaitQue(uint32 position)
{
    WorldPackets::Auth::AuthResponse response;

    if (position == 0)
        response.Result = AUTH_OK;
    else
    {
        response.WaitInfo = boost::in_place();
        response.WaitInfo->WaitCount = position;
        response.Result = AUTH_WAIT_QUEUE;
    }

    SendPacket(response.Write());
}