diff options
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 3b0cb8b736d..dfb84c23113 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8737,7 +8737,7 @@ void ObjectMgr::LoadHotfixData() HotfixInfo info; info.Entry = fields[0].GetUInt32(); - info.Type = fields[1].GetUInt32(); + info.Type = DB2Hash(fields[1].GetUInt32()); info.Timestamp = fields[2].GetUInt64(); _hotfixData.push_back(info); @@ -8748,6 +8748,41 @@ void ObjectMgr::LoadHotfixData() sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u hotfix info entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } +void ObjectMgr::LoadMissingKeyChains() +{ + uint32 oldMSTime = getMSTime(); + + QueryResult result = WorldDatabase.Query("SELECT keyId, k1, k2, k3, k4, k5, k6, k7, k8, " + "k9, k10, k11, k12, k13, k14, k15, k16, " + "k17, k18, k19, k20, k21, k22, k23, k24, " + "k25, k26, k27, k28, k29, k30, k31, k32 " + "FROM keychain_db2 ORDER BY keyId DESC"); + + if (!result) + { + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 KeyChain entries. DB table `keychain_db2` is empty."); + return; + } + + uint32 count = 0; + + do + { + Field* fields = result->Fetch(); + uint32 id = fields[0].GetUInt32();; + + KeyChainEntry* kce = sKeyChainStore.CreateEntry(id, true); + kce->Id = id; + for (uint32 i = 0; i < KEYCHAIN_SIZE; ++i) + kce->Key[i] = fields[1 + i].GetUInt8(); + + ++count; + } + while (result->NextRow()); + + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u KeyChain entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); +} + void ObjectMgr::LoadFactionChangeSpells() { uint32 oldMSTime = getMSTime(); |