Changed NPCTypes Data to bulk load when the zone loads or Repops, this bulk loading is stored in the npc_types cache

This commit is contained in:
Akkadius
2015-02-12 19:57:24 -06:00
parent 16002eb62e
commit 1966324112
12 changed files with 268 additions and 194 deletions
+4 -1
View File
@@ -183,7 +183,7 @@ bool Spawn2::Process() {
}
//try to find our NPC type.
const NPCType* tmp = database.GetNPCType(npcid);
const NPCType* tmp = database.LoadNPCTypesData(npcid);
if (tmp == nullptr) {
Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Spawn group %d yeilded an invalid NPC type %d", spawn2_id, spawngroup_id_, npcid);
Reset(); //try again later
@@ -358,6 +358,9 @@ bool ZoneDatabase::PopulateZoneSpawnList(uint32 zoneid, LinkedList<Spawn2*> &spa
timeval tv;
gettimeofday(&tv, nullptr);
/* Bulk Load NPC Types Data into the cache */
database.LoadNPCTypesData(0, true);
std::string spawn_query = StringFormat(
"SELECT "
"respawn_times.id, "