TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DB2Manager Class Reference

#include <DB2Stores.h>

Public Types

typedef std::map< uint32,
DB2StorageBase * > 
StorageMap
 
typedef std::unordered_map
< uint32, std::vector< uint32 > > 
AreaGroupMemberContainer
 
typedef std::unordered_map
< uint32, CharStartOutfitEntry
const * > 
CharStartOutfitContainer
 
typedef std::set
< GlyphSlotEntry const
*, GlyphSlotEntryComparator > 
GlyphSlotContainer
 
typedef std::map< uint32,
std::map< uint32,
CurvePointEntry const
*, std::greater< uint32 > > > 
HeirloomCurvesContainer
 
typedef std::unordered_map
< uint32, HeirloomEntry const * > 
HeirloomItemsContainer
 
typedef std::vector
< ItemBonusEntry const * > 
ItemBonusList
 
typedef std::unordered_map
< uint32, ItemBonusList
ItemBonusListContainer
 
typedef
std::unordered_multimap
< uint32, uint32
ItemToBonusTreeContainer
 
typedef std::unordered_map
< uint32, uint32
ItemDisplayIdContainer
 
typedef std::unordered_map
< uint32, std::set
< ItemBonusTreeNodeEntry const * > > 
ItemBonusTreeContainer
 
typedef std::unordered_map
< uint32, std::vector
< ItemSpecOverrideEntry const * > > 
ItemSpecOverridesContainer
 
typedef std::unordered_map
< uint32, MountEntry const * > 
MountContainer
 
typedef std::set
< MountTypeXCapabilityEntry
const
*, MountTypeXCapabilityEntryComparator > 
MountTypeXCapabilitySet
 
typedef std::unordered_map
< uint32,
MountTypeXCapabilitySet
MountCapabilitiesByTypeContainer
 
typedef std::unordered_map
< uint32, std::array
< std::vector< NameGenEntry
const * >, 2 > > 
NameGenContainer
 
typedef std::array
< std::vector< boost::regex >
, TOTAL_LOCALES+1 > 
NameValidationRegexContainer
 
typedef std::unordered_map
< uint32, std::set< uint32 > > 
PhaseGroupContainer
 
typedef std::unordered_map
< uint32, std::vector
< QuestPackageItemEntry const * > > 
QuestPackageItemContainer
 
typedef std::unordered_map
< uint32, std::vector
< SpecializationSpellsEntry
const * > > 
SpecializationSpellsContainer
 
typedef std::unordered_map
< uint32, std::vector
< SpellPowerEntry const * > > 
SpellPowerContainer
 
typedef std::unordered_map
< uint32, std::unordered_map
< uint32, std::vector
< SpellPowerEntry const * > > > 
SpellPowerDifficultyContainer
 
typedef std::unordered_set
< uint32
ToyItemIdsContainer
 

Public Member Functions

 DEFINE_DB2_SET_COMPARATOR (ChrClassesXPowerTypesEntry)
 
 DEFINE_DB2_SET_COMPARATOR (GlyphSlotEntry)
 
 DEFINE_DB2_SET_COMPARATOR (MountTypeXCapabilityEntry)
 
void LoadStores (std::string const &dataPath, uint32 defaultLocale)
 
DB2StorageBase constGetStorage (uint32 type) const
 
void LoadHotfixData ()
 
HotfixData constGetHotfixData () const
 
time_t GetHotfixDate (uint32 entry, uint32 type) const
 
std::vector< uint32GetAreasForGroup (uint32 areaGroupId) const
 
CharStartOutfitEntry constGetCharStartOutfitEntry (uint8 race, uint8 class_, uint8 gender) const
 
uint32 GetPowerIndexByClass (uint32 powerType, uint32 classId) const
 
GlyphSlotContainer constGetGlyphSlots () const
 
uint32 GetHeirloomItemLevel (uint32 curveId, uint32 level) const
 
HeirloomEntry constGetHeirloomByItemId (uint32 itemId) const
 
ItemBonusList constGetItemBonusList (uint32 bonusListId) const
 
std::set< uint32GetItemBonusTree (uint32 itemId, uint32 itemBonusTreeMod) const
 
uint32 GetItemDisplayId (uint32 itemId, uint32 appearanceModId) const
 
std::vector
< ItemSpecOverrideEntry const * >
const
GetItemSpecOverrides (uint32 itemId) const
 
std::string GetNameGenEntry (uint8 race, uint8 gender, LocaleConstant locale) const
 
MountEntry constGetMount (uint32 spellId) const
 
MountEntry constGetMountById (uint32 id) const
 
MountTypeXCapabilitySet constGetMountCapabilities (uint32 mountType) const
 
ResponseCodes ValidateName (std::string const &name, LocaleConstant locale) const
 
std::vector
< QuestPackageItemEntry const * >
const
GetQuestPackageItems (uint32 questPackageID) const
 
uint32 GetQuestUniqueBitFlag (uint32 questId)
 
std::set< uint32GetPhasesForGroup (uint32 group) const
 
std::vector
< SpecializationSpellsEntry
const * > const
GetSpecializationSpells (uint32 specId) const
 
std::vector< SpellPowerEntry
const * > 
GetSpellPowers (uint32 spellId, Difficulty difficulty=DIFFICULTY_NONE, bool *hasDifficultyPowers=nullptr) const
 
bool IsToyItem (uint32 toy) const
 

Static Public Member Functions

static DB2ManagerInstance ()
 
static char constGetBroadcastTextValue (BroadcastTextEntry const *broadcastText, LocaleConstant locale=DEFAULT_LOCALE, uint8 gender=GENDER_MALE, bool forceGender=false)
 

Private Attributes

StorageMap _stores
 
HotfixData _hotfixData
 
AreaGroupMemberContainer _areaGroupMembers
 
CharStartOutfitContainer _charStartOutfits
 
uint32 _powersByClass [MAX_CLASSES][MAX_POWERS]
 
GlyphSlotContainer _glyphSlots
 
HeirloomItemsContainer _heirlooms
 
HeirloomCurvesContainer _heirloomCurvePoints
 
ItemBonusListContainer _itemBonusLists
 
ItemBonusTreeContainer _itemBonusTrees
 
ItemDisplayIdContainer _itemDisplayIDs
 
ItemToBonusTreeContainer _itemToBonusTree
 
ItemSpecOverridesContainer _itemSpecOverrides
 
MountContainer _mountsBySpellId
 
MountCapabilitiesByTypeContainer _mountCapabilitiesByType
 
NameGenContainer _nameGenData
 
NameValidationRegexContainer _nameValidators
 
PhaseGroupContainer _phasesByGroup
 
QuestPackageItemContainer _questPackages
 
SpecializationSpellsContainer _specializationSpellsBySpec
 
SpellPowerContainer _spellPowers
 
SpellPowerDifficultyContainer _spellPowerDifficulties
 
ToyItemIdsContainer _toys
 

Member Typedef Documentation

typedef std::unordered_map<uint32 , std::vector<uint32> > DB2Manager::AreaGroupMemberContainer
typedef std::set<GlyphSlotEntry const*, GlyphSlotEntryComparator> DB2Manager::GlyphSlotContainer
typedef std::map<uint32 , std::map<uint32, CurvePointEntry const*, std::greater<uint32> > > DB2Manager::HeirloomCurvesContainer
typedef std::unordered_map<uint32, std::set<ItemBonusTreeNodeEntry const*> > DB2Manager::ItemBonusTreeContainer
typedef std::unordered_map<uint32 , uint32> DB2Manager::ItemDisplayIdContainer
typedef std::unordered_map<uint32, std::vector<ItemSpecOverrideEntry const*> > DB2Manager::ItemSpecOverridesContainer
typedef std::unordered_multimap<uint32 , uint32 > DB2Manager::ItemToBonusTreeContainer
typedef std::unordered_map<uint32, MountEntry const*> DB2Manager::MountContainer
typedef std::set<MountTypeXCapabilityEntry const*, MountTypeXCapabilityEntryComparator> DB2Manager::MountTypeXCapabilitySet
typedef std::unordered_map<uint32, std::array<std::vector<NameGenEntry const*>, 2> > DB2Manager::NameGenContainer
typedef std::array<std::vector<boost::regex>, TOTAL_LOCALES + 1> DB2Manager::NameValidationRegexContainer
typedef std::unordered_map<uint32, std::set<uint32> > DB2Manager::PhaseGroupContainer
typedef std::unordered_map<uint32, std::vector<QuestPackageItemEntry const*> > DB2Manager::QuestPackageItemContainer
typedef std::unordered_map<uint32, std::vector<SpellPowerEntry const*> > DB2Manager::SpellPowerContainer
typedef std::unordered_map<uint32, std::unordered_map<uint32, std::vector<SpellPowerEntry const*> > > DB2Manager::SpellPowerDifficultyContainer
typedef std::unordered_set<uint32> DB2Manager::ToyItemIdsContainer

