Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)

This commit is contained in:
Shauren
2023-01-08 21:16:53 +01:00
parent b6820a706f
commit d791afae1d
294 changed files with 4921 additions and 4944 deletions

View File

@@ -61,15 +61,15 @@ void CharacterDatabaseCleaner::CleanDatabase()
sWorld->SetCleaningFlags(flags);
TC_LOG_INFO("server.loading", ">> Cleaned character database in %u ms", GetMSTimeDiffToNow(oldMSTime));
TC_LOG_INFO("server.loading", ">> Cleaned character database in {} ms", GetMSTimeDiffToNow(oldMSTime));
}
void CharacterDatabaseCleaner::CheckUnique(char const* column, char const* table, bool (*check)(uint32))
{
QueryResult result = CharacterDatabase.PQuery("SELECT DISTINCT %s FROM %s", column, table);
QueryResult result = CharacterDatabase.PQuery("SELECT DISTINCT {} FROM {}", column, table);
if (!result)
{
TC_LOG_INFO("misc", "Table %s is empty.", table);
TC_LOG_INFO("misc", "Table {} is empty.", table);
return;
}
@@ -145,7 +145,7 @@ bool CharacterDatabaseCleaner::TalentCheck(uint32 talent_id)
void CharacterDatabaseCleaner::CleanCharacterTalent()
{
CharacterDatabase.DirectPExecute("DELETE FROM character_talent WHERE talentGroup > %u", MAX_SPECIALIZATIONS);
CharacterDatabase.DirectPExecute("DELETE FROM character_talent WHERE talentGroup > {}", MAX_SPECIALIZATIONS);
CheckUnique("talentId", "character_talent", &TalentCheck);
}