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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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);