refactor(Core/Chat): PSendSysMessage to fmt (#19449)

* refactor(Core/Chat): PSendSysMessage to `fmt`
This commit is contained in:
Kitzunu
2024-07-23 23:48:46 +02:00
committed by GitHub
parent e79c89aeb1
commit 3fbded8f6b
52 changed files with 801 additions and 587 deletions

View File

@@ -348,7 +348,7 @@ public:
switch (result)
{
case AOR_OK:
handler->PSendSysMessage(LANG_ACCOUNT_DELETED, accountName.c_str());
handler->PSendSysMessage(LANG_ACCOUNT_DELETED, accountName);
break;
case AOR_NAME_NOT_EXIST:
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
@@ -400,12 +400,12 @@ public:
{
Field* fieldsLogin = resultLogin->Fetch();
handler->PSendSysMessage(LANG_ACCOUNT_LIST_LINE,
fieldsLogin[0].Get<std::string>().c_str(), name.c_str(), fieldsLogin[1].Get<std::string>().c_str(),
fieldsLogin[0].Get<std::string>(), name, fieldsLogin[1].Get<std::string>(),
fieldsDB[2].Get<uint16>(), fieldsDB[3].Get<uint16>(), fieldsLogin[3].Get<uint8>(),
fieldsLogin[2].Get<uint8>());
}
else
handler->PSendSysMessage(LANG_ACCOUNT_LIST_ERROR, name.c_str());
handler->PSendSysMessage(LANG_ACCOUNT_LIST_ERROR, name);
} while (result->NextRow());
handler->SendSysMessage(LANG_ACCOUNT_LIST_BAR);
@@ -428,14 +428,14 @@ public:
std::string accountName = _accountName;
if (!Utf8ToUpperOnlyLatin(accountName))
{
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName);
return false;
}
uint32 accountId = AccountMgr::GetId(accountName);
if (!accountId)
{
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName);
return false;
}
@@ -599,14 +599,14 @@ public:
if (!Utf8ToUpperOnlyLatin(accountName))
{
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName);
return false;
}
uint32 targetAccountId = AccountMgr::GetId(accountName);
if (!targetAccountId)
{
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName);
return false;
}
@@ -651,7 +651,7 @@ public:
stmt->SetData(1, targetAccountId);
LoginDatabase.Execute(stmt);
handler->PSendSysMessage(LANG_2FA_SECRET_SET_COMPLETE, accountName.c_str());
handler->PSendSysMessage(LANG_2FA_SECRET_SET_COMPLETE, accountName);
return true;
}
@@ -691,14 +691,14 @@ public:
accountName = account;
if (!Utf8ToUpperOnlyLatin(accountName))
{
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName);
return false;
}
accountId = AccountMgr::GetId(accountName);
if (!accountId)
{
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName);
return false;
}
}
@@ -720,7 +720,7 @@ public:
LoginDatabase.Execute(stmt);
handler->PSendSysMessage(LANG_ACCOUNT_SETADDON, accountName.c_str(), accountId, *expansion);
handler->PSendSysMessage(LANG_ACCOUNT_SETADDON, accountName, accountId, *expansion);
return true;
}
@@ -755,7 +755,7 @@ public:
targetAccountName = arg1;
if (!Utf8ToUpperOnlyLatin(targetAccountName))
{
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, targetAccountName.c_str());
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, targetAccountName);
return false;
}
}
@@ -838,7 +838,7 @@ public:
LoginDatabase.Execute(stmt);
}
handler->PSendSysMessage(LANG_YOU_CHANGE_SECURITY, targetAccountName.c_str(), gm);
handler->PSendSysMessage(LANG_YOU_CHANGE_SECURITY, targetAccountName, gm);
return true;
}
@@ -859,14 +859,14 @@ public:
std::string accountName = account;
if (!Utf8ToUpperOnlyLatin(accountName))
{
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName);
return false;
}
uint32 targetAccountId = AccountMgr::GetId(accountName);
if (!targetAccountId)
{
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName);
return false;
}
@@ -889,7 +889,7 @@ public:
handler->SendSysMessage(LANG_COMMAND_PASSWORD);
break;
case AOR_NAME_NOT_EXIST:
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str());
handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName);
return false;
case AOR_PASS_TOO_LONG:
handler->SendErrorMessage(LANG_PASSWORD_TOO_LONG);