aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/DataStores/DB2FileLoader.cpp9
-rw-r--r--src/common/DataStores/DB2FileLoader.h2
2 files changed, 9 insertions, 2 deletions
diff --git a/src/common/DataStores/DB2FileLoader.cpp b/src/common/DataStores/DB2FileLoader.cpp
index d687c34d4a7..57ec7df6e3f 100644
--- a/src/common/DataStores/DB2FileLoader.cpp
+++ b/src/common/DataStores/DB2FileLoader.cpp
@@ -1810,6 +1810,7 @@ void DB2FileLoader::LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* lo
throw DB2FileLoadException("Failed to read header");
EndianConvert(_header.Signature);
+ EndianConvert(_header.Version);
EndianConvert(_header.RecordCount);
EndianConvert(_header.FieldCount);
EndianConvert(_header.RecordSize);
@@ -1829,10 +1830,14 @@ void DB2FileLoader::LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* lo
EndianConvert(_header.PalletDataSize);
EndianConvert(_header.SectionCount);
- if (_header.Signature != 0x34434457) //'WDC4'
- throw DB2FileLoadException(Trinity::StringFormat("Incorrect file signature in {}, expected 'WDC4', got {}{}{}{}", source->GetFileName(),
+ if (_header.Signature != 0x35434457) //'WDC5'
+ throw DB2FileLoadException(Trinity::StringFormat("Incorrect file signature in {}, expected 'WDC5', got {}{}{}{}", source->GetFileName(),
char(_header.Signature & 0xFF), char((_header.Signature >> 8) & 0xFF), char((_header.Signature >> 16) & 0xFF), char((_header.Signature >> 24) & 0xFF)));
+ if (_header.Version != 5)
+ throw DB2FileLoadException(Trinity::StringFormat("Incorrect version in {}, expected 5, got {} (possibly wrong client version)",
+ source->GetFileName(), _header.Version));
+
if (loadInfo && _header.LayoutHash != loadInfo->Meta->LayoutHash)
throw DB2FileLoadException(Trinity::StringFormat("Incorrect layout hash in {}, expected 0x{:08X}, got 0x{:08X} (possibly wrong client version)",
source->GetFileName(), loadInfo->Meta->LayoutHash, _header.LayoutHash));
diff --git a/src/common/DataStores/DB2FileLoader.h b/src/common/DataStores/DB2FileLoader.h
index 29e78463f38..6875335f3ca 100644
--- a/src/common/DataStores/DB2FileLoader.h
+++ b/src/common/DataStores/DB2FileLoader.h
@@ -31,6 +31,8 @@ struct DB2Meta;
struct DB2Header
{
uint32 Signature;
+ uint32 Version;
+ std::array<char, 128> Schema;
uint32 RecordCount;
uint32 FieldCount;
uint32 RecordSize;