mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/DataStores: Don't send hotfix ids in SMSG_AVAILABLE_HOTFIXES that don't have a hotfix blob for client locale
Closes #29378
This commit is contained in:
@@ -60,7 +60,18 @@ void WorldSession::HandleDBQueryBulk(WorldPackets::Hotfix::DBQueryBulk& dbQuery)
|
||||
|
||||
void WorldSession::SendAvailableHotfixes()
|
||||
{
|
||||
SendPacket(WorldPackets::Hotfix::AvailableHotfixes(realm.Id.GetAddress(), sDB2Manager.GetHotfixData()).Write());
|
||||
WorldPackets::Hotfix::AvailableHotfixes availableHotfixes;
|
||||
availableHotfixes.VirtualRealmAddress = realm.Id.GetAddress();
|
||||
|
||||
for (auto const& [pushId, push] : sDB2Manager.GetHotfixData())
|
||||
{
|
||||
if (!(push.AvailableLocalesMask & (1 << GetSessionDbcLocale())))
|
||||
continue;
|
||||
|
||||
availableHotfixes.Hotfixes.insert(push.Records.front().ID);
|
||||
}
|
||||
|
||||
SendPacket(availableHotfixes.Write());
|
||||
}
|
||||
|
||||
void WorldSession::HandleHotfixRequest(WorldPackets::Hotfix::HotfixRequest& hotfixQuery)
|
||||
@@ -70,13 +81,14 @@ void WorldSession::HandleHotfixRequest(WorldPackets::Hotfix::HotfixRequest& hotf
|
||||
hotfixQueryResponse.Hotfixes.reserve(hotfixQuery.Hotfixes.size());
|
||||
for (int32 hotfixId : hotfixQuery.Hotfixes)
|
||||
{
|
||||
if (std::vector<DB2Manager::HotfixRecord> const* hotfixRecords = Trinity::Containers::MapGetValuePtr(hotfixes, hotfixId))
|
||||
if (DB2Manager::HotfixPush const* hotfixRecords = Trinity::Containers::MapGetValuePtr(hotfixes, hotfixId))
|
||||
{
|
||||
for (DB2Manager::HotfixRecord const& hotfixRecord : *hotfixRecords)
|
||||
for (DB2Manager::HotfixRecord const& hotfixRecord : hotfixRecords->Records)
|
||||
{
|
||||
hotfixQueryResponse.Hotfixes.emplace_back();
|
||||
if (!(hotfixRecord.AvailableLocalesMask & (1 << GetSessionDbcLocale())))
|
||||
continue;
|
||||
|
||||
WorldPackets::Hotfix::HotfixConnect::HotfixData& hotfixData = hotfixQueryResponse.Hotfixes.back();
|
||||
WorldPackets::Hotfix::HotfixConnect::HotfixData& hotfixData = hotfixQueryResponse.Hotfixes.emplace_back();
|
||||
hotfixData.Record = hotfixRecord;
|
||||
if (hotfixRecord.HotfixStatus == DB2Manager::HotfixRecord::Status::Valid)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user