feat(Core/DBLayer): replace char const* to std::string_view (#10211)

* feat(Core/DBLayer): replace `char const*` to `std::string_view`

* CString

* 1

* chore(Core/Misc): code cleanup

* cl

* db fix

* fmt style sql

* to fmt

* py

* del old

* 1

* 2

* 3

* 1

* 1
This commit is contained in:
Kargatum
2022-02-05 06:37:11 +07:00
committed by GitHub
parent d6ead1d1e0
commit de13bf426e
140 changed files with 5055 additions and 4882 deletions

View File

@@ -64,23 +64,23 @@ void WaypointMgr::Load()
Field* fields = result->Fetch();
WaypointData* wp = new WaypointData();
uint32 pathId = fields[0].GetUInt32();
uint32 pathId = fields[0].Get<uint32>();
WaypointPath& path = _waypointStore[pathId];
float x = fields[2].GetFloat();
float y = fields[3].GetFloat();
float z = fields[4].GetFloat();
float o = fields[5].GetFloat();
float x = fields[2].Get<float>();
float y = fields[3].Get<float>();
float z = fields[4].Get<float>();
float o = fields[5].Get<float>();
Acore::NormalizeMapCoord(x);
Acore::NormalizeMapCoord(y);
wp->id = fields[1].GetUInt32();
wp->id = fields[1].Get<uint32>();
wp->x = x;
wp->y = y;
wp->z = z;
wp->orientation = o;
wp->move_type = fields[6].GetUInt32();
wp->move_type = fields[6].Get<uint32>();
if (wp->move_type >= WAYPOINT_MOVE_TYPE_MAX)
{
@@ -89,9 +89,9 @@ void WaypointMgr::Load()
continue;
}
wp->delay = fields[7].GetUInt32();
wp->event_id = fields[8].GetUInt32();
wp->event_chance = fields[9].GetInt16();
wp->delay = fields[7].Get<uint32>();
wp->event_id = fields[8].Get<uint32>();
wp->event_chance = fields[9].Get<int16>();
path.push_back(wp);
++count;
@@ -114,7 +114,7 @@ void WaypointMgr::ReloadPath(uint32 id)
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_BY_ID);
stmt->setUInt32(0, id);
stmt->SetData(0, id);
PreparedQueryResult result = WorldDatabase.Query(stmt);
@@ -128,20 +128,20 @@ void WaypointMgr::ReloadPath(uint32 id)
Field* fields = result->Fetch();
WaypointData* wp = new WaypointData();
float x = fields[1].GetFloat();
float y = fields[2].GetFloat();
float z = fields[3].GetFloat();
float o = fields[4].GetFloat();
float x = fields[1].Get<float>();
float y = fields[2].Get<float>();
float z = fields[3].Get<float>();
float o = fields[4].Get<float>();
Acore::NormalizeMapCoord(x);
Acore::NormalizeMapCoord(y);
wp->id = fields[0].GetUInt32();
wp->id = fields[0].Get<uint32>();
wp->x = x;
wp->y = y;
wp->z = z;
wp->orientation = o;
wp->move_type = fields[5].GetUInt32();
wp->move_type = fields[5].Get<uint32>();
if (wp->move_type >= WAYPOINT_MOVE_TYPE_MAX)
{
@@ -150,9 +150,9 @@ void WaypointMgr::ReloadPath(uint32 id)
continue;
}
wp->delay = fields[6].GetUInt32();
wp->event_id = fields[7].GetUInt32();
wp->event_chance = fields[8].GetUInt8();
wp->delay = fields[6].Get<uint32>();
wp->event_id = fields[7].Get<uint32>();
wp->event_chance = fields[8].Get<uint8>();
path.push_back(wp);
} while (result->NextRow());