29 QueryResult result =
WorldDatabase.Query(
"SELECT id, point, position_x, position_y, position_z, orientation, move_type, delay, action, action_chance FROM waypoint_data ORDER BY id, point");
33 TC_LOG_INFO(
"server.loading",
">> Loaded 0 waypoints. DB table `waypoint_data` is empty!");
41 Field* fields = result->Fetch();
47 if (!fields[5].IsNull())
63 TC_LOG_ERROR(
"sql.sql",
"Waypoint {} in waypoint_data has invalid move_type, ignoring", waypoint.
id);
73 path.
nodes.push_back(std::move(waypoint));
76 while (result->NextRow());
98 std::vector<WaypointNode> values;
101 Field* fields = result->Fetch();
106 if (!fields[4].IsNull())
122 TC_LOG_ERROR(
"sql.sql",
"Waypoint {} in waypoint_data has invalid move_type, ignoring", waypoint.
id);
130 values.push_back(std::move(waypoint));
132 while (result->NextRow());
136 path.
nodes = std::move(values);
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)
@ WORLD_SEL_WAYPOINT_DATA_BY_ID
Class used to access individual fields of database query result.
void setUInt32(uint8 index, uint32 value)
std::unordered_map< uint32, WaypointPath > _waypointStore
WaypointPath const * GetPath(uint32 id) const
static WaypointMgr * instance()
void ReloadPath(uint32 id)
void NormalizeMapCoord(float &c)
Optional< float > orientation
std::vector< WaypointNode > nodes