46 TC_LOG_INFO(
"server.loading",
">> Loaded 0 waypoint paths. DB table `waypoint_path` is empty!");
56 }
while (result->NextRow());
65 QueryResult result =
WorldDatabase.Query(
"SELECT PathId, NodeId, PositionX, PositionY, PositionZ, Orientation, Delay FROM waypoint_path_node ORDER BY PathId, NodeId");
69 TC_LOG_INFO(
"server.loading",
">> Loaded 0 waypoint path nodes. DB table `waypoint_path_node` is empty!");
80 while (result->NextRow());
110 TC_LOG_ERROR(
"sql.sql",
"PathId {} in `waypoint_path_node` does not exist in `waypoint_path`, ignoring", pathId);
118 if (!fields[5].IsNull())
124 path->
Nodes.emplace_back(fields[1].GetUInt32(), x, y, z, o, fields[6].GetUInt32());
132 if (pathInfo.
Nodes.empty())
133 TC_LOG_ERROR(
"sql.sql",
"PathId {} in `waypoint_path` has no assigned nodes in `waypoint_path_node`", pathInfo.
Id);
157 TC_LOG_ERROR(
"sql.sql",
"PathId {} in `waypoint_path` not found, ignoring", pathId);
164 }
while (result->NextRow());
176 TC_LOG_ERROR(
"sql.sql",
"PathId {} in `waypoint_path_node` not found, ignoring", pathId);
183 }
while (result->NextRow());
191 std::pair<uint32, uint32> pathNodePair(path->
Id, node.
Id);
216 std::pair<uint32, uint32> pathNodePair(path->
Id, node.
Id);
279 if (node.
Id == nodeId)
300 return itr->second.first;
309 return itr->second.second;
std::shared_ptr< ResultSet > QueryResult
std::shared_ptr< PreparedResultSet > PreparedQueryResult
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
#define TC_LOG_ERROR(filterType__,...)
#define TC_LOG_INFO(filterType__,...)
std::optional< T > Optional
Optional helper class to wrap optional values within.
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
#define WAYPOINT_PATH_FLAG_FOLLOW_PATH_BACKWARDS_MINIMUM_NODES
@ FollowPathBackwardsFromEndToStart
@ WORLD_SEL_WAYPOINT_PATH_NODE_BY_PATHID
@ WORLD_DEL_WAYPOINT_PATH_NODE
@ WORLD_SEL_WAYPOINT_PATH_BY_PATHID
@ WORLD_UPD_WAYPOINT_PATH_NODE
@ WORLD_UPD_WAYPOINT_PATH_NODE_POSITION
void SetObjectScale(float scale) override
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
void SetDisplayId(uint32 displayId, bool setNative=false) override
constexpr bool HasFlag(T flag) const
Class used to access individual fields of database query result.
static ObjectGuid const Empty
static ObjectGuid GetGUID(Object const *o)
void setFloat(const uint8 index, const float value)
void setUInt32(const uint8 index, const uint32 value)
void DoPostLoadingChecks()
void DeleteNode(WaypointPath const *path, WaypointNode const *node)
void LoadPathFromDB(Field *fields)
std::unordered_map< std::pair< uint32, uint32 >, ObjectGuid > _nodeToVisualWaypointGUIDsMap
std::unordered_map< ObjectGuid, std::pair< WaypointPath const *, WaypointNode const * > > _visualWaypointGUIDToNodeMap
WaypointNode const * GetNodeByVisualGUID(ObjectGuid guid) const
WaypointPath const * GetPathByVisualGUID(ObjectGuid guid) const
std::unordered_map< uint32, WaypointPath > _pathStore
void MoveNode(WaypointPath const *path, WaypointNode const *node, Position const &pos)
WaypointNode const * GetNode(WaypointPath const *path, uint32 nodeId) const
static WaypointMgr * instance()
void ReloadPath(uint32 pathId)
WaypointPath const * GetPath(uint32 pathId) const
void VisualizePath(Unit *owner, WaypointPath const *path, Optional< uint32 > displayId)
ObjectGuid const & GetVisualGUIDByNode(uint32 pathId, uint32 nodeId) const
void DevisualizePath(Unit *owner, WaypointPath const *path)
void LoadPathNodesFromDB(Field *fields)
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
auto MapGetValuePtr(M &map, typename M::key_type const &key)
void NormalizeMapCoord(float &c)
constexpr float GetPositionX() const
constexpr float GetPositionY() const
constexpr float GetOrientation() const
constexpr float GetPositionZ() const
Optional< float > Orientation
std::vector< WaypointNode > Nodes
EnumFlag< WaypointPathFlags > Flags
WaypointMoveType MoveType