feat(Core/Maps): Multithread startup map preloading (#22580)
This commit is contained in:
parent
f31643c72c
commit
57dacae38b
3 changed files with 42 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue