Beispiel #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());
}
Beispiel #2
0
void Client::SendExpansionInfo() {
	EQApplicationPacket *outapp = new EQApplicationPacket(OP_ExpansionInfo, sizeof(ExpansionInfo_Struct));
	ExpansionInfo_Struct *eis = (ExpansionInfo_Struct*)outapp->pBuffer;
	eis->Expansions = GetExpansion();
	QueuePacket(outapp);
	safe_delete(outapp);
}
void WorldSession::SendLfgPlayerLockInfo()
{
    ObjectGuid guid = GetPlayer()->GetGUID();

    // Get Random dungeons that can be done at a certain level and expansion
    uint8 level = GetPlayer()->getLevel();
    lfg::LfgDungeonSet const& randomDungeons =
        sLFGMgr->GetRandomAndSeasonalDungeons(level, GetExpansion());

    // Get player locked Dungeons
    lfg::LfgLockMap const& lock = sLFGMgr->GetLockedDungeons(guid);
    uint32 rsize = uint32(randomDungeons.size());
    uint32 lsize = uint32(lock.size());

    TC_LOG_DEBUG("lfg", "SMSG_LFG_PLAYER_INFO %s", GetPlayerInfo().c_str());
    WorldPacket data(SMSG_LFG_PLAYER_INFO, 1 + rsize * (4 + 1 + 4 + 4 + 4 + 4 + 1 + 4 + 4 + 4) + 4 + lsize * (1 + 4 + 4 + 4 + 4 + 1 + 4 + 4 + 4));

    data << uint8(randomDungeons.size());                  // Random Dungeon count
    for (lfg::LfgDungeonSet::const_iterator it = randomDungeons.begin(); it != randomDungeons.end(); ++it)
    {
        data << uint32(*it);                               // Dungeon Entry (id + type)
        lfg::LfgReward const* reward = sLFGMgr->GetRandomDungeonReward(*it, level);
        Quest const* quest = NULL;
        bool done = false;
        if (reward)
        {
            quest = sObjectMgr->GetQuestTemplate(reward->firstQuest);
            if (quest)
            {
                done = !GetPlayer()->CanRewardQuest(quest, false);
                if (done)
                    quest = sObjectMgr->GetQuestTemplate(reward->otherQuest);
            }
        }

        data << uint8(done);
        data << uint32(0);                                              // currencyQuantity
        data << uint32(0);                                              // some sort of overall cap/weekly cap
        data << uint32(0);                                              // currencyID
        data << uint32(0);                                              // tier1Quantity
        data << uint32(0);                                              // tier1Limit
        data << uint32(0);                                              // overallQuantity
        data << uint32(0);                                              // overallLimit
        data << uint32(0);                                              // periodPurseQuantity
        data << uint32(0);                                              // periodPurseLimit
        data << uint32(0);                                              // purseQuantity
        data << uint32(0);                                              // purseLimit
        data << uint32(0);                                              // some sort of reward for completion
        data << uint32(0);                                              // completedEncounters
        data << uint8(0);                                               // Call to Arms eligible

        for (uint32 i = 0; i < 3; ++i)
        {
            data << uint32(0);                                          // Call to Arms Role
            //if (role)
            //    BuildQuestReward(data, ctaRoleQuest, GetPlayer());
        }

        if (quest)
            BuildQuestReward(data, quest, GetPlayer());
        else
        {
            data << uint32(0);                                          // Money
            data << uint32(0);                                          // XP
            data << uint8(0);                                           // Reward count
        }
    }

    BuildPlayerLockDungeonBlock(data, lock);
    SendPacket(&data);
}