feat(Core/Maps): Multithread startup map preloading (#22580)

This commit is contained in:
Takenbacon
2025-07-29 05:10:46 -07:00
committed by GitHub
parent f31643c72c
commit 57dacae38b
3 changed files with 42 additions and 5 deletions

View File

@@ -1010,15 +1010,23 @@ void World::SetInitialWorldSettings()
if (mapEntry && !mapEntry->Instanceable())
{
Map* map = sMapMgr->CreateBaseMap(mapEntry->MapID);
if (map)
if (sMapMgr->GetMapUpdater()->activated())
sMapMgr->GetMapUpdater()->schedule_map_preload(mapEntry->MapID);
else
{
LOG_INFO("server.loading", ">> Loading All Grids For Map {}", map->GetId());
map->LoadAllGrids();
Map* map = sMapMgr->CreateBaseMap(mapEntry->MapID);
if (map)
{
LOG_INFO("server.loading", ">> Loading All Grids For Map {}", map->GetId());
map->LoadAllGrids();
}
}
}
}
if (sMapMgr->GetMapUpdater()->activated())
sMapMgr->GetMapUpdater()->wait();
}
uint32 startupDuration = GetMSTimeDiffToNow(startupBegin);