Member Function Documentation

DB2Manager::DEFINE_DB2_SET_COMPARATOR ( ChrClassesXPowerTypesEntry  )
DB2Manager::DEFINE_DB2_SET_COMPARATOR ( GlyphSlotEntry  )
DB2Manager::DEFINE_DB2_SET_COMPARATOR ( MountTypeXCapabilityEntry  )
std::vector< uint32 > DB2Manager::GetAreasForGroup ( uint32  areaGroupId) const
602 {
603  auto itr = _areaGroupMembers.find(areaGroupId);
604  if (itr != _areaGroupMembers.end())
605  return itr->second;
606 
607  return std::vector<uint32>();
608 }
AreaGroupMemberContainer _areaGroupMembers
Definition: DB2Stores.h:201
char const * DB2Manager::GetBroadcastTextValue ( BroadcastTextEntry const broadcastText,
LocaleConstant  locale = DEFAULT_LOCALE,
uint8  gender = GENDER_MALE,
bool  forceGender = false 
)
static
611 {
612  if (gender == GENDER_FEMALE && (forceGender || broadcastText->FemaleText->Str[DEFAULT_LOCALE][0] != '\0'))
613  {
614  if (broadcastText->FemaleText->Str[locale][0] != '\0')
615  return broadcastText->FemaleText->Str[locale];
616 
617  return broadcastText->FemaleText->Str[DEFAULT_LOCALE];
618  }
619 
620  if (broadcastText->MaleText->Str[locale][0] != '\0')
621  return broadcastText->MaleText->Str[locale];
622 
623  return broadcastText->MaleText->Str[DEFAULT_LOCALE];
624 }
Definition: SharedDefines.h:94
#define DEFAULT_LOCALE
Definition: Common.h:134

+ Here is the caller graph for this function:

CharStartOutfitEntry const * DB2Manager::GetCharStartOutfitEntry ( uint8  race,
uint8  class_,
uint8  gender 
) const
627 {
628  auto itr = _charStartOutfits.find(race | (class_ << 8) | (gender << 16));
629  if (itr == _charStartOutfits.end())
630  return nullptr;
631 
632  return itr->second;
633 }
CharStartOutfitContainer _charStartOutfits
Definition: DB2Stores.h:202
GlyphSlotContainer const& DB2Manager::GetGlyphSlots ( ) const
inline
178 { return _glyphSlots; }
GlyphSlotContainer _glyphSlots
Definition: DB2Stores.h:204
HeirloomEntry const * DB2Manager::GetHeirloomByItemId ( uint32  itemId) const
660 {
661  auto itr = _heirlooms.find(itemId);
662  if (itr != _heirlooms.end())
663  return itr->second;
664 
665  return nullptr;
666 }
HeirloomItemsContainer _heirlooms
Definition: DB2Stores.h:205
uint32 DB2Manager::GetHeirloomItemLevel ( uint32  curveId,
uint32  level 
) const
641 {
642  // Assuming linear item level scaling for heirlooms
643  auto itr = _heirloomCurvePoints.find(curveId);
644  if (itr == _heirloomCurvePoints.end())
645  return 0;
646 
647  auto it2 = itr->second.begin(); // Highest scaling point
648  if (level >= it2->second->X)
649  return it2->second->Y;
650 
651  auto previousItr = it2++;
652  for (; it2 != itr->second.end(); ++it2, ++previousItr)
653  if (level >= it2->second->X)
654  return uint32((previousItr->second->Y - it2->second->Y) / (previousItr->second->X - it2->second->X) * (float(level) - it2->second->X) + it2->second->Y);
655 
656  return uint32(previousItr->second->Y); // Lowest scaling point
657 }
HeirloomCurvesContainer _heirloomCurvePoints
Definition: DB2Stores.h:206
uint32_t uint32
Definition: g3dmath.h:168
HotfixData const* DB2Manager::GetHotfixData ( ) const
inline
171 { return &_hotfixData; }
HotfixData _hotfixData
Definition: DB2Stores.h:199
time_t DB2Manager::GetHotfixDate ( uint32  entry,
uint32  type 
) const
591 {
592  time_t ret = 0;
593  for (HotfixNotify const& hotfix : _hotfixData)
594  if (hotfix.Entry == entry && hotfix.TableHash == type)
595  if (time_t(hotfix.Timestamp) > ret)
596  ret = time_t(hotfix.Timestamp);
597 
598  return ret ? ret : time(NULL);
599 }
Definition: DB2Stores.h:118
arena_t NULL
Definition: jemalloc_internal.h:624
HotfixData _hotfixData
Definition: DB2Stores.h:199
DB2Manager::ItemBonusList const * DB2Manager::GetItemBonusList ( uint32  bonusListId) const
669 {
670  auto itr = _itemBonusLists.find(bonusListId);
671  if (itr != _itemBonusLists.end())
672  return &itr->second;
673 
674  return nullptr;
675 }
ItemBonusListContainer _itemBonusLists
Definition: DB2Stores.h:207
std::set< uint32 > DB2Manager::GetItemBonusTree ( uint32  itemId,
uint32  itemBonusTreeMod 
) const
678 {
679  std::set<uint32> bonusListIDs;
680  auto itemIdRange = _itemToBonusTree.equal_range(itemId);
681  if (itemIdRange.first == itemIdRange.second)
682  return bonusListIDs;
683 
684  for (auto itemTreeItr = itemIdRange.first; itemTreeItr != itemIdRange.second; ++itemTreeItr)
685  {
686  auto treeItr = _itemBonusTrees.find(itemTreeItr->second);
687  if (treeItr == _itemBonusTrees.end())
688  continue;
689 
690  for (ItemBonusTreeNodeEntry const* bonusTreeNode : treeItr->second)
691  if (bonusTreeNode->BonusTreeModID == itemBonusTreeMod)
692  bonusListIDs.insert(bonusTreeNode->BonusListID);
693  }
694 
695  return bonusListIDs;
696 }
Definition: DB2Structure.h:662
ItemToBonusTreeContainer _itemToBonusTree
Definition: DB2Stores.h:210
uint32 BonusTreeModID
Definition: DB2Structure.h:666
uint32 BonusListID
Definition: DB2Structure.h:668
ItemBonusTreeContainer _itemBonusTrees
Definition: DB2Stores.h:208
uint32 DB2Manager::GetItemDisplayId ( uint32  itemId,
uint32  appearanceModId 
) const
699 {
700  auto itr = _itemDisplayIDs.find(itemId | (appearanceModId << 24));
701  if (itr != _itemDisplayIDs.end())
702  return itr->second;
703 
704  // Fall back to unmodified appearance
705  if (appearanceModId)
706  {
707  itr = _itemDisplayIDs.find(itemId);
708  if (itr != _itemDisplayIDs.end())
709  return itr->second;
710  }
711 
712  return 0;
713 }
ItemDisplayIdContainer _itemDisplayIDs
Definition: DB2Stores.h:209
std::vector< ItemSpecOverrideEntry const * > const * DB2Manager::GetItemSpecOverrides ( uint32  itemId) const
716 {
717  auto itr = _itemSpecOverrides.find(itemId);
718  if (itr != _itemSpecOverrides.end())
719  return &itr->second;
720 
721  return nullptr;
722 }
ItemSpecOverridesContainer _itemSpecOverrides
Definition: DB2Stores.h:211
MountEntry const * DB2Manager::GetMount ( uint32  spellId) const
742 {
743  auto itr = _mountsBySpellId.find(spellId);
744  if (itr != _mountsBySpellId.end())
745  return itr->second;
746 
747  return nullptr;
748 }
MountContainer _mountsBySpellId
Definition: DB2Stores.h:212
MountEntry const * DB2Manager::GetMountById ( uint32  id) const
751 {
752  return sMountStore.LookupEntry(id);
753 }
DB2Storage< MountEntry > sMountStore("Mount.db2", MountFormat, HOTFIX_SEL_MOUNT)
DB2Manager::MountTypeXCapabilitySet const * DB2Manager::GetMountCapabilities ( uint32  mountType) const
756 {
757  auto itr = _mountCapabilitiesByType.find(mountType);
758  if (itr != _mountCapabilitiesByType.end())
759  return &itr->second;
760 
761  return nullptr;
762 }
MountCapabilitiesByTypeContainer _mountCapabilitiesByType
Definition: DB2Stores.h:213
std::string DB2Manager::GetNameGenEntry ( uint8  race,
uint8  gender,
LocaleConstant  locale 
) const
725 {
726  ASSERT(gender < GENDER_NONE);
727  auto ritr = _nameGenData.find(race);
728  if (ritr == _nameGenData.end())
729  return "";
730 
731  if (ritr->second[gender].empty())
732  return "";
733 
734  LocalizedString* data = Trinity::Containers::SelectRandomContainerElement(ritr->second[gender])->Name;
735  if (*data->Str[locale] != '\0')
736  return data->Str[locale];
737 
738  return data->Str[sWorld->GetDefaultDbcLocale()];
739 }
NameGenContainer _nameGenData
Definition: DB2Stores.h:214
C::value_type const & SelectRandomContainerElement(C const &container)
Definition: Containers.h:68
Definition: Common.h:146
#define sWorld
Definition: World.h:887
char const * Str[TOTAL_LOCALES]
Definition: Common.h:148
#define ASSERT
Definition: Errors.h:55
Definition: SharedDefines.h:95

