mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 10:00:28 +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:
@@ -157,8 +157,8 @@ public:
|
||||
{
|
||||
///- Get the accounts with GM Level >0
|
||||
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_GM_ACCOUNTS);
|
||||
stmt->setUInt8(0, uint8(SEC_MODERATOR));
|
||||
stmt->setInt32(1, int32(realm.Id.Realm));
|
||||
stmt->SetData(0, uint8(SEC_MODERATOR));
|
||||
stmt->SetData(1, int32(realm.Id.Realm));
|
||||
PreparedQueryResult result = LoginDatabase.Query(stmt);
|
||||
|
||||
if (result)
|
||||
@@ -169,16 +169,16 @@ public:
|
||||
do
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
char const* name = fields[0].GetCString();
|
||||
uint8 security = fields[1].GetUInt8();
|
||||
uint8 max = (16 - strlen(name)) / 2;
|
||||
std::string name = fields[0].Get<std::string>();
|
||||
uint8 security = fields[1].Get<uint8>();
|
||||
uint8 max = (16 - name.length()) / 2;
|
||||
uint8 max2 = max;
|
||||
if ((max + max2 + strlen(name)) == 16)
|
||||
if ((max + max2 + name.length()) == 16)
|
||||
max2 = max - 1;
|
||||
if (handler->GetSession())
|
||||
handler->PSendSysMessage("| %s GMLevel %u", name, security);
|
||||
handler->PSendSysMessage("| %s GMLevel %u", name.c_str(), security);
|
||||
else
|
||||
handler->PSendSysMessage("|%*s%s%*s| %u |", max, " ", name, max2, " ", security);
|
||||
handler->PSendSysMessage("|%*s%s%*s| %u |", max, " ", name.c_str(), max2, " ", security);
|
||||
} while (result->NextRow());
|
||||
handler->SendSysMessage("========================");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user