mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-19 18:24:34 +00:00
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:
@@ -46,15 +46,15 @@ void Graveyard::LoadGraveyardFromDB()
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
uint32 ID = fields[0].GetUInt32();
|
||||
uint32 ID = fields[0].Get<uint32>();
|
||||
|
||||
GraveyardStruct Graveyard;
|
||||
|
||||
Graveyard.Map = fields[1].GetUInt32();
|
||||
Graveyard.x = fields[2].GetFloat();
|
||||
Graveyard.y = fields[3].GetFloat();
|
||||
Graveyard.z = fields[4].GetFloat();
|
||||
Graveyard.name = fields[5].GetString();
|
||||
Graveyard.Map = fields[1].Get<uint32>();
|
||||
Graveyard.x = fields[2].Get<float>();
|
||||
Graveyard.y = fields[3].Get<float>();
|
||||
Graveyard.z = fields[4].Get<float>();
|
||||
Graveyard.name = fields[5].Get<std::string>();
|
||||
|
||||
if (!Utf8toWStr(Graveyard.name, Graveyard.wnameLow))
|
||||
{
|
||||
@@ -291,10 +291,10 @@ bool Graveyard::AddGraveyardLink(uint32 id, uint32 zoneId, TeamId teamId, bool p
|
||||
{
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_GRAVEYARD_ZONE);
|
||||
|
||||
stmt->setUInt32(0, id);
|
||||
stmt->setUInt32(1, zoneId);
|
||||
stmt->SetData(0, id);
|
||||
stmt->SetData(1, zoneId);
|
||||
// Xinef: DB Data compatibility...
|
||||
stmt->setUInt16(2, uint16(teamId == TEAM_NEUTRAL ? 0 : (teamId == TEAM_ALLIANCE ? ALLIANCE : HORDE)));
|
||||
stmt->SetData(2, uint16(teamId == TEAM_NEUTRAL ? 0 : (teamId == TEAM_ALLIANCE ? ALLIANCE : HORDE)));
|
||||
|
||||
WorldDatabase.Execute(stmt);
|
||||
}
|
||||
@@ -342,10 +342,10 @@ void Graveyard::RemoveGraveyardLink(uint32 id, uint32 zoneId, TeamId teamId, boo
|
||||
{
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GRAVEYARD_ZONE);
|
||||
|
||||
stmt->setUInt32(0, id);
|
||||
stmt->setUInt32(1, zoneId);
|
||||
stmt->SetData(0, id);
|
||||
stmt->SetData(1, zoneId);
|
||||
// Xinef: DB Data compatibility...
|
||||
stmt->setUInt16(2, uint16(teamId == TEAM_NEUTRAL ? 0 : (teamId == TEAM_ALLIANCE ? ALLIANCE : HORDE)));
|
||||
stmt->SetData(2, uint16(teamId == TEAM_NEUTRAL ? 0 : (teamId == TEAM_ALLIANCE ? ALLIANCE : HORDE)));
|
||||
|
||||
WorldDatabase.Execute(stmt);
|
||||
}
|
||||
@@ -375,9 +375,9 @@ void Graveyard::LoadGraveyardZones()
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
uint32 safeLocId = fields[0].GetUInt32();
|
||||
uint32 zoneId = fields[1].GetUInt32();
|
||||
uint32 team = fields[2].GetUInt16();
|
||||
uint32 safeLocId = fields[0].Get<uint32>();
|
||||
uint32 zoneId = fields[1].Get<uint32>();
|
||||
uint32 team = fields[2].Get<uint16>();
|
||||
TeamId teamId = team == 0 ? TEAM_NEUTRAL : (team == ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE);
|
||||
|
||||
GraveyardStruct const* entry = sGraveyard->GetGraveyard(safeLocId);
|
||||
|
||||
Reference in New Issue
Block a user