fix (core) : TransportMgr Load up time (#10388)
* fix (core) : TransportMgr Load up time * white space fix * merge fix * merge fix again * Update TransportMgr.cpp * Update TransportMgr.cpp * Update TransportMgr.cpp * fix conflich with preload grids for continent static transports
This commit is contained in:
@@ -423,13 +423,13 @@ void TransportMgr::SpawnContinentTransports()
|
|||||||
if (_transportTemplates.empty())
|
if (_transportTemplates.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32 oldMSTime, count = 0;
|
uint32 count = 0;
|
||||||
oldMSTime = getMSTime();
|
uint32 oldMSTime = getMSTime();
|
||||||
QueryResult result;
|
QueryResult result = WorldDatabase.Query("SELECT guid, entry FROM transports");
|
||||||
|
|
||||||
if (sWorld->getBoolConfig(CONFIG_ENABLE_CONTINENT_TRANSPORT))
|
if (sWorld->getBoolConfig(CONFIG_ENABLE_CONTINENT_TRANSPORT))
|
||||||
{
|
{
|
||||||
result = WorldDatabase.Query("SELECT guid, entry FROM transports");
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
@@ -442,23 +442,23 @@ void TransportMgr::SpawnContinentTransports()
|
|||||||
if (!tInfo->inInstance)
|
if (!tInfo->inInstance)
|
||||||
if (CreateTransport(entry, guid))
|
if (CreateTransport(entry, guid))
|
||||||
++count;
|
++count;
|
||||||
|
|
||||||
} while (result->NextRow());
|
} while (result->NextRow());
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_INFO("server.loading", ">> Spawned {} continent motion transports in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
|
LOG_INFO("server.loading", ">> Spawned {} continent motion transports in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||||
LOG_INFO("server.loading", " ");
|
}
|
||||||
|
|
||||||
if (sWorld->getBoolConfig(CONFIG_ENABLE_CONTINENT_TRANSPORT_PRELOADING))
|
if (sWorld->getBoolConfig(CONFIG_ENABLE_CONTINENT_TRANSPORT_PRELOADING))
|
||||||
{
|
{
|
||||||
// pussywizard: preload grids for continent static transports
|
// pussywizard: preload grids for continent static transports
|
||||||
oldMSTime = getMSTime();
|
QueryResult result2 = WorldDatabase.Query("SELECT map, position_x, position_y FROM gameobject g JOIN gameobject_template t ON g.id = t.entry WHERE t.type = 11");
|
||||||
result = WorldDatabase.Query("SELECT map, position_x, position_y FROM gameobject g JOIN gameobject_template t ON g.id = t.entry WHERE t.type = 11");
|
|
||||||
count = 0;
|
if (result2)
|
||||||
if (result)
|
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
Field* fields = result->Fetch();
|
Field* fields = result2->Fetch();
|
||||||
uint16 mapId = fields[0].GetUInt16();
|
uint16 mapId = fields[0].GetUInt16();
|
||||||
float x = fields[1].GetFloat();
|
float x = fields[1].GetFloat();
|
||||||
float y = fields[2].GetFloat();
|
float y = fields[2].GetFloat();
|
||||||
@@ -470,12 +470,11 @@ void TransportMgr::SpawnContinentTransports()
|
|||||||
map->LoadGrid(x, y);
|
map->LoadGrid(x, y);
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
} while (result->NextRow());
|
} while (result2->NextRow());
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_INFO("server.loading", ">> Preloaded grids for {} continent static transports in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
|
LOG_INFO("server.loading", ">> Preloaded grids for {} continent static transports in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransportMgr::CreateInstanceTransports(Map* map)
|
void TransportMgr::CreateInstanceTransports(Map* map)
|
||||||
|
|||||||
Reference in New Issue
Block a user