diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/database/Database/Implementation/HotfixDatabase.cpp | 8 | ||||
-rw-r--r-- | src/server/game/DataStores/DB2Metadata.h | 24 | ||||
-rw-r--r-- | src/server/game/DataStores/DB2Stores.h | 2 | ||||
-rw-r--r-- | src/server/game/DataStores/DB2Structure.h | 2 | ||||
-rw-r--r-- | src/server/game/DataStores/GameTables.cpp | 28 |
5 files changed, 36 insertions, 28 deletions
diff --git a/src/server/database/Database/Implementation/HotfixDatabase.cpp b/src/server/database/Database/Implementation/HotfixDatabase.cpp index c34c9ac72aa..e6b4f4480eb 100644 --- a/src/server/database/Database/Implementation/HotfixDatabase.cpp +++ b/src/server/database/Database/Implementation/HotfixDatabase.cpp @@ -105,7 +105,7 @@ void HotfixDatabaseConnection::DoPrepareStatements() "ItemID24, PetDisplayID, RaceID, ClassID, GenderID, OutfitID, PetFamilyID FROM char_start_outfit ORDER BY ID DESC", CONNECTION_SYNCH); // CharTitles.db2 - PrepareStatement(HOTFIX_SEL_CHAR_TITLES, "SELECT ID, NameMale, NameFemale, ConditionID, MaskID, Flags FROM char_titles ORDER BY ID DESC", CONNECTION_SYNCH); + PrepareStatement(HOTFIX_SEL_CHAR_TITLES, "SELECT ID, NameMale, NameFemale, MaskID, Flags FROM char_titles ORDER BY ID DESC", CONNECTION_SYNCH); PREPARE_LOCALE_STMT(HOTFIX_SEL_CHAR_TITLES, "SELECT ID, NameMale_lang, NameFemale_lang FROM char_titles_locale WHERE locale = ?", CONNECTION_SYNCH); // ChatChannels.db2 @@ -154,7 +154,7 @@ void HotfixDatabaseConnection::DoPrepareStatements() // CreatureFamily.db2 PrepareStatement(HOTFIX_SEL_CREATURE_FAMILY, "SELECT ID, MinScale, MaxScale, Name, IconFile, SkillLine1, SkillLine2, PetFoodMask, MinScaleLevel, " - "MaxScaleLevel, PetTalentType, CategoryEnumID FROM creature_family ORDER BY ID DESC", CONNECTION_SYNCH); + "MaxScaleLevel, PetTalentType FROM creature_family ORDER BY ID DESC", CONNECTION_SYNCH); PREPARE_LOCALE_STMT(HOTFIX_SEL_CREATURE_FAMILY, "SELECT ID, Name_lang FROM creature_family_locale WHERE locale = ?", CONNECTION_SYNCH); // CreatureModelData.db2 @@ -437,8 +437,8 @@ void HotfixDatabaseConnection::DoPrepareStatements() PREPARE_LOCALE_STMT(HOTFIX_SEL_ITEM_RANDOM_PROPERTIES, "SELECT ID, Name_lang FROM item_random_properties_locale WHERE locale = ?", CONNECTION_SYNCH); // ItemRandomSuffix.db2 - PrepareStatement(HOTFIX_SEL_ITEM_RANDOM_SUFFIX, "SELECT ID, Name, Enchantment1, Enchantment2, Enchantment3, Enchantment4, " - "Enchantment5, AllocationPct1, AllocationPct2, AllocationPct3, AllocationPct4, AllocationPct5 FROM item_random_suffix ORDER BY ID DESC", CONNECTION_SYNCH); + PrepareStatement(HOTFIX_SEL_ITEM_RANDOM_SUFFIX, "SELECT ID, Name, Enchantment1, Enchantment2, Enchantment3, Enchantment4, Enchantment5, " + "AllocationPct1, AllocationPct2, AllocationPct3, AllocationPct4, AllocationPct5 FROM item_random_suffix ORDER BY ID DESC", CONNECTION_SYNCH); PREPARE_LOCALE_STMT(HOTFIX_SEL_ITEM_RANDOM_SUFFIX, "SELECT ID, Name_lang FROM item_random_suffix_locale WHERE locale = ?", CONNECTION_SYNCH); // ItemSet.db2 diff --git a/src/server/game/DataStores/DB2Metadata.h b/src/server/game/DataStores/DB2Metadata.h index 1ec1b0fe856..e510bfc23bb 100644 --- a/src/server/game/DataStores/DB2Metadata.h +++ b/src/server/game/DataStores/DB2Metadata.h @@ -827,9 +827,9 @@ struct CharTitlesMeta { static DB2Meta const* Instance() { - static char const* types = "sshhb"; - static uint8 const arraySizes[5] = { 1, 1, 1, 1, 1 }; - static DB2Meta instance(-1, 5, 0x597835B2, types, arraySizes); + static char const* types = "sshb"; + static uint8 const arraySizes[4] = { 1, 1, 1, 1 }; + static DB2Meta instance(-1, 4, 0xECCBDBF9, types, arraySizes); return &instance; } }; @@ -1179,9 +1179,9 @@ struct CreatureFamilyMeta { static DB2Meta const* Instance() { - static char const* types = "ffsShhbbbb"; - static uint8 const arraySizes[10] = { 1, 1, 1, 1, 2, 1, 1, 1, 1, 1 }; - static DB2Meta instance(-1, 10, 0xD3A903B4, types, arraySizes); + static char const* types = "ffsShhbbb"; + static uint8 const arraySizes[9] = { 1, 1, 1, 1, 2, 1, 1, 1, 1 }; + static DB2Meta instance(-1, 9, 0xC9BA80A3, types, arraySizes); return &instance; } }; @@ -4138,9 +4138,9 @@ struct QuestPOIBlobMeta { static DB2Meta const* Instance() { - static char const* types = "hhbb"; - static uint8 const arraySizes[4] = { 1, 1, 1, 1 }; - static DB2Meta instance(-1, 4, 0x2B6FCF8C, types, arraySizes); + static char const* types = "hhbbi"; + static uint8 const arraySizes[5] = { 1, 1, 1, 1, 1 }; + static DB2Meta instance(-1, 5, 0xA11D5590, types, arraySizes); return &instance; } }; @@ -4160,9 +4160,9 @@ struct QuestPOIPointCliTaskMeta { static DB2Meta const* Instance() { - static char const* types = "hhhhhb"; - static uint8 const arraySizes[6] = { 1, 1, 1, 1, 1, 1 }; - static DB2Meta instance(-1, 6, 0xB4B42A70, types, arraySizes); + static char const* types = "hhhhhbi"; + static uint8 const arraySizes[7] = { 1, 1, 1, 1, 1, 1, 1 }; + static DB2Meta instance(-1, 7, 0x6F65A1E7, types, arraySizes); return &instance; } }; diff --git a/src/server/game/DataStores/DB2Stores.h b/src/server/game/DataStores/DB2Stores.h index 72f7f741b78..e5579e080e2 100644 --- a/src/server/game/DataStores/DB2Stores.h +++ b/src/server/game/DataStores/DB2Stores.h @@ -189,7 +189,7 @@ typedef std::map<uint32, TaxiPathSetForSource> TaxiPathSetBySource; typedef std::vector<TaxiPathNodeEntry const*> TaxiPathNodeList; typedef std::vector<TaxiPathNodeList> TaxiPathNodesByPath; -#define TaxiMaskSize 235 +#define TaxiMaskSize 236 typedef std::array<uint8, TaxiMaskSize> TaxiMask; TC_GAME_API extern TaxiMask sTaxiNodesMask; diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index 993d8b1c315..d5ff75ce421 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -257,7 +257,6 @@ struct CharTitlesEntry uint32 ID; LocalizedString* NameMale; LocalizedString* NameFemale; - uint16 ConditionID; uint16 MaskID; uint8 Flags; }; @@ -423,7 +422,6 @@ struct CreatureFamilyEntry uint8 MinScaleLevel; uint8 MaxScaleLevel; uint8 PetTalentType; - uint8 CategoryEnumID; }; struct CreatureModelDataEntry diff --git a/src/server/game/DataStores/GameTables.cpp b/src/server/game/DataStores/GameTables.cpp index 3197305b77f..69637914b0e 100644 --- a/src/server/game/DataStores/GameTables.cpp +++ b/src/server/game/DataStores/GameTables.cpp @@ -63,21 +63,31 @@ inline uint32 LoadGameTable(std::vector<std::string>& errors, GameTable<T>& stor std::string line; while (std::getline(stream, line)) { - Tokenizer values(line, '\t', columnDefs.size(), false); - if (values.size() == 0) + Tokenizer values(line, '\t', columnDefs.size()); + if (!values.size()) break; - ASSERT(values.size() == columnDefs.size(), SZFMTD " == " SZFMTD, values.size(), columnDefs.size()); + // make end point just after last nonempty token + auto end = values.begin() + values.size() - 1; + while (!strlen(*end) && end != values.begin()) + --end; - // as of 21796 blizz doesnt seem to care about id column and just puts in whatever there - ASSERT(strtol(values[0], nullptr, 10) == data.size(), - "Unexpected row identifier %u at row " SZFMTD " (expected " SZFMTD ")", - strtol(values[0], nullptr, 10), data.size(), data.size()); + if (values.begin() == end) + break; + + ++end; + + ASSERT(std::distance(values.begin(), end) == columnDefs.size(), SZFMTD " == " SZFMTD, std::distance(values.begin(), end), columnDefs.size()); + + // client ignores id column - CombatRatings has copypasted rows for levels > 110 + //ASSERT(strtol(values[0], nullptr, 10) == data.size(), + // "Unexpected row identifier %u at row " SZFMTD " (expected " SZFMTD ")", + // strtol(values[0], nullptr, 10), data.size(), data.size()); data.emplace_back(); float* row = reinterpret_cast<float*>(&data.back()); - for (std::size_t col = 1; col < columnDefs.size(); ++col) - *row++ = strtof(values[col], nullptr); + for (auto itr = values.begin() + 1; itr != end; ++itr) + *row++ = strtof(*itr, nullptr); } storage.SetData(std::move(data)); |