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

@@ -57,7 +57,7 @@ void WardenCheckMgr::LoadWardenChecks()
Field* fields = result->Fetch();
uint16 maxCheckId = fields[0].GetUInt16();
uint16 maxCheckId = fields[0].Get<uint16>();
CheckStore.resize(maxCheckId + 1);
@@ -69,8 +69,8 @@ void WardenCheckMgr::LoadWardenChecks()
{
fields = result->Fetch();
uint16 id = fields[0].GetUInt16();
uint8 checkType = fields[1].GetUInt8();
uint16 id = fields[0].Get<uint16>();
uint8 checkType = fields[1].Get<uint8>();
if (checkType == LUA_EVAL_CHECK && id > 9999)
{
@@ -78,12 +78,12 @@ void WardenCheckMgr::LoadWardenChecks()
continue;
}
std::string data = fields[2].GetString();
std::string checkResult = fields[3].GetString();
uint32 address = fields[4].GetUInt32();
uint8 length = fields[5].GetUInt8();
std::string str = fields[6].GetString();
std::string comment = fields[7].GetString();
std::string data = fields[2].Get<std::string>();
std::string checkResult = fields[3].Get<std::string>();
uint32 address = fields[4].Get<uint32>();
uint8 length = fields[5].Get<uint8>();
std::string str = fields[6].Get<std::string>();
std::string comment = fields[7].Get<std::string>();
WardenCheck &wardenCheck = CheckStore.at(id);
wardenCheck.Type = checkType;
@@ -187,8 +187,8 @@ void WardenCheckMgr::LoadWardenOverrides()
{
Field* fields = result->Fetch();
uint16 checkId = fields[0].GetUInt16();
uint8 action = fields[1].GetUInt8();
uint16 checkId = fields[0].Get<uint16>();
uint8 action = fields[1].Get<uint8>();
// Check if action value is in range (0-2, see WardenActions enum)
if (action > WARDEN_ACTION_BAN)