mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 12:47:07 +00:00
refactor(Core/Misc): Acore::StringFormat to fmt format (#19838)
refactor(Core/Utilities): Acore::StringFormat to fmt format * closes https://github.com/azerothcore/azerothcore-wotlk/issues/10356
This commit is contained in:
@@ -103,7 +103,7 @@ public:
|
||||
if (sql.empty())
|
||||
return;
|
||||
|
||||
Execute(Acore::StringFormatFmt(sql, std::forward<Args>(args)...));
|
||||
Execute(Acore::StringFormat(sql, std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
//! Enqueues a one-way SQL operation in prepared statement format that will be executed asynchronously.
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
if (sql.empty())
|
||||
return;
|
||||
|
||||
DirectExecute(Acore::StringFormatFmt(sql, std::forward<Args>(args)...));
|
||||
DirectExecute(Acore::StringFormat(sql, std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
//! Directly executes a one-way SQL operation in prepared statement format, that will block the calling thread until finished.
|
||||
@@ -149,7 +149,7 @@ public:
|
||||
if (sql.empty())
|
||||
return QueryResult(nullptr);
|
||||
|
||||
return Query(Acore::StringFormatFmt(sql, std::forward<Args>(args)...));
|
||||
return Query(Acore::StringFormat(sql, std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
//! Directly executes an SQL query in prepared format that will block the calling thread until finished.
|
||||
|
||||
@@ -104,7 +104,7 @@ bool PreparedStatementTask::Execute()
|
||||
template<typename T>
|
||||
std::string PreparedStatementData::ToString(T value)
|
||||
{
|
||||
return Acore::StringFormatFmt("{}", value);
|
||||
return Acore::StringFormat("{}", value);
|
||||
}
|
||||
|
||||
template<>
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
template<typename... Args>
|
||||
void Append(std::string_view sql, Args&&... args)
|
||||
{
|
||||
Append(Acore::StringFormatFmt(sql, std::forward<Args>(args)...));
|
||||
Append(Acore::StringFormat(sql, std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
[[nodiscard]] std::size_t GetSize() const { return m_queries.size(); }
|
||||
|
||||
@@ -235,7 +235,7 @@ bool DBUpdater<T>::Update(DatabaseWorkerPool<T>& pool, std::string_view modulesL
|
||||
|
||||
auto CheckUpdateTable = [&](std::string const& tableName)
|
||||
{
|
||||
auto checkTable = DBUpdater<T>::Retrieve(pool, Acore::StringFormatFmt("SHOW TABLES LIKE '{}'", tableName));
|
||||
auto checkTable = DBUpdater<T>::Retrieve(pool, Acore::StringFormat("SHOW TABLES LIKE '{}'", tableName));
|
||||
if (!checkTable)
|
||||
{
|
||||
LOG_WARN("sql.updates", "> Table '{}' not exist! Try add based table", tableName);
|
||||
@@ -279,7 +279,7 @@ bool DBUpdater<T>::Update(DatabaseWorkerPool<T>& pool, std::string_view modulesL
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string const info = Acore::StringFormatFmt("Containing {} new and {} archived updates.", result.recent, result.archived);
|
||||
std::string const info = Acore::StringFormat("Containing {} new and {} archived updates.", result.recent, result.archived);
|
||||
|
||||
if (!result.updated)
|
||||
LOG_INFO("sql.updates", ">> {} database is up-to-date! {}", DBUpdater<T>::GetTableName(), info);
|
||||
@@ -307,7 +307,7 @@ bool DBUpdater<T>::Update(DatabaseWorkerPool<T>& pool, std::vector<std::string>
|
||||
|
||||
auto CheckUpdateTable = [&](std::string const& tableName)
|
||||
{
|
||||
auto checkTable = DBUpdater<T>::Retrieve(pool, Acore::StringFormatFmt("SHOW TABLES LIKE '{}'", tableName));
|
||||
auto checkTable = DBUpdater<T>::Retrieve(pool, Acore::StringFormat("SHOW TABLES LIKE '{}'", tableName));
|
||||
if (!checkTable)
|
||||
{
|
||||
Path const temp(GetBaseFilesDirectory() + tableName + ".sql");
|
||||
@@ -507,7 +507,7 @@ void DBUpdater<T>::ApplyFile(DatabaseWorkerPool<T>& pool, std::string const& hos
|
||||
|
||||
// Execute sql file
|
||||
args.emplace_back("-e");
|
||||
args.emplace_back(Acore::StringFormat("BEGIN; SOURCE %s; COMMIT;", path.generic_string().c_str()));
|
||||
args.emplace_back(Acore::StringFormat("BEGIN; SOURCE {}; COMMIT;", path.generic_string()));
|
||||
|
||||
// Database
|
||||
if (!database.empty())
|
||||
|
||||
@@ -35,7 +35,7 @@ protected:
|
||||
// For Logging purpose
|
||||
std::string ToString() const override
|
||||
{
|
||||
return Acore::StringFormatFmt("Damage done: {}, Healing done: {}, Killing blows: {}", DamageDone, HealingDone, KillingBlows);
|
||||
return Acore::StringFormat("Damage done: {}, Healing done: {}, Killing blows: {}", DamageDone, HealingDone, KillingBlows);
|
||||
}
|
||||
|
||||
uint8 PvPTeamId;
|
||||
|
||||
@@ -1107,7 +1107,7 @@ void BattlegroundQueue::SendJoinMessageArenaQueue(Player* leader, GroupQueueInfo
|
||||
|
||||
BattlegroundBracketId bracketId = bracketEntry->GetBracketId();
|
||||
auto bgName = bg->GetName();
|
||||
auto arenatype = Acore::StringFormat("%uv%u", ginfo->ArenaType, ginfo->ArenaType);
|
||||
auto arenatype = Acore::StringFormat("{}v{}", ginfo->ArenaType, ginfo->ArenaType);
|
||||
uint32 playersNeed = ArenaTeam::GetReqPlayersForType(ginfo->ArenaType);
|
||||
uint32 q_min_level = std::min(bracketEntry->minLevel, (uint32)80);
|
||||
uint32 q_max_level = std::min(bracketEntry->maxLevel, (uint32)80);
|
||||
|
||||
@@ -56,13 +56,13 @@ public:
|
||||
void SendNotification(uint32 strId, Args&&... args)
|
||||
{
|
||||
if (HasSession())
|
||||
SendNotification(Acore::StringFormatFmt(GetAcoreString(strId), std::forward<Args>(args)...));
|
||||
SendNotification(Acore::StringFormat(GetAcoreString(strId), std::forward<Args>(args)...));
|
||||
}
|
||||
template<typename... Args>
|
||||
void SendNotification(char const* fmt, Args&&... args)
|
||||
{
|
||||
if (HasSession())
|
||||
SendNotification(Acore::StringFormatFmt(fmt, std::forward<Args>(args)...));
|
||||
SendNotification(Acore::StringFormat(fmt, std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
void SendGMText(std::string_view str);
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
DoForAllValidSessions([&](Player* player)
|
||||
{
|
||||
m_session = player->GetSession();
|
||||
SendGMText(Acore::StringFormatFmt(GetAcoreString(strId), std::forward<Args>(args)...));
|
||||
SendGMText(Acore::StringFormat(GetAcoreString(strId), std::forward<Args>(args)...));
|
||||
});
|
||||
}
|
||||
template<typename... Args>
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
DoForAllValidSessions([&](Player* player)
|
||||
{
|
||||
m_session = player->GetSession();
|
||||
SendGMText(Acore::StringFormatFmt(fmt, std::forward<Args>(args)...));
|
||||
SendGMText(Acore::StringFormat(fmt, std::forward<Args>(args)...));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
DoForAllValidSessions([&](Player* player)
|
||||
{
|
||||
m_session = player->GetSession();
|
||||
SendWorldText(Acore::StringFormatFmt(GetAcoreString(strId), std::forward<Args>(args)...));
|
||||
SendWorldText(Acore::StringFormat(GetAcoreString(strId), std::forward<Args>(args)...));
|
||||
});
|
||||
}
|
||||
template<typename... Args>
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
DoForAllValidSessions([&](Player* player)
|
||||
{
|
||||
m_session = player->GetSession();
|
||||
SendWorldText(Acore::StringFormatFmt(fmt, std::forward<Args>(args)...));
|
||||
SendWorldText(Acore::StringFormat(fmt, std::forward<Args>(args)...));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
DoForAllValidSessions([&](Player* player)
|
||||
{
|
||||
m_session = player->GetSession();
|
||||
SendWorldTextOptional(Acore::StringFormatFmt(GetAcoreString(strId), std::forward<Args>(args)...), flag);
|
||||
SendWorldTextOptional(Acore::StringFormat(GetAcoreString(strId), std::forward<Args>(args)...), flag);
|
||||
});
|
||||
}
|
||||
template<typename... Args>
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
DoForAllValidSessions([&](Player* player)
|
||||
{
|
||||
m_session = player->GetSession();
|
||||
SendWorldTextOptional(Acore::StringFormatFmt(fmt, std::forward<Args>(args)...), flag);
|
||||
SendWorldTextOptional(Acore::StringFormat(fmt, std::forward<Args>(args)...), flag);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
void PSendSysMessage(char const* fmt, Args&&... args)
|
||||
{
|
||||
if (HasSession())
|
||||
SendSysMessage(Acore::StringFormatFmt(fmt, std::forward<Args>(args)...));
|
||||
SendSysMessage(Acore::StringFormat(fmt, std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
template<typename... Args>
|
||||
std::string PGetParseString(uint32 entry, Args&&... args) const
|
||||
{
|
||||
return Acore::StringFormatFmt(GetAcoreString(entry), std::forward<Args>(args)...);
|
||||
return Acore::StringFormat(GetAcoreString(entry), std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
std::string const* GetModuleString(std::string module, uint32 id) const;
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
template<typename... Args>
|
||||
std::string PGetParseModuleString(std::string module, uint32 id, Args&&... args) const
|
||||
{
|
||||
return Acore::StringFormatFmt(GetModuleString(module, id)->c_str(), std::forward<Args>(args)...);
|
||||
return Acore::StringFormat(GetModuleString(module, id)->c_str(), std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
void SendErrorMessage(uint32 entry);
|
||||
|
||||
@@ -175,7 +175,7 @@ static void LogCommandUsage(WorldSession const& session, std::string_view cmdStr
|
||||
zoneName = zone->area_name[locale];
|
||||
}
|
||||
|
||||
std::string logMessage = Acore::StringFormatFmt("Command: {} [Player: {} ({}) (Account: {}) X: {} Y: {} Z: {} Map: {} ({}) Area: {} ({}) Zone: {} ({}) Selected: {} ({})]",
|
||||
std::string logMessage = Acore::StringFormat("Command: {} [Player: {} ({}) (Account: {}) X: {} Y: {} Z: {} Map: {} ({}) Area: {} ({}) Zone: {} ({}) Selected: {} ({})]",
|
||||
cmdStr, player->GetName(), player->GetGUID().ToString(),
|
||||
session.GetAccountId(),
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(),
|
||||
@@ -443,11 +443,11 @@ namespace Acore::Impl::ChatCommands
|
||||
{
|
||||
if (prefix.empty())
|
||||
{
|
||||
return Acore::StringFormatFmt("{}{}{}", match, COMMAND_DELIMITER, suffix);
|
||||
return Acore::StringFormat("{}{}{}", match, COMMAND_DELIMITER, suffix);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Acore::StringFormatFmt("{}{}{}{}{}", prefix, COMMAND_DELIMITER, match, COMMAND_DELIMITER, suffix);
|
||||
return Acore::StringFormat("{}{}{}{}{}", prefix, COMMAND_DELIMITER, match, COMMAND_DELIMITER, suffix);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -465,7 +465,7 @@ namespace Acore::Impl::ChatCommands
|
||||
path.assign(it1->first);
|
||||
else
|
||||
{
|
||||
path = Acore::StringFormatFmt("{}{}{}", path, COMMAND_DELIMITER, it1->first);
|
||||
path = Acore::StringFormat("{}{}{}", path, COMMAND_DELIMITER, it1->first);
|
||||
}
|
||||
cmd = &it1->second;
|
||||
map = &cmd->_subCommands;
|
||||
@@ -477,7 +477,7 @@ namespace Acore::Impl::ChatCommands
|
||||
{ /* there is some trailing text, leave it as is */
|
||||
if (cmd)
|
||||
{ /* if we matched a command at some point, auto-complete it */
|
||||
return { Acore::StringFormatFmt("{}{}{}", path, COMMAND_DELIMITER, oldTail) };
|
||||
return { Acore::StringFormat("{}{}{}", path, COMMAND_DELIMITER, oldTail) };
|
||||
}
|
||||
else
|
||||
return {};
|
||||
@@ -490,7 +490,7 @@ namespace Acore::Impl::ChatCommands
|
||||
return std::string(match);
|
||||
else
|
||||
{
|
||||
return Acore::StringFormatFmt("{}{}{}", prefix, COMMAND_DELIMITER, match);
|
||||
return Acore::StringFormat("{}{}{}", prefix, COMMAND_DELIMITER, match);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Acore::Impl::ChatCommands
|
||||
return result2;
|
||||
if (result1.HasErrorMessage() && result2.HasErrorMessage())
|
||||
{
|
||||
return Acore::StringFormatFmt("{} \"{}\"\n{} \"{}\"",
|
||||
return Acore::StringFormat("{} \"{}\"\n{} \"{}\"",
|
||||
GetAcoreString(handler, LANG_CMDPARSER_EITHER), result2.GetErrorMessage(),
|
||||
GetAcoreString(handler, LANG_CMDPARSER_OR), result1.GetErrorMessage());
|
||||
}
|
||||
|
||||
@@ -273,9 +273,9 @@ namespace Acore::Impl::ChatCommands
|
||||
if (!nestedResult.HasErrorMessage())
|
||||
return thisResult;
|
||||
if (StringStartsWith(nestedResult.GetErrorMessage(), "\""))
|
||||
return Acore::StringFormat("\"%s\"\n%s %s", thisResult.GetErrorMessage().c_str(), GetAcoreString(handler, LANG_CMDPARSER_OR), nestedResult.GetErrorMessage().c_str());
|
||||
return Acore::StringFormat("\"{}\"\n{} {}", thisResult.GetErrorMessage(), GetAcoreString(handler, LANG_CMDPARSER_OR), nestedResult.GetErrorMessage());
|
||||
else
|
||||
return Acore::StringFormat("\"%s\"\n%s \"%s\"", thisResult.GetErrorMessage().c_str(), GetAcoreString(handler, LANG_CMDPARSER_OR), nestedResult.GetErrorMessage().c_str());
|
||||
return Acore::StringFormat("\"{}\"\n{} \"{}\"", thisResult.GetErrorMessage(), GetAcoreString(handler, LANG_CMDPARSER_OR), nestedResult.GetErrorMessage());
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -286,7 +286,7 @@ namespace Acore::Impl::ChatCommands
|
||||
{
|
||||
ChatCommandResult result = TryAtIndex<0>(val, handler, args);
|
||||
if (result.HasErrorMessage() && (result.GetErrorMessage().find('\n') != std::string::npos))
|
||||
return Acore::StringFormat("%s %s", GetAcoreString(handler, LANG_CMDPARSER_EITHER), result.GetErrorMessage().c_str());
|
||||
return Acore::StringFormat("{} {}", GetAcoreString(handler, LANG_CMDPARSER_EITHER), result.GetErrorMessage());
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace Acore::Impl::ChatCommands
|
||||
template <typename... Ts>
|
||||
std::string FormatAcoreString(ChatHandler const* handler, AcoreStrings which, Ts&&... args)
|
||||
{
|
||||
return Acore::StringFormatFmt(GetAcoreString(handler, which), std::forward<Ts>(args)...);
|
||||
return Acore::StringFormat(GetAcoreString(handler, which), std::forward<Ts>(args)...);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ void PlayerDump::InitializeTables()
|
||||
// item0 - item18
|
||||
for (uint32 j = 0; j < EQUIPMENT_SLOT_END; ++j)
|
||||
{
|
||||
std::string itColumn = Acore::StringFormat("item%u", j);
|
||||
std::string itColumn = Acore::StringFormat("item{}", j);
|
||||
MarkDependentColumn(t, itColumn, GUID_TYPE_ITEM);
|
||||
}
|
||||
break;
|
||||
@@ -923,7 +923,7 @@ DumpReturn PlayerDumpReader::LoadDump(std::istream& input, uint32 account, std::
|
||||
if (name.empty())
|
||||
{
|
||||
// generate a temporary name
|
||||
std::string guidPart = Acore::StringFormat("%X", guid);
|
||||
std::string guidPart = Acore::StringFormat("{:X}", guid);
|
||||
std::size_t maxCharsFromOriginalName = MAX_PLAYER_NAME - guidPart.length();
|
||||
|
||||
name = GetColumn(ts, line, "name").substr(0, maxCharsFromOriginalName) + guidPart;
|
||||
|
||||
@@ -246,14 +246,14 @@ void Warden::ApplyPenalty(uint16 checkId, std::string const& reason)
|
||||
if (Player const* plr = _session->GetPlayer())
|
||||
{
|
||||
std::string const reportFormat = "Player {} (guid {}, account id: {}) failed warden {} check ({}). Action: {}";
|
||||
reportMsg = Acore::StringFormatFmt(reportFormat, plr->GetName(), plr->GetGUID().GetCounter(), _session->GetAccountId(),
|
||||
reportMsg = Acore::StringFormat(reportFormat, plr->GetName(), plr->GetGUID().GetCounter(), _session->GetAccountId(),
|
||||
checkId, ((checkData && !checkData->Comment.empty()) ? checkData->Comment : "<warden comment is not set>"),
|
||||
GetWardenActionStr(action));
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string const reportFormat = "Account id: {} failed warden {} check. Action: {}";
|
||||
reportMsg = Acore::StringFormatFmt(reportFormat, _session->GetAccountId(), checkId, GetWardenActionStr(action));
|
||||
reportMsg = Acore::StringFormat(reportFormat, _session->GetAccountId(), checkId, GetWardenActionStr(action));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -261,12 +261,12 @@ void Warden::ApplyPenalty(uint16 checkId, std::string const& reason)
|
||||
if (Player const* plr = _session->GetPlayer())
|
||||
{
|
||||
std::string const reportFormat = "Player {} (guid {}, account id: {}) triggered warden penalty by reason: {}. Action: {}";
|
||||
reportMsg = Acore::StringFormatFmt(reportFormat, plr->GetName(), plr->GetGUID().GetCounter(), _session->GetAccountId(), causeMsg, GetWardenActionStr(action));
|
||||
reportMsg = Acore::StringFormat(reportFormat, plr->GetName(), plr->GetGUID().GetCounter(), _session->GetAccountId(), causeMsg, GetWardenActionStr(action));
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string const reportFormat = "Account id: {} failed warden {} check. Action: {}";
|
||||
reportMsg = Acore::StringFormatFmt(reportFormat, _session->GetAccountId(), causeMsg, GetWardenActionStr(action));
|
||||
reportMsg = Acore::StringFormat(reportFormat, _session->GetAccountId(), causeMsg, GetWardenActionStr(action));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ void WardenCheckMgr::LoadWardenChecks()
|
||||
continue;
|
||||
}
|
||||
|
||||
std::string str2 = Acore::StringFormat("%04u", id);
|
||||
std::string str2 = Acore::StringFormat("{:04}", id);
|
||||
ASSERT(str2.size() == 4);
|
||||
std::copy(str2.begin(), str2.end(), wardenCheck.IdStr.begin());
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ bool WardenPayloadMgr::RegisterPayload(std::string const& payload, uint16 payloa
|
||||
wCheck.Str = payload;
|
||||
wCheck.CheckId = payloadId;
|
||||
|
||||
std::string idStr = Acore::StringFormat("%04u", payloadId);
|
||||
std::string idStr = Acore::StringFormat("{:04}", payloadId);
|
||||
ASSERT(idStr.size() == 4);
|
||||
std::copy(idStr.begin(), idStr.end(), wCheck.IdStr.begin());
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ public:
|
||||
if (target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index)
|
||||
activeStr = handler->GetAcoreString(LANG_ACTIVE);
|
||||
|
||||
std::string titleName = Acore::StringFormat(name, player->GetName().c_str());
|
||||
std::string titleName = Acore::StringFormat(name, player->GetName());
|
||||
|
||||
// send title in "id (idx:idx) - [namedlink locale]" format
|
||||
if (handler->GetSession())
|
||||
|
||||
@@ -733,14 +733,14 @@ public:
|
||||
|
||||
if (item->GetOwnerGUID() != player->GetGUID())
|
||||
{
|
||||
handler->SendSysMessage(Acore::StringFormatFmt("queue({}): For the item {}, the owner ({}) and the player ({}) don't match!", index, item->GetGUID().ToString(), item->GetOwnerGUID().ToString(), player->GetGUID().ToString()));
|
||||
handler->SendSysMessage(Acore::StringFormat("queue({}): For the item {}, the owner ({}) and the player ({}) don't match!", index, item->GetGUID().ToString(), item->GetOwnerGUID().ToString(), player->GetGUID().ToString()));
|
||||
error = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (item->GetQueuePos() != index)
|
||||
{
|
||||
handler->SendSysMessage(Acore::StringFormatFmt("queue({}): For the item {}, the queuepos doesn't match it's position in the queue!", index, item->GetGUID().ToString()));
|
||||
handler->SendSysMessage(Acore::StringFormat("queue({}): For the item {}, the queuepos doesn't match it's position in the queue!", index, item->GetGUID().ToString()));
|
||||
error = true;
|
||||
continue;
|
||||
}
|
||||
@@ -752,14 +752,14 @@ public:
|
||||
|
||||
if (!test)
|
||||
{
|
||||
handler->SendSysMessage(Acore::StringFormatFmt("queue({}): The bag({}) and slot({}) values for {} are incorrect, the player doesn't have any item at that position!", index, item->GetBagSlot(), item->GetSlot(), item->GetGUID().ToString()));
|
||||
handler->SendSysMessage(Acore::StringFormat("queue({}): The bag({}) and slot({}) values for {} are incorrect, the player doesn't have any item at that position!", index, item->GetBagSlot(), item->GetSlot(), item->GetGUID().ToString()));
|
||||
error = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (test != item)
|
||||
{
|
||||
handler->SendSysMessage(Acore::StringFormatFmt("queue({}): The bag({}) and slot({}) values for the {} are incorrect, {} is there instead!", index, item->GetBagSlot(), item->GetSlot(), item->GetGUID().ToString(), test->GetGUID().ToString()));
|
||||
handler->SendSysMessage(Acore::StringFormat("queue({}): The bag({}) and slot({}) values for the {} are incorrect, {} is there instead!", index, item->GetBagSlot(), item->GetSlot(), item->GetGUID().ToString(), test->GetGUID().ToString()));
|
||||
error = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
if (message.empty())
|
||||
return false;
|
||||
|
||||
sWorld->SendServerMessage(SERVER_MSG_STRING, Acore::StringFormatFmt(handler->GetAcoreString(LANG_SYSTEMMESSAGE), message.data()));
|
||||
sWorld->SendServerMessage(SERVER_MSG_STRING, Acore::StringFormat(handler->GetAcoreString(LANG_SYSTEMMESSAGE), message.data()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
itemCount = *Acore::StringTo<uint32>(itemTokens.at(1));
|
||||
break;
|
||||
default:
|
||||
handler->SendSysMessage(Acore::StringFormatFmt("> Incorrect item list format for '{}'", itemString));
|
||||
handler->SendSysMessage(Acore::StringFormat("> Incorrect item list format for '{}'", itemString));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -121,9 +121,9 @@ public:
|
||||
dbPort = (*res)[0].Get<uint16>();
|
||||
|
||||
if (dbPort)
|
||||
dbPortOutput = Acore::StringFormatFmt("Realmlist (Realm Id: {}) configured in port {}", realm.Id.Realm, dbPort);
|
||||
dbPortOutput = Acore::StringFormat("Realmlist (Realm Id: {}) configured in port {}", realm.Id.Realm, dbPort);
|
||||
else
|
||||
dbPortOutput = Acore::StringFormatFmt("Realm Id: {} not found in `realmlist` table. Please check your setup", realm.Id.Realm);
|
||||
dbPortOutput = Acore::StringFormat("Realm Id: {} not found in `realmlist` table. Please check your setup", realm.Id.Realm);
|
||||
}
|
||||
|
||||
HandleServerInfoCommand(handler);
|
||||
|
||||
@@ -144,7 +144,7 @@ class spell_the_flag_of_ownership : public SpellScript
|
||||
|
||||
LocaleConstant loc_idx = caster->ToPlayer()->GetSession()->GetSessionDbLocaleIndex();
|
||||
BroadcastText const* bct = sObjectMgr->GetBroadcastText(TEXT_FLAG_OF_OWNERSHIP);
|
||||
std::string bctMsg = Acore::StringFormat(bct->GetText(loc_idx, caster->getGender()), caster->GetName().c_str(), target->GetName().c_str());
|
||||
std::string bctMsg = Acore::StringFormat(bct->GetText(loc_idx, caster->getGender()), caster->GetName(), target->GetName());
|
||||
caster->Talk(bctMsg, CHAT_MSG_MONSTER_EMOTE, LANG_UNIVERSAL, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), target);
|
||||
|
||||
haveTarget = true;
|
||||
|
||||
@@ -36,7 +36,7 @@ DBCDatabaseLoader::DBCDatabaseLoader(char const* tableName, char const* dbcForma
|
||||
|
||||
char* DBCDatabaseLoader::Load(uint32& records, char**& indexTable)
|
||||
{
|
||||
std::string query = Acore::StringFormat("SELECT * FROM `%s` ORDER BY `ID` DESC", _sqlTableName);
|
||||
std::string query = Acore::StringFormat("SELECT * FROM `{}` ORDER BY `ID` DESC", _sqlTableName);
|
||||
|
||||
// no error if empty set
|
||||
QueryResult result = WorldDatabase.Query(query);
|
||||
|
||||
@@ -51,7 +51,7 @@ ByteBufferSourceException::ByteBufferSourceException(std::size_t pos, std::size_
|
||||
|
||||
ByteBufferInvalidValueException::ByteBufferInvalidValueException(char const* type, char const* value)
|
||||
{
|
||||
message().assign(Acore::StringFormat("Invalid %s value (%s) found in ByteBuffer", type, value));
|
||||
message().assign(Acore::StringFormat("Invalid {} value ({}) found in ByteBuffer", type, value));
|
||||
}
|
||||
|
||||
ByteBuffer& ByteBuffer::operator>>(float& value)
|
||||
|
||||
@@ -188,11 +188,11 @@ Optional<std::string> SecretMgr::AttemptTransition(Secrets i, Optional<BigNumber
|
||||
if (hadOldSecret)
|
||||
{
|
||||
if (!oldSecret)
|
||||
return Acore::StringFormat("Cannot decrypt old TOTP tokens - add config key '%s' to authserver.conf!", secret_info[i].oldKey);
|
||||
return Acore::StringFormat("Cannot decrypt old TOTP tokens - add config key '{}' to authserver.conf!", secret_info[i].oldKey);
|
||||
|
||||
bool success = Acore::Crypto::AEDecrypt<Acore::Crypto::AES>(totpSecret, oldSecret->ToByteArray<Acore::Crypto::AES::KEY_SIZE_BYTES>());
|
||||
if (!success)
|
||||
return Acore::StringFormat("Cannot decrypt old TOTP tokens - value of '%s' is incorrect for some users!", secret_info[i].oldKey);
|
||||
return Acore::StringFormat("Cannot decrypt old TOTP tokens - value of '{}' is incorrect for some users!", secret_info[i].oldKey);
|
||||
}
|
||||
|
||||
if (newSecret)
|
||||
|
||||
Reference in New Issue
Block a user