本文整理汇总了C++中DB2Storage::LookupEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ DB2Storage::LookupEntry方法的具体用法?C++ DB2Storage::LookupEntry怎么用?C++ DB2Storage::LookupEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB2Storage
的用法示例。
在下文中一共展示了DB2Storage::LookupEntry方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
uint32 DB2Manager::GetQuestUniqueBitFlag(uint32 questId)
{
QuestV2Entry const* v2 = sQuestV2Store.LookupEntry(questId);
if (!v2)
return 0;
return v2->UniqueBitFlag;
}
示例2: LoadDB2Stores
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);
}
示例3: LoadDB2Stores
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);
}
示例4: LoadDB2Stores
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);
}
示例5: if
//.........这里部分代码省略.........
LOAD_DB2(sSpellLearnSpellStore);
LOAD_DB2(sSpellMiscStore);
LOAD_DB2(sSpellPowerDifficultyStore);
LOAD_DB2(sSpellPowerStore);
LOAD_DB2(sSpellRadiusStore);
LOAD_DB2(sSpellRangeStore);
LOAD_DB2(sSpellReagentsStore);
LOAD_DB2(sSpellRuneCostStore);
LOAD_DB2(sSpellTotemsStore);
LOAD_DB2(sSpellXSpellVisualStore);
LOAD_DB2(sTaxiNodesStore);
LOAD_DB2(sTaxiPathNodeStore);
LOAD_DB2(sTaxiPathStore);
LOAD_DB2(sTotemCategoryStore);
LOAD_DB2(sTransportAnimationStore);
LOAD_DB2(sTransportRotationStore);
LOAD_DB2(sUnitPowerBarStore);
LOAD_DB2(sWorldMapOverlayStore);
#undef LOAD_DB2
for (AreaGroupMemberEntry const* areaGroupMember : sAreaGroupMemberStore)
_areaGroupMembers[areaGroupMember->AreaGroupID].push_back(areaGroupMember->AreaID);
for (CharStartOutfitEntry const* outfit : sCharStartOutfitStore)
_charStartOutfits[outfit->RaceID | (outfit->ClassID << 8) | (outfit->GenderID << 16)] = outfit;
for (uint32 i = 0; i < MAX_CLASSES; ++i)
for (uint32 j = 0; j < MAX_POWERS; ++j)
_powersByClass[i][j] = MAX_POWERS;
for (uint32 i = 0; i < sChrClassesXPowerTypesStore.GetNumRows(); ++i)
{
if (ChrClassesXPowerTypesEntry const* power = sChrClassesXPowerTypesStore.LookupEntry(i))
{
uint32 index = 0;
for (uint32 j = 0; j < MAX_POWERS; ++j)
if (_powersByClass[power->ClassID][j] != MAX_POWERS)
++index;
_powersByClass[power->ClassID][power->PowerType] = index;
}
}
for (ItemBonusEntry const* bonus : sItemBonusStore)
_itemBonusLists[bonus->BonusListID].push_back(bonus);
for (ItemBonusTreeNodeEntry const* bonusTreeNode : sItemBonusTreeNodeStore)
{
uint32 bonusTreeId = bonusTreeNode->BonusTreeID;
while (bonusTreeNode)
{
_itemBonusTrees[bonusTreeId].insert(bonusTreeNode);
bonusTreeNode = sItemBonusTreeNodeStore.LookupEntry(bonusTreeNode->SubTreeID);
}
}
for (ItemModifiedAppearanceEntry const* appearanceMod : sItemModifiedAppearanceStore)
if (ItemAppearanceEntry const* appearance = sItemAppearanceStore.LookupEntry(appearanceMod->AppearanceID))
_itemDisplayIDs[appearanceMod->ItemID | (appearanceMod->AppearanceModID << 24)] = appearance->DisplayID;
for (ItemSpecOverrideEntry const* entry : sItemSpecOverrideStore)
_itemSpecOverrides[entry->ItemID].push_back(entry);
for (ItemXBonusTreeEntry const* itemBonusTreeAssignment : sItemXBonusTreeStore)
_itemToBonusTree.insert({ itemBonusTreeAssignment->ItemID, itemBonusTreeAssignment->BonusTreeID });