aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-05-05 00:45:11 +0200
committerShauren <shauren.trinity@gmail.com>2023-05-05 00:45:11 +0200
commit3bd4c21754e6c387b5e9f9e2e795fe6dba63b45d (patch)
treec77e3ff1c11381f401c80ebf96fcabc00157bba0
parent16bc74667e8996b64258718e95b97258dfc0217a (diff)
Core/DataStores: Remove temporary 10.0.7 workraround
-rw-r--r--src/common/DataStores/DB2FileLoader.cpp28
-rw-r--r--src/server/bnetserver/Server/Session.cpp2
2 files changed, 5 insertions, 25 deletions
diff --git a/src/common/DataStores/DB2FileLoader.cpp b/src/common/DataStores/DB2FileLoader.cpp
index 5e14920e45d..d687c34d4a7 100644
--- a/src/common/DataStores/DB2FileLoader.cpp
+++ b/src/common/DataStores/DB2FileLoader.cpp
@@ -26,10 +26,6 @@
#include <utility>
#include <cstring>
-class Temporary_10_0_7_metadata_bug_workaround : public std::exception
-{
-};
-
enum class DB2ColumnCompression : uint32
{
None,
@@ -237,7 +233,7 @@ public:
char const* GetExpectedSignMismatchReason(uint32 field) const override;
private:
- void FillParentLookup(char* dataTable, char** indexTable);
+ void FillParentLookup(char* dataTable);
uint32 GetRecordSection(uint32 recordNumber) const;
unsigned char const* GetRawRecordData(uint32 recordNumber, uint32 const* section) const override;
uint32 RecordGetId(uint8 const* record, uint32 recordIndex) const override;
@@ -439,8 +435,6 @@ char* DB2FileLoaderRegularImpl::AutoProduceData(uint32& indexTableSize, char**&
++fieldIndex;
}
- try
- {
for (uint32 x = 0; x < _header->FieldCount; ++x)
{
for (uint32 z = 0; z < _loadInfo->Meta->Fields[x].ArraySize; ++z)
@@ -512,17 +506,11 @@ char* DB2FileLoaderRegularImpl::AutoProduceData(uint32& indexTableSize, char**&
++fieldIndex;
}
}
- }
- catch (Temporary_10_0_7_metadata_bug_workaround const&)
- {
- // pretend this record doesnt exist, has overflown column
- indexTable[indexVal] = nullptr;
- }
}
}
if (!_parentIndexes.empty())
- FillParentLookup(dataTable, indexTable);
+ FillParentLookup(dataTable);
return dataTable;
}
@@ -652,7 +640,7 @@ void DB2FileLoaderRegularImpl::AutoProduceRecordCopies(uint32 records, char** in
}
}
-void DB2FileLoaderRegularImpl::FillParentLookup(char* dataTable, char** indexTable)
+void DB2FileLoaderRegularImpl::FillParentLookup(char* dataTable)
{
int32 parentIdOffset = _loadInfo->Meta->GetParentIndexFieldOffset();
uint32 recordSize = _loadInfo->Meta->GetRecordSize();
@@ -668,11 +656,6 @@ void DB2FileLoaderRegularImpl::FillParentLookup(char* dataTable, char** indexTab
uint32 recordIndex = _parentIndexes[i][0].Entries[j].RecordIndex + recordIndexOffset;
char* recordData = &dataTable[recordIndex * recordSize];
- // temporary workaround
- uint32 id = GetRecord(recordIndex).GetId();
- if (!indexTable[id])
- continue;
-
switch (_loadInfo->Meta->Fields[_loadInfo->Meta->ParentIndexField].Type)
{
case FT_SHORT:
@@ -836,9 +819,6 @@ T DB2FileLoaderRegularImpl::RecordGetVarInt(uint8 const* record, uint32 field, u
EndianConvert(immediateValue);
T value;
memcpy(&value, &immediateValue, std::min(sizeof(T), sizeof(immediateValue)));
- if constexpr (std::is_integral_v<T>)
- if (_columnMeta[field].CompressionData.immediate.BitWidth > sizeof(T) * 8 && int64(value) != int64(immediateValue))
- throw Temporary_10_0_7_metadata_bug_workaround();
return value;
}
case DB2ColumnCompression::CommonData:
@@ -1850,7 +1830,7 @@ void DB2FileLoader::LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* lo
EndianConvert(_header.SectionCount);
if (_header.Signature != 0x34434457) //'WDC4'
- throw DB2FileLoadException(Trinity::StringFormat("Incorrect file signature in {}, expected 'WDC3', got %c%c%c%c", source->GetFileName(),
+ throw DB2FileLoadException(Trinity::StringFormat("Incorrect file signature in {}, expected 'WDC4', got {}{}{}{}", source->GetFileName(),
char(_header.Signature & 0xFF), char((_header.Signature >> 8) & 0xFF), char((_header.Signature >> 16) & 0xFF), char((_header.Signature >> 24) & 0xFF)));
if (loadInfo && _header.LayoutHash != loadInfo->Meta->LayoutHash)
diff --git a/src/server/bnetserver/Server/Session.cpp b/src/server/bnetserver/Server/Session.cpp
index 5e43d97ae1d..4a65de30f1d 100644
--- a/src/server/bnetserver/Server/Session.cpp
+++ b/src/server/bnetserver/Server/Session.cpp
@@ -258,7 +258,7 @@ uint32 Battlenet::Session::HandleGenerateWebCredentials(authentication::v1::Gene
{
auto asPrintable = [](char c) { return std::isprint(c) ? c : ' '; };
- TC_LOG_DEBUG("session", "[Battlenet::HandleGenerateWebCredentials] {} attempted to generate web cretentials with game other than WoW (using %c%c%c%c)!",
+ TC_LOG_DEBUG("session", "[Battlenet::HandleGenerateWebCredentials] {} attempted to generate web cretentials with game other than WoW (using {}{}{}{})!",
GetClientInfo(), asPrintable((request->program() >> 24) & 0xFF), asPrintable((request->program() >> 16) & 0xFF),
asPrintable((request->program() >> 8) & 0xFF), asPrintable(request->program() & 0xFF));
return ERROR_BAD_PROGRAM;