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

@@ -1352,33 +1352,33 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
WorldDatabaseTransaction trans = WorldDatabase.BeginTransaction();
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE);
stmt->setUInt32(0, m_spawnId);
stmt->SetData(0, m_spawnId);
trans->Append(stmt);
uint8 index = 0;
stmt = WorldDatabase.GetPreparedStatement(WORLD_INS_CREATURE);
stmt->setUInt32(index++, m_spawnId);
stmt->setUInt32(index++, GetEntry());
stmt->setUInt32(index++, 0);
stmt->setUInt32(index++, 0);
stmt->setUInt16(index++, uint16(mapid));
stmt->setUInt8(index++, spawnMask);
stmt->setUInt32(index++, GetPhaseMask());
stmt->setInt32(index++, int32(GetCurrentEquipmentId()));
stmt->setFloat(index++, GetPositionX());
stmt->setFloat(index++, GetPositionY());
stmt->setFloat(index++, GetPositionZ());
stmt->setFloat(index++, GetOrientation());
stmt->setUInt32(index++, m_respawnDelay);
stmt->setFloat(index++, m_wanderDistance);
stmt->setUInt32(index++, 0);
stmt->setUInt32(index++, GetHealth());
stmt->setUInt32(index++, GetPower(POWER_MANA));
stmt->setUInt8(index++, uint8(GetDefaultMovementType()));
stmt->setUInt32(index++, npcflag);
stmt->setUInt32(index++, unit_flags);
stmt->setUInt32(index++, dynamicflags);
stmt->SetData(index++, m_spawnId);
stmt->SetData(index++, GetEntry());
stmt->SetData(index++, 0);
stmt->SetData(index++, 0);
stmt->SetData(index++, uint16(mapid));
stmt->SetData(index++, spawnMask);
stmt->SetData(index++, GetPhaseMask());
stmt->SetData(index++, int32(GetCurrentEquipmentId()));
stmt->SetData(index++, GetPositionX());
stmt->SetData(index++, GetPositionY());
stmt->SetData(index++, GetPositionZ());
stmt->SetData(index++, GetOrientation());
stmt->SetData(index++, m_respawnDelay);
stmt->SetData(index++, m_wanderDistance);
stmt->SetData(index++, 0);
stmt->SetData(index++, GetHealth());
stmt->SetData(index++, GetPower(POWER_MANA));
stmt->SetData(index++, uint8(GetDefaultMovementType()));
stmt->SetData(index++, npcflag);
stmt->SetData(index++, unit_flags);
stmt->SetData(index++, dynamicflags);
trans->Append(stmt);
WorldDatabase.CommitTransaction(trans);
@@ -1737,19 +1737,19 @@ void Creature::DeleteFromDB()
WorldDatabaseTransaction trans = WorldDatabase.BeginTransaction();
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE);
stmt->setUInt32(0, m_spawnId);
stmt->SetData(0, m_spawnId);
trans->Append(stmt);
stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_CREATURE_ADDON);
stmt->setUInt32(0, m_spawnId);
stmt->SetData(0, m_spawnId);
trans->Append(stmt);
stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAME_EVENT_CREATURE);
stmt->setUInt32(0, m_spawnId);
stmt->SetData(0, m_spawnId);
trans->Append(stmt);
stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAME_EVENT_MODEL_EQUIP);
stmt->setUInt32(0, m_spawnId);
stmt->SetData(0, m_spawnId);
trans->Append(stmt);
WorldDatabase.CommitTransaction(trans);