+ Here is the call graph for this function:

std::set< uint32 > DB2Manager::GetPhasesForGroup ( uint32  group) const
797 {
798  auto itr = _phasesByGroup.find(group);
799  if (itr != _phasesByGroup.end())
800  return itr->second;
801 
802  return std::set<uint32>();
803 }
PhaseGroupContainer _phasesByGroup
Definition: DB2Stores.h:216
uint32 DB2Manager::GetPowerIndexByClass ( uint32  powerType,
uint32  classId 
) const
636 {
637  return _powersByClass[classId][powerType];
638 }
uint32 _powersByClass[MAX_CLASSES][MAX_POWERS]
Definition: DB2Stores.h:203
std::vector< QuestPackageItemEntry const * > const * DB2Manager::GetQuestPackageItems ( uint32  questPackageID) const
779 {
780  auto itr = _questPackages.find(questPackageID);
781  if (itr != _questPackages.end())
782  return &itr->second;
783 
784  return nullptr;
785 }
QuestPackageItemContainer _questPackages
Definition: DB2Stores.h:217
uint32 DB2Manager::GetQuestUniqueBitFlag ( uint32  questId)
788 {
789  QuestV2Entry const* v2 = sQuestV2Store.LookupEntry(questId);
790  if (!v2)
791  return 0;
792 
793  return v2->UniqueBitFlag;
794 }
uint32 UniqueBitFlag
Definition: DB2Structure.h:1097
DB2Storage< QuestV2Entry > sQuestV2Store("QuestV2.db2", QuestV2Format, HOTFIX_SEL_QUEST_V2)
Definition: DB2Structure.h:1094
std::vector< SpecializationSpellsEntry const * > const * DB2Manager::GetSpecializationSpells ( uint32  specId) const
806 {
807  auto itr = _specializationSpellsBySpec.find(specId);
808  if (itr != _specializationSpellsBySpec.end())
809  return &itr->second;
810 
811  return nullptr;
812 }
SpecializationSpellsContainer _specializationSpellsBySpec
Definition: DB2Stores.h:218
std::vector< SpellPowerEntry const * > DB2Manager::GetSpellPowers ( uint32  spellId,
Difficulty  difficulty = DIFFICULTY_NONE,
bool hasDifficultyPowers = nullptr 
) const
815 {
816  std::vector<SpellPowerEntry const*> powers;
817 
818  auto difficultyItr = _spellPowerDifficulties.find(spellId);
819  if (difficultyItr != _spellPowerDifficulties.end())
820  {
821  if (hasDifficultyPowers)
822  *hasDifficultyPowers = true;
823 
824  DifficultyEntry const* difficultyEntry = sDifficultyStore.LookupEntry(difficulty);
825  while (difficultyEntry)
826  {
827  auto powerDifficultyItr = difficultyItr->second.find(difficultyEntry->ID);
828  if (powerDifficultyItr != difficultyItr->second.end())
829  {
830  if (powerDifficultyItr->second.size() > powers.size())
831  powers.resize(powerDifficultyItr->second.size());
832 
833  for (SpellPowerEntry const* difficultyPower : powerDifficultyItr->second)
834  if (!powers[difficultyPower->PowerIndex])
835  powers[difficultyPower->PowerIndex] = difficultyPower;
836  }
837 
838  difficultyEntry = sDifficultyStore.LookupEntry(difficultyEntry->FallbackDifficultyID);
839  }
840  }
841 
842  auto itr = _spellPowers.find(spellId);
843  if (itr != _spellPowers.end())
844  {
845  if (itr->second.size() > powers.size())
846  powers.resize(itr->second.size());
847 
848  for (SpellPowerEntry const* power : itr->second)
849  if (!powers[power->PowerIndex])
850  powers[power->PowerIndex] = power;
851  }
852 
853  return powers;
854 }
uint32 FallbackDifficultyID
Definition: DBCStructure.h:341
uint32 ID
Definition: DBCStructure.h:340
SpellPowerContainer _spellPowers
Definition: DB2Stores.h:219
Definition: DB2Structure.h:1238
uint32 PowerIndex
Definition: DB2Structure.h:1242
DBCStorage< DifficultyEntry > sDifficultyStore(DifficultyFmt)
SpellPowerDifficultyContainer _spellPowerDifficulties
Definition: DB2Stores.h:220
Definition: DBCStructure.h:338
DB2StorageBase const * DB2Manager::GetStorage ( uint32  type) const
543 {
544  StorageMap::const_iterator itr = _stores.find(type);
545  if (itr != _stores.end())
546  return itr->second;
547 
548  return nullptr;
549 }
StorageMap _stores
Definition: DB2Stores.h:198
DB2Manager & DB2Manager::Instance ( )
static
191 {
192  static DB2Manager instance;
193  return instance;
194 }
Definition: DB2Stores.h:134
bool DB2Manager::IsToyItem ( uint32  toy) const
857 {
858  return _toys.count(toy) > 0;
859 }
ToyItemIdsContainer _toys
Definition: DB2Stores.h:221
void DB2Manager::LoadHotfixData ( )
552 {
553  uint32 oldMSTime = getMSTime();
554 
555  QueryResult result = HotfixDatabase.Query("SELECT TableHash, RecordID, `Timestamp`, Deleted FROM hotfix_data");
556 
557  if (!result)
558  {
559  TC_LOG_INFO("misc", ">> Loaded 0 hotfix info entries.");
560  return;
561  }
562 
563  uint32 count = 0;
564 
565  _hotfixData.reserve(result->GetRowCount());
566 
567  do
568  {
569  Field* fields = result->Fetch();
570 
571  HotfixNotify info;
572  info.TableHash = fields[0].GetUInt32();
573  info.Entry = fields[1].GetUInt32();
574  info.Timestamp = fields[2].GetUInt32();
575  _hotfixData.push_back(info);
576 
577  if (fields[3].GetBool())
578  {
579  auto itr = _stores.find(info.TableHash);
580  if (itr != _stores.end())
581  itr->second->EraseRecord(info.Entry);
582  }
583 
584  ++count;
585  } while (result->NextRow());
586 
587  TC_LOG_INFO("misc", ">> Loaded %u hotfix info entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
588 }
Definition: DB2Stores.h:118
uint32 Entry
Definition: DB2Stores.h:122
Class used to access individual fields of database query result.
Definition: Field.h:56
uint32 getMSTime()
Definition: Timer.h:24
uint32 Timestamp
Definition: DB2Stores.h:121
StorageMap _stores
Definition: DB2Stores.h:198
uint32_t uint32
Definition: Define.h:150
std::shared_ptr< ResultSet > QueryResult
Definition: QueryResult.h:61
HotfixDatabaseWorkerPool HotfixDatabase
Accessor to the hotfix database.
Definition: DatabaseEnv.cpp:23
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:42
QueryResult Query(const char *sql, T *connection=nullptr)
Definition: DatabaseWorkerPool.cpp:113
uint32 TableHash
Definition: DB2Stores.h:120
uint32 GetUInt32() const
Definition: Field.h:146
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:201
HotfixData _hotfixData
Definition: DB2Stores.h:199

+ Here is the call graph for this function:

void DB2Manager::LoadStores ( std::string const dataPath,
uint32  defaultLocale 
)
197 {
198  uint32 oldMSTime = getMSTime();
199 
200  std::string db2Path = dataPath + "dbc/";
201 
202  DB2StoreProblemList bad_db2_files;
203  uint32 availableDb2Locales = 0xFF;
204 
205 #define LOAD_DB2(store) LoadDB2(availableDb2Locales, bad_db2_files, _stores, &store, db2Path, defaultLocale)
206 
313 
314 #undef LOAD_DB2
315 
316  for (AreaGroupMemberEntry const* areaGroupMember : sAreaGroupMemberStore)
317  _areaGroupMembers[areaGroupMember->AreaGroupID].push_back(areaGroupMember->AreaID);
318 
319  for (CharStartOutfitEntry const* outfit : sCharStartOutfitStore)
320  _charStartOutfits[outfit->RaceID | (outfit->ClassID << 8) | (outfit->GenderID << 16)] = outfit;
321 
322  sChrClassesXPowerTypesStore.Sort(&ChrClassesXPowerTypesEntryComparator::Compare);
323  for (uint32 i = 0; i < MAX_CLASSES; ++i)
324  for (uint32 j = 0; j < MAX_POWERS; ++j)
325  _powersByClass[i][j] = MAX_POWERS;
326 
328  {
329  uint32 index = 0;
330  for (uint32 j = 0; j < MAX_POWERS; ++j)
331  if (_powersByClass[power->ClassID][j] != MAX_POWERS)
332  ++index;
333 
334  _powersByClass[power->ClassID][power->PowerType] = index;
335  }
336 
337  for (GlyphSlotEntry const* glyphSlot : sGlyphSlotStore)
338  if (glyphSlot->Type == GLYPH_SLOT_MAJOR || glyphSlot->Type == GLYPH_SLOT_MINOR)
339  _glyphSlots.insert(glyphSlot);
340 
341  for (ItemBonusEntry const* bonus : sItemBonusStore)
342  _itemBonusLists[bonus->BonusListID].push_back(bonus);
343 
344  for (ItemBonusTreeNodeEntry const* bonusTreeNode : sItemBonusTreeNodeStore)
345  {
346  uint32 bonusTreeId = bonusTreeNode->BonusTreeID;
347  while (bonusTreeNode)
348  {
349  _itemBonusTrees[bonusTreeId].insert(bonusTreeNode);
350  bonusTreeNode = sItemBonusTreeNodeStore.LookupEntry(bonusTreeNode->SubTreeID);
351  }
352  }
353 
354  for (ItemModifiedAppearanceEntry const* appearanceMod : sItemModifiedAppearanceStore)
355  if (ItemAppearanceEntry const* appearance = sItemAppearanceStore.LookupEntry(appearanceMod->AppearanceID))
356  _itemDisplayIDs[appearanceMod->ItemID | (appearanceMod->AppearanceModID << 24)] = appearance->DisplayID;
357 
358  for (ItemSpecOverrideEntry const* entry : sItemSpecOverrideStore)
359  _itemSpecOverrides[entry->ItemID].push_back(entry);
360 
361  for (ItemXBonusTreeEntry const* itemBonusTreeAssignment : sItemXBonusTreeStore)
362  _itemToBonusTree.insert({ itemBonusTreeAssignment->ItemID, itemBonusTreeAssignment->BonusTreeID });
363 
364  {
365  std::set<uint32> scalingCurves;
367  scalingCurves.insert(ssd->ItemLevelCurveID);
368 
369  for (CurvePointEntry const* curvePoint : sCurvePointStore)
370  if (scalingCurves.count(curvePoint->CurveID))
371  _heirloomCurvePoints[curvePoint->CurveID][curvePoint->Index] = curvePoint;
372  }
373 
374  for (MountEntry const* mount : sMountStore)
375  _mountsBySpellId[mount->SpellId] = mount;
376 
378  _mountCapabilitiesByType[mount->MountTypeID].insert(mount);
379 
380  for (NameGenEntry const* entry : sNameGenStore)
381  _nameGenData[entry->Race][entry->Sex].push_back(entry);
382 
383  for (NamesProfanityEntry const* namesProfanity : sNamesProfanityStore)
384  {
385  ASSERT(namesProfanity->Language < TOTAL_LOCALES || namesProfanity->Language == -1);
386  if (namesProfanity->Language != -1)
387  _nameValidators[namesProfanity->Language].emplace_back(namesProfanity->Name, boost::regex::perl | boost::regex::icase | boost::regex::optimize);
388  else
389  {
390  for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
391  {
392  if (i == LOCALE_none)
393  continue;
394 
395  _nameValidators[i].emplace_back(namesProfanity->Name, boost::regex::perl | boost::regex::icase | boost::regex::optimize);
396  }
397  }
398  }
399 
400  for (NamesReservedEntry const* namesReserved : sNamesReservedStore)
401  _nameValidators[TOTAL_LOCALES].emplace_back(namesReserved->Name, boost::regex::perl | boost::regex::icase | boost::regex::optimize);
402 
403  for (NamesReservedLocaleEntry const* namesReserved : sNamesReservedLocaleStore)
404  {
405  ASSERT(!(namesReserved->LocaleMask & ~((1 << TOTAL_LOCALES) - 1)));
406  for (uint32 i = 0; i < TOTAL_LOCALES; ++i)
407  {
408  if (i == LOCALE_none)
409  continue;
410 
411  if (namesReserved->LocaleMask & (1 << i))
412  _nameValidators[i].emplace_back(namesReserved->Name, boost::regex::perl | boost::regex::icase | boost::regex::optimize);
413  }
414  }
415 
416  for (PhaseXPhaseGroupEntry const* group : sPhaseXPhaseGroupStore)
417  if (PhaseEntry const* phase = sPhaseStore.LookupEntry(group->PhaseID))
418  _phasesByGroup[group->PhaseGroupID].insert(phase->ID);
419 
420  for (QuestPackageItemEntry const* questPackageItem : sQuestPackageItemStore)
421  _questPackages[questPackageItem->QuestPackageID].push_back(questPackageItem);
422 
423  for (SpecializationSpellsEntry const* specSpells : sSpecializationSpellsStore)
424  _specializationSpellsBySpec[specSpells->SpecID].push_back(specSpells);
425 
426  for (SpellPowerEntry const* power : sSpellPowerStore)
427  {
428  if (SpellPowerDifficultyEntry const* powerDifficulty = sSpellPowerDifficultyStore.LookupEntry(power->ID))
429  {
430  std::vector<SpellPowerEntry const*>& powers = _spellPowerDifficulties[power->SpellID][powerDifficulty->DifficultyID];
431  if (powers.size() <= powerDifficulty->PowerIndex)
432  powers.resize(powerDifficulty->PowerIndex + 1);
433 
434  powers[powerDifficulty->PowerIndex] = power;
435  }
436  else
437  {
438  std::vector<SpellPowerEntry const*>& powers = _spellPowers[power->SpellID];
439  if (powers.size() <= power->PowerIndex)
440  powers.resize(power->PowerIndex + 1);
441 
442  powers[power->PowerIndex] = power;
443  }
444  }
445 
446  for (TaxiPathEntry const* entry : sTaxiPathStore)
447  sTaxiPathSetBySource[entry->From][entry->To] = TaxiPathBySourceAndDestination(entry->ID, entry->Cost);
448 
449  uint32 pathCount = sTaxiPathStore.GetNumRows();
450 
451  // Calculate path nodes count
452  std::vector<uint32> pathLength;
453  pathLength.resize(pathCount); // 0 and some other indexes not used
454  for (TaxiPathNodeEntry const* entry : sTaxiPathNodeStore)
455  if (pathLength[entry->PathID] < entry->NodeIndex + 1)
456  pathLength[entry->PathID] = entry->NodeIndex + 1;
457 
458  // Set path length
459  sTaxiPathNodesByPath.resize(pathCount); // 0 and some other indexes not used
460  for (uint32 i = 0; i < sTaxiPathNodesByPath.size(); ++i)
461  sTaxiPathNodesByPath[i].resize(pathLength[i]);
462 
463  // fill data
464  for (TaxiPathNodeEntry const* entry : sTaxiPathNodeStore)
465  sTaxiPathNodesByPath[entry->PathID][entry->NodeIndex] = entry;
466 
467  // Initialize global taxinodes mask
468  // include existed nodes that have at least single not spell base (scripted) path
469  {
470  if (sTaxiNodesStore.GetNumRows())
471  {
472  ASSERT(TaxiMaskSize >= ((sTaxiNodesStore.GetNumRows() - 1) / 8) + 1,
473  "TaxiMaskSize is not large enough to contain all taxi nodes! (current value %d, required %d)",
474  TaxiMaskSize, (((sTaxiNodesStore.GetNumRows() - 1) / 8) + 1));
475  }
476 
477  sTaxiNodesMask.fill(0);
478  sOldContinentsNodesMask.fill(0);
479  sHordeTaxiNodesMask.fill(0);
480  sAllianceTaxiNodesMask.fill(0);
481  for (TaxiNodesEntry const* node : sTaxiNodesStore)
482  {
483  if (!(node->Flags & (TAXI_NODE_FLAG_ALLIANCE | TAXI_NODE_FLAG_HORDE)))
484  continue;
485 
486  // valid taxi network node
487  uint8 field = (uint8)((node->ID - 1) / 8);
488  uint32 submask = 1 << ((node->ID - 1) % 8);
489 
490  sTaxiNodesMask[field] |= submask;
491  if (node->Flags & TAXI_NODE_FLAG_HORDE)
492  sHordeTaxiNodesMask[field] |= submask;
493  if (node->Flags & TAXI_NODE_FLAG_ALLIANCE)
494  sAllianceTaxiNodesMask[field] |= submask;
495 
496  uint32 nodeMap;
497  DeterminaAlternateMapPosition(node->MapID, node->Pos.X, node->Pos.Y, node->Pos.Z, &nodeMap);
498  if (nodeMap < 2)
499  sOldContinentsNodesMask[field] |= submask;
500  }
501  }
502 
504  sTransportMgr->AddPathNodeToTransport(anim->TransportID, anim->TimeIndex, anim);
505 
507  sTransportMgr->AddPathRotationToTransport(rot->TransportID, rot->TimeIndex, rot);
508 
509  for (ToyEntry const* toy : sToyStore)
510  _toys.insert(toy->ItemID);
511 
512  for (HeirloomEntry const* heirloom : sHeirloomStore)
513  _heirlooms[heirloom->ItemID] = heirloom;
514 
515  // error checks
516  if (bad_db2_files.size() >= DB2FilesCount)
517  {
518  TC_LOG_ERROR("misc", "\nIncorrect DataDir value in worldserver.conf or ALL required *.db2 files (%d) not found by path: %sdbc/%s/", DB2FilesCount, dataPath.c_str(), localeNames[defaultLocale]);
519  exit(1);
520  }
521  else if (!bad_db2_files.empty())
522  {
523  std::string str;
524  for (std::list<std::string>::iterator i = bad_db2_files.begin(); i != bad_db2_files.end(); ++i)
525  str += *i + "\n";
526 
527  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());
528  exit(1);
529  }
530 
531  // Check loaded DB2 files proper version
532  if (!sItemStore.LookupEntry(128706) || // last item added in 6.2.0 (20216)
533  !sItemExtendedCostStore.LookupEntry(5923) ) // last item extended cost added in 6.2.0 (20216)
534  {
535  TC_LOG_ERROR("misc", "You have _outdated_ DB2 files. Please extract correct versions from current using client.");
536  exit(1);
537  }
538 
539  TC_LOG_INFO("server.loading", ">> Initialized %d DB2 data stores in %u ms", DB2FilesCount, GetMSTimeDiffToNow(oldMSTime));
540 }
DB2Storage< TransportRotationEntry > sTransportRotationStore("TransportRotation.db2", TransportRotationFormat, HOTFIX_SEL_TRANSPORT_ROTATION)
DB2Storage< ItemAppearanceEntry > sItemAppearanceStore("ItemAppearance.db2", ItemAppearanceFormat, HOTFIX_SEL_ITEM_APPEARANCE)
Definition: DB2Structure.h:46
DB2Storage< UnitPowerBarEntry > sUnitPowerBarStore("UnitPowerBar.db2", UnitPowerBarFormat, HOTFIX_SEL_UNIT_POWER_BAR)
MountCapabilitiesByTypeContainer _mountCapabilitiesByType
Definition: DB2Stores.h:213
AreaGroupMemberContainer _areaGroupMembers
Definition: DB2Stores.h:201
Definition: DB2Structure.h:662
DB2Storage< DurabilityQualityEntry > sDurabilityQualityStore("DurabilityQuality.db2", DurabilityQualityFormat, HOTFIX_SEL_DURABILITY_QUALITY)
PhaseGroupContainer _phasesByGroup
Definition: DB2Stores.h:216
Definition: DB2Structure.h:1136
uint32 DB2FilesCount
Definition: DB2Stores.cpp:143
DB2Storage< AuctionHouseEntry > sAuctionHouseStore("AuctionHouse.db2", AuctionHouseFormat, HOTFIX_SEL_AUCTION_HOUSE)
void DeterminaAlternateMapPosition(uint32 mapId, float x, float y, float z, uint32 *newMapId, DBCPosition2D *newPos)
Definition: DBCStores.cpp:861
DB2Storage< GarrFollowerEntry > sGarrFollowerStore("GarrFollower.db2", GarrFollowerFormat, HOTFIX_SEL_GARR_FOLLOWER)
NameGenContainer _nameGenData
Definition: DB2Stores.h:214
TaxiMask sOldContinentsNodesMask
Definition: DB2Stores.cpp:135
DB2Storage< SpellRadiusEntry > sSpellRadiusStore("SpellRadius.db2", SpellRadiusFormat, HOTFIX_SEL_SPELL_RADIUS)
DB2Storage< ItemBonusEntry > sItemBonusStore("ItemBonus.db2", ItemBonusFormat, HOTFIX_SEL_ITEM_BONUS)
DB2Storage< SpecializationSpellsEntry > sSpecializationSpellsStore("SpecializationSpells.db2", SpecializationSpellsFormat, HOTFIX_SEL_SPECIALIZATION_SPELLS)
MountContainer _mountsBySpellId
Definition: DB2Stores.h:212
DB2Storage< QuestPackageItemEntry > sQuestPackageItemStore("QuestPackageItem.db2", QuestPackageItemfmt, HOTFIX_SEL_QUEST_PACKAGE_ITEM)
Definition: DB2Structure.h:985
DB2Storage< CharStartOutfitEntry > sCharStartOutfitStore("CharStartOutfit.db2", CharStartOutfitFormat, HOTFIX_SEL_CHAR_START_OUTFIT)
DB2Storage< GarrBuildingEntry > sGarrBuildingStore("GarrBuilding.db2", GarrBuildingFormat, HOTFIX_SEL_GARR_BUILDING)
Definition: Common.h:126
#define TaxiMaskSize
Definition: DB2Structure.h:1452
DB2Storage< SpellClassOptionsEntry > sSpellClassOptionsStore("SpellClassOptions.db2", SpellClassOptionsFormat, HOTFIX_SEL_SPELL_CLASS_OPTIONS)
DB2Storage< NamesProfanityEntry > sNamesProfanityStore("NamesProfanity.db2", NamesProfanityFormat, HOTFIX_SEL_NAMES_PROFANITY)
ItemDisplayIdContainer _itemDisplayIDs
Definition: DB2Stores.h:209
DB2Storage< GarrBuildingPlotInstEntry > sGarrBuildingPlotInstStore("GarrBuildingPlotInst.db2", GarrBuildingPlotInstFormat, HOTFIX_SEL_GARR_BUILDING_PLOT_INST)
Definition: DBCEnums.h:696
DB2Storage< ItemRandomSuffixEntry > sItemRandomSuffixStore("ItemRandomSuffix.db2", ItemRandomSuffixFormat, HOTFIX_SEL_ITEM_RANDOM_SUFFIX)
DB2Storage< CurrencyTypesEntry > sCurrencyTypesStore("CurrencyTypes.db2", CurrencyTypesFormat, HOTFIX_SEL_CURRENCY_TYPES)
DB2Storage< BroadcastTextEntry > sBroadcastTextStore("BroadcastText.db2", BroadcastTextFormat, HOTFIX_SEL_BROADCAST_TEXT)
DB2Storage< ItemSpecEntry > sItemSpecStore("ItemSpec.db2", ItemSpecFormat, HOTFIX_SEL_ITEM_SPEC)
DB2Storage< ItemClassEntry > sItemClassStore("ItemClass.db2", ItemClassFormat, HOTFIX_SEL_ITEM_CLASS)
TaxiMask sTaxiNodesMask
Definition: DB2Stores.cpp:134
DB2Storage< ChrClassesXPowerTypesEntry > sChrClassesXPowerTypesStore("ChrClassesXPowerTypes.db2", ChrClassesXPowerTypesFormat, HOTFIX_SEL_CHR_CLASSES_X_POWER_TYPES)
Definition: DB2Structure.h:127
DB2Storage< GarrPlotInstanceEntry > sGarrPlotInstanceStore("GarrPlotInstance.db2", GarrPlotInstanceFormat, HOTFIX_SEL_GARR_PLOT_INSTANCE)
Definition: DB2Structure.h:751
DB2Storage< GameObjectsEntry > sGameObjectsStore("GameObjects.db2", GameObjectsFormat, HOTFIX_SEL_GAMEOBJECTS)
DB2Storage< CriteriaEntry > sCriteriaStore("Criteria.db2", CriteriaFormat, HOTFIX_SEL_CRITERIA)
DB2Storage< GarrSiteLevelEntry > sGarrSiteLevelStore("GarrSiteLevel.db2", GarrSiteLevelFormat, HOTFIX_SEL_GARR_SITE_LEVEL)
DB2Storage< ItemCurrencyCostEntry > sItemCurrencyCostStore("ItemCurrencyCost.db2", ItemCurrencyCostFormat, HOTFIX_SEL_ITEM_CURRENCY_COST)
uint32 getMSTime()
Definition: Timer.h:24
TaxiMask sHordeTaxiNodesMask
Definition: DB2Stores.cpp:136
DB2Storage< GarrAbilityEntry > sGarrAbilityStore("GarrAbility.db2", GarrAbilityFormat, HOTFIX_SEL_GARR_ABILITY)
DB2Storage< QuestSortEntry > sQuestSortStore("QuestSort.db2", QuestSortFormat, HOTFIX_SEL_QUEST_SORT)
#define sTransportMgr
Definition: TransportMgr.h:162
DB2Storage< GarrPlotBuildingEntry > sGarrPlotBuildingStore("GarrPlotBuilding.db2", GarrPlotBuildingFormat, HOTFIX_SEL_GARR_PLOT_BUILDING)
DB2Storage< BattlePetSpeciesEntry > sBattlePetSpeciesStore("BattlePetSpecies.db2", BattlePetSpeciesFormat, HOTFIX_SEL_BATTLE_PET_SPECIES)
DB2Storage< OverrideSpellDataEntry > sOverrideSpellDataStore("OverrideSpellData.db2", OverrideSpellDataFormat, HOTFIX_SEL_OVERRIDE_SPELL_DATA)
Definition: DB2Structure.h:586
DB2Storage< ImportPriceArmorEntry > sImportPriceArmorStore("ImportPriceArmor.db2", ImportPriceArmorFormat, HOTFIX_SEL_IMPORT_PRICE_ARMOR)
DB2Storage< MountTypeXCapabilityEntry > sMountTypeXCapabilityStore("MountTypeXCapability.db2", MountTypeXCapabilityFormat, HOTFIX_SEL_MOUNT_TYPE_X_CAPABILITY)
Definition: DB2Structure.h:1106
Definition: DB2Structure.h:646
DB2Storage< TaxiPathNodeEntry > sTaxiPathNodeStore("TaxiPathNode.db2", TaxiPathNodeFormat, HOTFIX_SEL_TAXI_PATH_NODE)
Definition: DB2Structure.h:345
TaxiPathNodesByPath sTaxiPathNodesByPath
Definition: DB2Stores.cpp:139
Definition: DB2Structure.h:1079
DB2Storage< SpellRuneCostEntry > sSpellRuneCostStore("SpellRuneCost.db2", SpellRuneCostFormat, HOTFIX_SEL_SPELL_RUNE_COST)
DB2Storage< ItemBonusTreeNodeEntry > sItemBonusTreeNodeStore("ItemBonusTreeNode.db2", ItemBonusTreeNodeFormat, HOTFIX_SEL_ITEM_BONUS_TREE_NODE)
DB2Storage< NamesReservedEntry > sNamesReservedStore("NamesReserved.db2", NamesReservedFormat, HOTFIX_SEL_NAMES_RESERVED)
DB2Storage< QuestV2Entry > sQuestV2Store("QuestV2.db2", QuestV2Format, HOTFIX_SEL_QUEST_V2)
DB2Storage< ImportPriceQualityEntry > sImportPriceQualityStore("ImportPriceQuality.db2", ImportPriceQualityFormat, HOTFIX_SEL_IMPORT_PRICE_QUALITY)
DB2Storage< MountEntry > sMountStore("Mount.db2", MountFormat, HOTFIX_SEL_MOUNT)
DB2Storage< ImportPriceShieldEntry > sImportPriceShieldStore("ImportPriceShield.db2", ImportPriceShieldFormat, HOTFIX_SEL_IMPORT_PRICE_SHIELD)
HeirloomItemsContainer _heirlooms
Definition: DB2Stores.h:205
SpellPowerContainer _spellPowers
Definition: DB2Stores.h:219
Definition: DB2Structure.h:962
Definition: DB2Structure.h:869
DB2Storage< ItemXBonusTreeEntry > sItemXBonusTreeStore("ItemXBonusTree.db2", ItemXBonusTreeFormat, HOTFIX_SEL_ITEM_X_BONUS_TREE)
DB2Storage< GlyphSlotEntry > sGlyphSlotStore("GlyphSlot.db2", GlyphSlotFormat, HOTFIX_SEL_GLYPH_SLOT)
DB2Storage< ItemExtendedCostEntry > sItemExtendedCostStore("ItemExtendedCost.db2", ItemExtendedCostFormat, HOTFIX_SEL_ITEM_EXTENDED_COST)
Definition: DB2Structure.h:1238
DB2Storage< TotemCategoryEntry > sTotemCategoryStore("TotemCategory.db2", TotemCategoryFormat, HOTFIX_SEL_TOTEM_CATEGORY)
DB2Storage< MailTemplateEntry > sMailTemplateStore("MailTemplate.db2", MailTemplateFormat, HOTFIX_SEL_MAIL_TEMPLATE)
Definition: DB2Structure.h:572
ItemToBonusTreeContainer _itemToBonusTree
Definition: DB2Stores.h:210
Definition: DB2Structure.h:139
DB2Storage< SpellCastTimesEntry > sSpellCastTimesStore("SpellCastTimes.db2", SpellCastTimesFormat, HOTFIX_SEL_SPELL_CAST_TIMES)
DB2Storage< GarrClassSpecEntry > sGarrClassSpecStore("GarrClassSpec.db2", GarrClassSpecFormat, HOTFIX_SEL_GARR_CLASS_SPEC)
DB2Storage< HolidaysEntry > sHolidaysStore("Holidays.db2", HolidaysEntryFormat, HOTFIX_SEL_HOLIDAYS)
DB2Storage< PlayerConditionEntry > sPlayerConditionStore("PlayerCondition.db2", PlayerConditionFormat, HOTFIX_SEL_PLAYER_CONDITION)
DB2Storage< ImportPriceWeaponEntry > sImportPriceWeaponStore("ImportPriceWeapon.db2", ImportPriceWeaponFormat, HOTFIX_SEL_IMPORT_PRICE_WEAPON)
DB2Storage< ItemModifiedAppearanceEntry > sItemModifiedAppearanceStore("ItemModifiedAppearance.db2", ItemModifiedAppearanceFormat, HOTFIX_SEL_ITEM_MODIFIED_APPEARANCE)
DB2Storage< GarrFollowerXAbilityEntry > sGarrFollowerXAbilityStore("GarrFollowerXAbility.db2", GarrFollowerXAbilityFormat, HOTFIX_SEL_GARR_FOLLOWER_X_ABILITY)
DB2Storage< PhaseXPhaseGroupEntry > sPhaseXPhaseGroupStore("PhaseXPhaseGroup.db2", PhaseXPhaseGroupFormat, HOTFIX_SEL_PHASE_X_PHASE_GROUP)
DB2Storage< CurvePointEntry > sCurvePointStore("CurvePoint.db2", CurvePointFormat, HOTFIX_SEL_CURVE_POINT)
SpecializationSpellsContainer _specializationSpellsBySpec
Definition: DB2Stores.h:218
DB2Storage< QuestMoneyRewardEntry > sQuestMoneyRewardStore("QuestMoneyReward.db2", QuestMoneyRewardFormat, HOTFIX_SEL_QUEST_MONEY_REWARD)
CharStartOutfitContainer _charStartOutfits
Definition: DB2Stores.h:202
TaxiMask sAllianceTaxiNodesMask
Definition: DB2Stores.cpp:137
Definition: DBCEnums.h:695
DB2Storage< ItemEntry > sItemStore("Item.db2", ItemFormat, HOTFIX_SEL_ITEM)
DB2Storage< TaxiPathEntry > sTaxiPathStore("TaxiPath.db2", TaxiPathFormat, HOTFIX_SEL_TAXI_PATH)
ItemSpecOverridesContainer _itemSpecOverrides
Definition: DB2Stores.h:211
GlyphSlotContainer _glyphSlots
Definition: DB2Stores.h:204
DB2Storage< SpellMiscEntry > sSpellMiscStore("SpellMisc.db2", SpellMiscFormat, HOTFIX_SEL_SPELL_MISC)
Definition: DB2Structure.h:968
DB2Storage< AchievementEntry > sAchievementStore("Achievement.db2", AchievementFormat, HOTFIX_SEL_ACHIEVEMENT)
Definition: DB2Structure.h:1375
DB2Storage< DestructibleModelDataEntry > sDestructibleModelDataStore("DestructibleModelData.db2", DestructibleModelDataFormat, HOTFIX_SEL_DESTRUCTIBLE_MODEL_DATA)
NameValidationRegexContainer _nameValidators
Definition: DB2Stores.h:215
uint32_t uint32
Definition: Define.h:150
DB2Storage< CriteriaTreeEntry > sCriteriaTreeStore("CriteriaTree.db2", CriteriaTreeFormat, HOTFIX_SEL_CRITERIA_TREE)
DB2Storage< CreatureDisplayInfoEntry > sCreatureDisplayInfoStore("CreatureDisplayInfo.db2", CreatureDisplayInfoFormat, HOTFIX_SEL_CREATURE_DISPLAY_INFO)
DB2Storage< CinematicSequencesEntry > sCinematicSequencesStore("CinematicSequences.db2", CinematicSequencesFormat, HOTFIX_SEL_CINEMATIC_SEQUENCES)
DB2Storage< GarrSiteLevelPlotInstEntry > sGarrSiteLevelPlotInstStore("GarrSiteLevelPlotInst.db2", GarrSiteLevelPlotInstFormat, HOTFIX_SEL_GARR_SITE_LEVEL_PLOT_INST)
DB2Storage< BattlePetSpeciesStateEntry > sBattlePetSpeciesStateStore("BattlePetSpeciesState.db2", BattlePetSpeciesStateFormat, HOTFIX_SEL_BATTLE_PET_SPECIES_STATE)
DBCStorage< PhaseEntry > sPhaseStore(Phasefmt)
Definition: DB2Structure.h:882
DB2Storage< NamesReservedLocaleEntry > sNamesReservedLocaleStore("NamesReservedLocale.db2", NamesReservedLocaleFormat, HOTFIX_SEL_NAMES_RESERVED_LOCALE)
Definition: DB2Structure.h:653
DB2Storage< GarrPlotEntry > sGarrPlotStore("GarrPlot.db2", GarrPlotFormat, HOTFIX_SEL_GARR_PLOT)
DB2Storage< SpellTotemsEntry > sSpellTotemsStore("SpellTotems.db2", SpellTotemsFormat, HOTFIX_SEL_SPELL_TOTEMS)
Definition: DB2Structure.h:1345
DB2Storage< ItemSparseEntry > sItemSparseStore("Item-sparse.db2", ItemSparseFormat, HOTFIX_SEL_ITEM_SPARSE)
DB2Storage< GuildPerkSpellsEntry > sGuildPerkSpellsStore("GuildPerkSpells.db2", GuildPerkSpellsFormat, HOTFIX_SEL_GUILD_PERK_SPELLS)
#define MAX_CLASSES
Definition: SharedDefines.h:181
Definition: DB2Structure.h:1384
QuestPackageItemContainer _questPackages
Definition: DB2Stores.h:217
Definition: DBCStructure.h:824
Definition: DBCEnums.h:503
ToyItemIdsContainer _toys
Definition: DB2Stores.h:221
DB2Storage< SpellXSpellVisualEntry > sSpellXSpellVisualStore("SpellXSpellVisual.db2", SpellXSpellVisualFormat, HOTFIX_SEL_SPELL_X_SPELL_VISUAL)
uint8_t uint8
Definition: g3dmath.h:164
DB2Storage< QuestXPEntry > sQuestXPStore("QuestXP.db2", QuestXPFormat, HOTFIX_SEL_QUEST_XP)
DB2Storage< SpellLearnSpellEntry > sSpellLearnSpellStore("SpellLearnSpell.db2", SpellLearnSpellFormat, HOTFIX_SEL_SPELL_LEARN_SPELL)
DB2Storage< ItemPriceBaseEntry > sItemPriceBaseStore("ItemPriceBase.db2", ItemPriceBaseFormat, HOTFIX_SEL_ITEM_PRICE_BASE)
DB2Storage< GameTablesEntry > sGameTablesStore("GameTables.db2", GameTablesFormat, HOTFIX_SEL_GAME_TABLES)
TC_COMMON_API char const * localeNames[TOTAL_LOCALES]
Definition: Common.cpp:21
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:42
DB2Storage< SpellItemEnchantmentConditionEntry > sSpellItemEnchantmentConditionStore("SpellItemEnchantmentCondition.db2", SpellItemEnchantmentConditionFormat, HOTFIX_SEL_SPELL_ITEM_ENCHANTMENT_CONDITION)
DB2Storage< SpellAuraRestrictionsEntry > sSpellAuraRestrictionsStore("SpellAuraRestrictions.db2", SpellAuraRestrictionsFormat, HOTFIX_SEL_SPELL_AURA_RESTRICTIONS)
DB2Storage< ItemRandomPropertiesEntry > sItemRandomPropertiesStore("ItemRandomProperties.db2", ItemRandomPropertiesFormat, HOTFIX_SEL_ITEM_RANDOM_PROPERTIES)
Definition: DB2Structure.h:1337
HeirloomCurvesContainer _heirloomCurvePoints
Definition: DB2Stores.h:206
DB2Storage< ItemLimitCategoryEntry > sItemLimitCategoryStore("ItemLimitCategory.db2", ItemLimitCategoryFormat, HOTFIX_SEL_ITEM_LIMIT_CATEGORY)
ItemBonusTreeContainer _itemBonusTrees
Definition: DB2Stores.h:208
DB2Storage< ItemToBattlePetSpeciesEntry > sItemToBattlePetSpeciesStore("ItemToBattlePetSpecies.db2", ItemToBattlePetSpeciesFormat, HOTFIX_SEL_ITEM_TO_BATTLE_PET_SPECIES)
DB2Storage< SpellReagentsEntry > sSpellReagentsStore("SpellReagents.db2", SpellReagentsFormat, HOTFIX_SEL_SPELL_REAGENTS)
DB2Storage< SpellDurationEntry > sSpellDurationStore("SpellDuration.db2", SpellDurationFormat, HOTFIX_SEL_SPELL_DURATION)
DB2Storage< SpellPowerDifficultyEntry > sSpellPowerDifficultyStore("SpellPowerDifficulty.db2", SpellPowerDifficultyFormat, HOTFIX_SEL_SPELL_POWER_DIFFICULTY)
DB2Storage< AreaGroupMemberEntry > sAreaGroupMemberStore("AreaGroupMember.db2", AreaGroupMemberFormat, HOTFIX_SEL_AREA_GROUP_MEMBER)
DB2Storage< CreatureTypeEntry > sCreatureTypeStore("CreatureType.db2", CreatureTypeFormat, HOTFIX_SEL_CREATURE_TYPE)
Definition: DB2Structure.h:1324
DB2Storage< SpellRangeEntry > sSpellRangeStore("SpellRange.db2", SpellRangeFormat, HOTFIX_SEL_SPELL_RANGE)
Definition: DB2Structure.h:1257
TaxiPathSetBySource sTaxiPathSetBySource
Definition: DB2Stores.cpp:138
uint8_t uint8
Definition: Define.h:152
Definition: DB2Structure.h:955
Definition: SharedDefines.h:265
#define ASSERT
Definition: Errors.h:55
DB2Storage< ItemEffectEntry > sItemEffectStore("ItemEffect.db2", ItemEffectFormat, HOTFIX_SEL_ITEM_EFFECT)
#define LOAD_DB2(store)
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:201
DB2Storage< ModifierTreeEntry > sModifierTreeStore("ModifierTree.db2", ModifierTreeFormat, HOTFIX_SEL_MODIFIER_TREE)
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: DB2Structure.h:939
DB2Storage< SpellCastingRequirementsEntry > sSpellCastingRequirementsStore("SpellCastingRequirements.db2", SpellCastingRequirementsFormat, HOTFIX_SEL_SPELL_CASTING_REQUIREMENTS)
DB2Storage< KeyChainEntry > sKeyChainStore("KeyChain.db2", KeyChainFormat, HOTFIX_SEL_KEY_CHAIN)
Definition: DBCEnums.h:502
DB2Storage< SpellPowerEntry > sSpellPowerStore("SpellPower.db2", SpellPowerFormat, HOTFIX_SEL_SPELL_POWER)
DB2Storage< BarberShopStyleEntry > sBarberShopStyleStore("BarberShopStyle.db2", BarberShopStyleFormat, HOTFIX_SEL_BARBER_SHOP_STYLE)
Definition: DB2Structure.h:1437
DB2Storage< ScalingStatDistributionEntry > sScalingStatDistributionStore("ScalingStatDistribution.db2", ScalingStatDistributionFormat, HOTFIX_SEL_SCALING_STAT_DISTRIBUTION)
DB2Storage< NameGenEntry > sNameGenStore("NameGen.db2", NameGenFormat, HOTFIX_SEL_NAME_GEN)
DB2Storage< BattlePetBreedStateEntry > sBattlePetBreedStateStore("BattlePetBreedState.db2", BattlePetBreedStateFormat, HOTFIX_SEL_BATTLE_PET_BREED_STATE)
DB2Storage< MountCapabilityEntry > sMountCapabilityStore("MountCapability.db2", MountCapabilityFormat, HOTFIX_SEL_MOUNT_CAPABILITY)
DB2Storage< TaxiNodesEntry > sTaxiNodesStore("TaxiNodes.db2", TaxiNodesFormat, HOTFIX_SEL_TAXI_NODES)
DB2Storage< ToyEntry > sToyStore("Toy.db2", ToyFormat, HOTFIX_SEL_TOY)
DB2Storage< ItemSpecOverrideEntry > sItemSpecOverrideStore("ItemSpecOverride.db2", ItemSpecOverrideFormat, HOTFIX_SEL_ITEM_SPEC_OVERRIDE)
Definition: DB2Structure.h:913
SpellPowerDifficultyContainer _spellPowerDifficulties
Definition: DB2Stores.h:220
Definition: DB2Structure.h:947
Definition: DB2Structure.h:1366
DB2Storage< HeirloomEntry > sHeirloomStore("Heirloom.db2", HeirloomFormat, HOTFIX_SEL_HEIRLOOM)
DB2Storage< SoundEntriesEntry > sSoundEntriesStore("SoundEntries.db2", SoundEntriesFormat, HOTFIX_SEL_SOUND_ENTRIES)
DB2Storage< TransportAnimationEntry > sTransportAnimationStore("TransportAnimation.db2", TransportAnimationFormat, HOTFIX_SEL_TRANSPORT_ANIMATION)
Definition: Common.h:130
std::list< std::string > DB2StoreProblemList
Definition: DB2Stores.cpp:141
DB2Storage< ItemDisenchantLootEntry > sItemDisenchantLootStore("ItemDisenchantLoot.db2", ItemDisenchantLootFormat, HOTFIX_SEL_ITEM_DISENCHANT_LOOT)
DB2Storage< BattlePetBreedQualityEntry > sBattlePetBreedQualityStore("BattlePetBreedQuality.db2", BattlePetBreedQualityFormat, HOTFIX_SEL_BATTLE_PET_BREED_QUALITY)
DB2Storage< WorldMapOverlayEntry > sWorldMapOverlayStore("WorldMapOverlay.db2", WorldMapOverlayFormat, HOTFIX_SEL_WORLD_MAP_OVERLAY)
ItemBonusListContainer _itemBonusLists
Definition: DB2Stores.h:207
uint32 _powersByClass[MAX_CLASSES][MAX_POWERS]
Definition: DB2Stores.h:203

