mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 07:38:36 +00:00
Bulk load grids at repop and zone init instead of 2 costly individual selects per NPC, create repositories to decouple database logic from business logic
This commit is contained in:
@@ -1023,6 +1023,7 @@ bool Zone::Init(bool iStaticZone) {
|
||||
|
||||
LogInfo("Init Finished: ZoneID = [{}], Time Offset = [{}]", zoneid, zone->zone_time.getEQTimeZone());
|
||||
|
||||
LoadGrids();
|
||||
LoadTickItems();
|
||||
|
||||
//MODDING HOOK FOR ZONE INIT
|
||||
@@ -1610,6 +1611,8 @@ void Zone::Repop(uint32 delay)
|
||||
if (!content_db.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion(), delay))
|
||||
LogDebug("Error in Zone::Repop: database.PopulateZoneSpawnList failed");
|
||||
|
||||
LoadGrids();
|
||||
|
||||
initgrids_timer.Start();
|
||||
|
||||
entity_list.UpdateAllTraps(true, true);
|
||||
@@ -2481,3 +2484,9 @@ void Zone::SetQuestHotReloadQueued(bool in_quest_hot_reload_queued)
|
||||
{
|
||||
quest_hot_reload_queued = in_quest_hot_reload_queued;
|
||||
}
|
||||
|
||||
void Zone::LoadGrids()
|
||||
{
|
||||
grids = GridRepository::GetZoneGrids(GetZoneID());
|
||||
grid_entries = GridEntriesRepository::GetZoneGridEntries(GetZoneID());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user