Core/DataStores: Implemented sending hotfixes for db2 stores not loaded serverside (#22800)

This commit is contained in:
funjoker
2018-12-08 00:05:57 +01:00
committed by Shauren
parent 9a8f09de57
commit f272a78caa
5 changed files with 62 additions and 4 deletions

View File

@@ -73,11 +73,16 @@ void WorldSession::HandleHotfixRequest(WorldPackets::Hotfix::HotfixRequest& hotf
WorldPackets::Hotfix::HotfixResponse::HotfixData hotfixData;
hotfixData.ID = hotfixId;
hotfixData.RecordID = *hotfix;
if (storage->HasRecord(hotfixData.RecordID))
if (storage && storage->HasRecord(hotfixData.RecordID))
{
hotfixData.Data = boost::in_place();
storage->WriteRecord(hotfixData.RecordID, GetSessionDbcLocale(), *hotfixData.Data);
}
else if (std::vector<uint8> const* blobData = sDB2Manager.GetHotfixBlobData(PAIR64_HIPART(hotfixId), *hotfix))
{
hotfixData.Data = boost::in_place();
hotfixData.Data->append(blobData->data(), blobData->size());
}
hotfixQueryResponse.Hotfixes.emplace_back(std::move(hotfixData));
}