+ Here is the call graph for this function:

ResponseCodes DB2Manager::ValidateName ( std::string const name,
LocaleConstant  locale 
) const
765 {
766  for (boost::regex const& regex : _nameValidators[locale])
767  if (boost::regex_search(name, regex))
768  return CHAR_NAME_PROFANE;
769 
770  // regexes at TOTAL_LOCALES are loaded from NamesReserved which is not locale specific
771  for (boost::regex const& regex : _nameValidators[TOTAL_LOCALES])
772  if (boost::regex_search(name, regex))
773  return CHAR_NAME_RESERVED;
774 
775  return CHAR_NAME_SUCCESS;
776 }
Definition: SharedDefines.h:4512
Definition: SharedDefines.h:4505
Definition: SharedDefines.h:4513
NameValidationRegexContainer _nameValidators
Definition: DB2Stores.h:215
Definition: Common.h:130

Member Data Documentation

AreaGroupMemberContainer DB2Manager::_areaGroupMembers
private
CharStartOutfitContainer DB2Manager::_charStartOutfits
private
GlyphSlotContainer DB2Manager::_glyphSlots
private
HeirloomCurvesContainer DB2Manager::_heirloomCurvePoints
private
HeirloomItemsContainer DB2Manager::_heirlooms
private
HotfixData DB2Manager::_hotfixData
private
ItemBonusListContainer DB2Manager::_itemBonusLists
private
ItemBonusTreeContainer DB2Manager::_itemBonusTrees
private
ItemDisplayIdContainer DB2Manager::_itemDisplayIDs
private
ItemSpecOverridesContainer DB2Manager::_itemSpecOverrides
private
ItemToBonusTreeContainer DB2Manager::_itemToBonusTree
private
MountCapabilitiesByTypeContainer DB2Manager::_mountCapabilitiesByType
private
MountContainer DB2Manager::_mountsBySpellId
private
NameGenContainer DB2Manager::_nameGenData
private
NameValidationRegexContainer DB2Manager::_nameValidators
private
PhaseGroupContainer DB2Manager::_phasesByGroup
private
uint32 DB2Manager::_powersByClass[MAX_CLASSES][MAX_POWERS]
private
QuestPackageItemContainer DB2Manager::_questPackages
private
SpecializationSpellsContainer DB2Manager::_specializationSpellsBySpec
private
SpellPowerDifficultyContainer DB2Manager::_spellPowerDifficulties
private
SpellPowerContainer DB2Manager::_spellPowers
private
StorageMap DB2Manager::_stores
private
ToyItemIdsContainer DB2Manager::_toys
private

The documentation for this class was generated from the following files: