void LoadDB2Stores(const std::string& dataPath) { std::string db2Path = dataPath + "dbc/"; StoreProblemList1 bad_db2_files; LoadDB2(bad_db2_files, sItemStore, db2Path, "Item.db2"); LoadDB2(bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2"); // error checks if (bad_db2_files.size() >= DB2FilesCount) { sLog->outError("\nIncorrect DataDir value in worldserver.conf or ALL required *.db2 files (%d) not found by path: %sdb2", DB2FilesCount, dataPath.c_str()); exit(1); } else if (!bad_db2_files.empty()) { std::string str; for (std::list<std::string>::iterator i = bad_db2_files.begin(); i != bad_db2_files.end(); ++i) str += *i + "\n"; sLog->outError("\nSome required *.db2 files (%u from %d) not found or not compatible:\n%s", (uint32)bad_db2_files.size(), DB2FilesCount, str.c_str()); exit(1); } for (uint32 i = 0; i < sItemStore.GetNumRows(); ++i) { ItemEntry const* itemEntry = sItemStore.LookupEntry(i); if (!itemEntry) continue; if (itemEntry->Class >= MAX_ITEM_CLASS) { sLog->outErrorDb("Item (Entry: %u) in Item.db2 has too high class value %u", itemEntry->ID, itemEntry->Class); const_cast<ItemEntry*>(itemEntry)->Class = 0; } if (itemEntry->SubClass >= MaxItemSubclassValues[itemEntry->Class]) { sLog->outErrorDb("Item (Entry: %u) in Item.db2 has too high subclass value %u for class %u", itemEntry->ID, itemEntry->SubClass, itemEntry->Class); const_cast<ItemEntry*>(itemEntry)->SubClass = 0; } } // Check loaded DB2 files proper version if (!sItemStore.LookupEntry(68815) || // last client known item added in 4.0.6a !sItemSparseStore.LookupEntry(68815)) // last client known item added in 4.0.6a { sLog->outString(); sLog->outError("Please extract correct db2 files from client 4.0.6a 13623."); exit(1); } sLog->outString(">> Initialized %d DB2 data stores.", DB2FilesCount); sLog->outString(); }
void LoadDB2Stores(const std::string& dataPath) { std::string db2Path = dataPath + "dbc/"; LocaleNameStr const* defaultLocaleNameStr = NULL; StoreProblemList1 bad_db2_files; LocalDB2Data availableDb2Locales(LocaleConstant(0));//defaultLocaleNameStr->locale)); LoadDB2(availableDb2Locales,bad_db2_files,sItemStore, db2Path,"Item.db2"); LoadDB2(availableDb2Locales,bad_db2_files,sItemCurrencyCostStore, db2Path,"ItemCurrencyCost.db2"); LoadDB2(availableDb2Locales,bad_db2_files,sItemExtendedCostStore, db2Path,"ItemExtendedCost.db2"); LoadDB2(availableDb2Locales,bad_db2_files,sSpellReagentsStore, db2Path,"SpellReagents.db2"); LoadDB2(availableDb2Locales,bad_db2_files,sSceneScriptStore, db2Path, "SceneScript.db2"); // error checks if (bad_db2_files.size() >= DB2FileCount) { sLog.outError("Incorrect DataDir value in worldserver.conf or ALL required *.db2 files (%d) not found by path: %sdb2", DB2FileCount, dataPath.c_str()); exit(1); } else if (!bad_db2_files.empty()) { std::string str; for (StoreProblemList1::iterator i = bad_db2_files.begin(); i != bad_db2_files.end(); ++i) str += *i + "\n"; sLog.outError("Some required *.db2 files (%u from %d) not found or not compatible:\n%s",(uint32)bad_db2_files.size(), DB2FileCount, str.c_str()); exit(1); } // Check loaded DB2 files proper version if (!sItemStore.LookupEntry(112353) || // last item added in 5.4.8 (18414) !sItemExtendedCostStore.LookupEntry(5280) || // last item extended cost added in 5.4.8 (18414) !sSceneScriptStore.LookupEntry(11156) ) // last scene script added in 5.4.8 (18414) { sLog.outString(""); sLog.outError("Please extract correct db2 files from build %s", AcceptableClientBuildsListStr().c_str()); exit(1); } sLog.outString(); sLog.outString( ">> Initialized %d db2 stores", DB2FileCount ); }
void LoadDB2Stores(const std::string& dataPath) { std::string db2Path = dataPath + "dbc/"; StoreProblemList1 bad_db2_files; uint32 availableDb2Locales = 0xFFFFFFFF; LoadDB2(availableDb2Locales, bad_db2_files, sItemStore, db2Path, "Item.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2"); for (uint32 i = 0; i < sItemStore.GetNumRows(); ++i) { ItemEntry const* itemEntry = sItemStore.LookupEntry(i); if (!itemEntry) continue; if (itemEntry->Class >= MAX_ITEM_CLASS) { sLog->outErrorDb("Item (Entry: %u) in Item.db2 has too high class value %u", itemEntry->ID, itemEntry->Class); const_cast<ItemEntry*>(itemEntry)->Class = 0; } if (itemEntry->SubClass >= MaxItemSubclassValues[itemEntry->Class]) { sLog->outErrorDb("Item (Entry: %u) in Item.db2 has too high subclass value %u for class %u", itemEntry->ID, itemEntry->SubClass, itemEntry->Class); const_cast<ItemEntry*>(itemEntry)->SubClass = 0; } } // Check loaded DBC files proper version if (!sItemStore.LookupEntry(68815) || // last client known item added in 4.0.6a !sItemSparseStore.LookupEntry(68815)) // last client known item added in 4.0.6a { sLog->outString(); sLog->outError("Please extract correct db2 files from client 4.0.6a 13623."); exit(1); } sLog->outString(">> Initialized DB2 %d data stores.", DB2FilesCount); sLog->outString(); }
void LoadDB2Stores(std::string const& dataPath) { std::string db2Path = dataPath + "dbc/"; DB2StoreProblemList bad_db2_files; uint32 availableDb2Locales = 0xFF; LoadDB2(availableDb2Locales, bad_db2_files, sItemStore, db2Path, "Item.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemCurrencyCostStore, db2Path, "ItemCurrencyCost.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sKeyChainStore, db2Path, "KeyChain.db2"); // error checks if (bad_db2_files.size() >= DB2FilesCount) { TC_LOG_ERROR(LOG_FILTER_GENERAL, "\nIncorrect DataDir value in worldserver.conf or ALL required *.db2 files (%d) not found by path: %sdb2", DB2FilesCount, dataPath.c_str()); exit(1); } else if (!bad_db2_files.empty()) { std::string str; for (std::list<std::string>::iterator i = bad_db2_files.begin(); i != bad_db2_files.end(); ++i) str += *i + "\n"; TC_LOG_ERROR(LOG_FILTER_GENERAL, "\nSome required *.db2 files (%u from %d) not found or not compatible:\n%s", (uint32)bad_db2_files.size(), DB2FilesCount, str.c_str()); exit(1); } // Check loaded DB2 files proper version if (!sItemStore.LookupEntry(106130) || // last item added in 5.4.0 (17399) !sItemExtendedCostStore.LookupEntry(5268)) // last item extended cost added in 5.4.0 (17399) { TC_LOG_ERROR(LOG_FILTER_GENERAL, "Please extract correct db2 files from client 5.4.0 17399."); //exit(1); } TC_LOG_ERROR(LOG_FILTER_GENERAL, ">> Initialized %d DB2 data stores.", DB2FilesCount); }
void LoadDB2Stores(const std::string& dataPath) { std::string db2Path = dataPath + "dbc/"; StoreProblemList1 bad_db2_files; LoadDB2(bad_db2_files, sBattlePetSpeciesStore, db2Path, "BattlePetSpecies.db2"); LoadDB2(bad_db2_files, sItemStore, db2Path, "Item.db2"); LoadDB2(bad_db2_files, sItemCurrencyCostStore, db2Path, "ItemCurrencyCost.db2"); LoadDB2(bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2"); LoadDB2(bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2"); // error checks if (bad_db2_files.size() >= DB2FilesCount) { sLog->outError(LOG_FILTER_GENERAL, "\nIncorrect DataDir value in worldserver.conf or ALL required *.db2 files (%d) not found by path: %sdb2", DB2FilesCount, dataPath.c_str()); exit(1); } else if (!bad_db2_files.empty()) { std::string str; for (std::list<std::string>::iterator i = bad_db2_files.begin(); i != bad_db2_files.end(); ++i) str += *i + "\n"; sLog->outError(LOG_FILTER_GENERAL, "\nSome required *.db2 files (%u from %d) not found or not compatible:\n%s", (uint32)bad_db2_files.size(), DB2FilesCount, str.c_str()); exit(1); } // Check loaded DB2 files proper version if (!sItemStore.LookupEntry(93626) || // last item added in 5.1.0 (16357) !sItemExtendedCostStore.LookupEntry(3872) ) // last item extended cost added in 4.3.4 (15595) // don't know about this { sLog->outError(LOG_FILTER_GENERAL, "Please extract correct db2 files from client 5.1.0 16357."); exit(1); } sLog->outInfo(LOG_FILTER_GENERAL, ">> Initialized %d DB2 data stores.", DB2FilesCount); }
void LoadDB2Stores(const std::string& dataPath) { std::string db2Path = dataPath + "dbc/"; StoreProblemList1 bad_db2_files; uint32 availableDb2Locales = 0xFF; LoadDB2(availableDb2Locales, bad_db2_files, sBroadcastTextStore, db2Path, "BroadcastText.db2"); //LoadDB2(availableDb2Locales, bad_db2_files, sBattlePetSpeciesStore, db2Path, "BattlePetSpecies.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemStore, db2Path, "Item.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemCurrencyCostStore, db2Path, "ItemCurrencyCost.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sKeyChainStore, db2Path, "KeyChain.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sQuestPackageItemStore, db2Path, "QuestPackageItem.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sSpellReagentsStore, db2Path, "SpellReagents.db2"); // error checks if (bad_db2_files.size() >= DB2FilesCount) { sLog->outError(LOG_FILTER_GENERAL, "\nIncorrect DataDir value in worldserver.conf or ALL required *.db2 files (%d) not found by path: %sdb2", DB2FilesCount, dataPath.c_str()); exit(1); } else if (!bad_db2_files.empty()) { std::string str; for (std::list<std::string>::iterator i = bad_db2_files.begin(); i != bad_db2_files.end(); ++i) str += *i + "\n"; sLog->outError(LOG_FILTER_GENERAL, "\nSome required *.db2 files (%u from %d) not found or not compatible:\n%s", (uint32)bad_db2_files.size(), DB2FilesCount, str.c_str()); exit(1); } // Check loaded DB2 files proper version if (!sBroadcastTextStore.LookupEntry(77161) || // last broadcast text added in 5.4.8 (18414) !sItemStore.LookupEntry(112353) || // last item added in 5.4.8 (18414) !sItemExtendedCostStore.LookupEntry(5280) || // last item extended cost added in 5.4.8 (18414) !sQuestPackageItemStore.LookupEntry(2256)) // last quest package item in 5.4.8 (18414) { sLog->outError(LOG_FILTER_GENERAL, "Please extract correct db2 files from client 5.4.8 18414."); exit(1); } sLog->outInfo(LOG_FILTER_GENERAL, ">> Initialized %d DB2 data stores.", DB2FilesCount); }
void LoadDB2Stores(std::string const& dataPath) { std::string db2Path = dataPath + "dbc/"; DB2StoreProblemList bad_db2_files; uint32 availableDb2Locales = 0xFF; LoadDB2(availableDb2Locales, bad_db2_files, sBroadcastTextStore, db2Path, "BroadcastText.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemStore, db2Path, "Item.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemCurrencyCostStore, db2Path, "ItemCurrencyCost.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sKeyChainStore, db2Path, "KeyChain.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sSceneScriptStore, db2Path, "SceneScript.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sSpellReagentsStore, db2Path, "SpellReagents.db2"); // error checks if (bad_db2_files.size() >= DB2FilesCount) { TC_LOG_ERROR("misc", "\nIncorrect DataDir value in worldserver.conf or ALL required *.db2 files (%d) not found by path: %sdb2", DB2FilesCount, dataPath.c_str()); exit(1); } else if (!bad_db2_files.empty()) { std::string str; for (std::list<std::string>::iterator i = bad_db2_files.begin(); i != bad_db2_files.end(); ++i) str += *i + "\n"; TC_LOG_ERROR("misc", "\nSome required *.db2 files (%u from %d) not found or not compatible:\n%s", (uint32)bad_db2_files.size(), DB2FilesCount, str.c_str()); exit(1); } // Check loaded DB2 files proper version if (!sBroadcastTextStore.LookupEntry(77161) || // last broadcast text added in 5.4.7 (17956) !sItemStore.LookupEntry(109014) || // last item added in 5.4.7 (17956) !sItemExtendedCostStore.LookupEntry(5268) || // last item extended cost added in 5.4.7 (17956) !sSceneScriptStore.LookupEntry(11156)) // last scene script added in 5.4.7 (17956) { TC_LOG_ERROR("misc", "You have _outdated_ DB2 files, Please extract correct db2 files from client 5.4.7 17956."); exit(1); } TC_LOG_INFO("misc", ">> Initialized %d DB2 data stores.", DB2FilesCount); }
void LoadDB2Stores(const std::string& dataPath) { std::string db2Path = dataPath + "dbc/"; const uint32 DB2FilesCount = 1; StoreProblemList1 bad_db2_files; uint32 availableDb2Locales = 0xFFFFFFFF; LoadDB2(availableDb2Locales, bad_db2_files, sItemStore, db2Path, "Item.db2"); // error checks if (bad_db2_files.size() >= DB2FilesCount) { sLog.outError("\nIncorrect DataDir value in worldserver.conf or ALL required *.db2 files (%d) not found by path: %sdb2", DB2FilesCount, dataPath.c_str()); exit(1); } else if (!bad_db2_files.empty()) { std::string str; for (std::list<std::string>::iterator i = bad_db2_files.begin(); i != bad_db2_files.end(); ++i) str += *i + "\n"; sLog.outError("\nSome required *.db2 files (%u from %d) not found or not compatible:\n%s", (uint32)bad_db2_files.size(), DB2FilesCount,str.c_str()); exit(1); } // Check loaded DBC files proper version if (!sItemStore.LookupEntry(68815)) // last client known item added in 4.0.6a { sLog.outString(" "); sLog.outError("Please extract correct db2 files from client 4.0.6a 13623."); exit(1); } sLog.outString(">> Initialized %d data stores.", DB2FilesCount); sLog.outString(); }
void LoadDB2Stores(std::string const& dataPath) { std::string db2Path = dataPath + "dbc/"; DB2StoreProblemList bad_db2_files; uint32 availableDb2Locales = 0xFF; LoadDB2(availableDb2Locales, bad_db2_files, sBattlePetAbilityStore, db2Path, "BattlePetAbility.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sBattlePetAbilityStateStore, db2Path, "BattlePetAbilityState.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sBattlePetBreedStateStore, db2Path, "BattlePetBreedState.db2"); for (uint32 i = 0; i < sBattlePetBreedStateStore.GetNumRows(); i++) if (BattlePetBreedStateEntry const* breedStateEntry = sBattlePetBreedStateStore.LookupEntry(i)) if (sBattlePetBreedSet.find(breedStateEntry->BreedId) == sBattlePetBreedSet.end()) sBattlePetBreedSet.insert(breedStateEntry->BreedId); LoadDB2(availableDb2Locales, bad_db2_files, sBattlePetSpeciesStore, db2Path, "BattlePetSpecies.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sBattlePetSpeciesStateStore, db2Path, "BattlePetSpeciesState.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sBattlePetSpeciesXAbilityStore, db2Path, "BattlePetSpeciesXAbility.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sBattlePetStateStore, db2Path, "BattlePetState.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemToBattlePetStore, db2Path, "ItemToBattlePet.db2"); for (uint32 i = 0; i < sItemToBattlePetStore.GetNumRows(); i++) if (ItemToBattlePetEntry const* itemEntry = sItemToBattlePetStore.LookupEntry(i)) sBattlePetItemXSpeciesStore.insert(std::make_pair(itemEntry->ItemId, itemEntry->SpeciesId)); LoadDB2(availableDb2Locales, bad_db2_files, sBroadcastTextStore, db2Path, "BroadcastText.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemStore, db2Path, "Item.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemCurrencyCostStore, db2Path, "ItemCurrencyCost.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemSparseStore, db2Path, "Item-sparse.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sItemExtendedCostStore, db2Path, "ItemExtendedCost.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sKeyChainStore, db2Path, "KeyChain.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sQuestPackageItemStore, db2Path, "QuestPackageItem.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sSceneScriptStore, db2Path, "SceneScript.db2"); LoadDB2(availableDb2Locales, bad_db2_files, sSpellReagentsStore, db2Path, "SpellReagents.db2"); // error checks if (bad_db2_files.size() >= DB2FilesCount) { TC_LOG_ERROR("misc", "\nIncorrect DataDir value in worldserver.conf or ALL required *.db2 files (%d) not found by path: %sdbc", DB2FilesCount, dataPath.c_str()); exit(1); } else if (!bad_db2_files.empty()) { std::string str; for (std::list<std::string>::iterator i = bad_db2_files.begin(); i != bad_db2_files.end(); ++i) str += *i + "\n"; TC_LOG_ERROR("misc", "\nSome required *.db2 files (%u from %d) not found or not compatible:\n%s", (uint32)bad_db2_files.size(), DB2FilesCount, str.c_str()); exit(1); } // Check loaded DB2 files proper version if (!sBattlePetAbilityStore.LookupEntry(1238) // last battle pet ability added in 5.4.8 (18414) || !sBattlePetSpeciesStore.LookupEntry(1386) // last battle pet species added in 5.4.8 (18414) || !sBattlePetStateStore.LookupEntry(176) // last battle pet state added in 5.4.8 (18414) || !sItemToBattlePetStore.LookupEntry(109014) // last battle pet item added in 5.4.8 (18414) || !sBroadcastTextStore.LookupEntry(77161) // last broadcast text added in 5.4.8 (18414) || !sItemStore.LookupEntry(112353) // last item added in 5.4.8 (18414) || !sItemExtendedCostStore.LookupEntry(5280) // last item extended cost added in 5.4.8 (18414) || !sQuestPackageItemStore.LookupEntry(2256) // last quest package item in 5.4.8 (18414) || !sSceneScriptStore.LookupEntry(11156)) // last scene script added in 5.4.8 (18414) { TC_LOG_ERROR("misc", "You have _outdated_ DB2 files, Please extract correct db2 files from client 5.4.8 18414."); exit(1); } TC_LOG_INFO("misc", ">> Initialized %d DB2 data stores.", DB2FilesCount); }