mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-21 07:22:02 -04:00
Core/DataStores: Allow loading encrypted sections when key is known when reading from casc storage
Closes #24456
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
|
||||
DB2CascFileSource::DB2CascFileSource(std::shared_ptr<CASC::Storage const> storage, uint32 fileDataId, bool printErrors /*= true*/)
|
||||
{
|
||||
_storageHandle = storage;
|
||||
_fileHandle.reset(storage->OpenFile(fileDataId, CASC_LOCALE_NONE, printErrors, true));
|
||||
_fileName = Trinity::StringFormat("FileDataId: %u", fileDataId);
|
||||
}
|
||||
@@ -60,3 +61,11 @@ char const* DB2CascFileSource::GetFileName() const
|
||||
{
|
||||
return _fileName.c_str();
|
||||
}
|
||||
|
||||
DB2EncryptedSectionHandling DB2CascFileSource::HandleEncryptedSection(DB2SectionHeader const& sectionHeader) const
|
||||
{
|
||||
if (std::shared_ptr<CASC::Storage const> storage = _storageHandle.lock())
|
||||
return storage->HasTactKey(sectionHeader.TactId) ? DB2EncryptedSectionHandling::Process : DB2EncryptedSectionHandling::Skip;
|
||||
|
||||
return DB2EncryptedSectionHandling::Skip;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user