diff --git a/apps/Fmt/FormatReplace.py b/apps/Fmt/FormatReplace.py index a25a02ed5..89c88f3c6 100644 --- a/apps/Fmt/FormatReplace.py +++ b/apps/Fmt/FormatReplace.py @@ -27,19 +27,33 @@ def islog(line): else : return False -# def isSendSysMessage(line): -# substring = 'SendSysMessage' -# if substring in line: -# return True -# else : -# return False +def isSendErrorMessage(line): + substring = 'SendErrorMessage' + if substring in line: + return True + else : + return False -# def isPSendSysMessage(line): -# substring = 'PSendSysMessage' -# if substring in line: -# return True -# else : -# return False +def isSendWorldText(line): + substring = 'SendWorldText' + if substring in line: + return True + else : + return False + +def isSendSysMessage(line): + substring = 'SendSysMessage' + if substring in line: + return True + else : + return False + +def isPSendSysMessage(line): + substring = 'PSendSysMessage' + if substring in line: + return True + else : + return False def isPQuery(line): substring = 'PQuery' @@ -92,10 +106,14 @@ def checkSoloLine(line): elif isPAppend(line): line = line.replace("PAppend", "Append"); return handleCleanup(line), False - # elif isSendSysMessage(line): - # return handleCleanup(line), False - # elif isPSendSysMessage(line): - # return handleCleanup(line), False + elif isSendErrorMessage(line): + return handleCleanup(line), False + elif isSendWorldText(line): + return handleCleanup(line), False + elif isSendSysMessage(line): + return handleCleanup(line), False + elif isPSendSysMessage(line): + return handleCleanup(line), False # elif isStringFormat(line): # return handleCleanup(line), False else: @@ -109,10 +127,14 @@ def startMultiLine(line): return handleCleanup(line), True elif islog(line): return handleCleanup(line), True - # elif isSendSysMessage(line): - # return handleCleanup(line), True - # elif isPSendSysMessage(line): - # return handleCleanup(line), True + elif isSendErrorMessage(line): + return handleCleanup(line), True + elif isSendWorldText(line): + return handleCleanup(line), True + elif isSendSysMessage(line): + return handleCleanup(line), True + elif isPSendSysMessage(line): + return handleCleanup(line), True elif isPQuery(line): line = line.replace("PQuery", "Query"); return handleCleanup(line), True @@ -177,6 +199,7 @@ def handleCleanup(line): line = line.replace("%3.1f", "{:3.1f}"); line = line.replace("%%", "%"); line = line.replace(".c_str()", ""); + line = line.replace("->c_str()", ""); line = line.replace("\" SZFMTD \"", "{}"); line = line.replace("\" UI64FMTD \"", "{}"); # line = line.replace("\" STRING_VIEW_FMT \"", "{}"); diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index cef257d0f..ebc206fdb 100644 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -996,7 +996,7 @@ void BattlegroundQueue::BattlegroundQueueAnnouncerUpdate(uint32 diff, Battlegrou uint32 q_min_level = std::min(bracketEntry->minLevel, (uint32) 80); uint32 q_max_level = std::min(bracketEntry->maxLevel, (uint32) 80); - ChatHandler(nullptr).SendWorldTextOptional(LANG_BG_QUEUE_ANNOUNCE_WORLD, ANNOUNCER_FLAG_DISABLE_BG_QUEUE, bgName.c_str(), q_min_level, q_max_level, qPlayers, MaxPlayers); + ChatHandler(nullptr).SendWorldTextOptional(LANG_BG_QUEUE_ANNOUNCE_WORLD, ANNOUNCER_FLAG_DISABLE_BG_QUEUE, bgName, q_min_level, q_max_level, qPlayers, MaxPlayers); } else { @@ -1077,7 +1077,7 @@ void BattlegroundQueue::SendMessageBGQueue(Player* leader, Battleground* bg, PvP return; } - ChatHandler(nullptr).SendWorldTextOptional(LANG_BG_QUEUE_ANNOUNCE_WORLD, ANNOUNCER_FLAG_DISABLE_BG_QUEUE, bgName.c_str(), q_min_level, q_max_level, qAlliance + qHorde, MaxPlayers); + ChatHandler(nullptr).SendWorldTextOptional(LANG_BG_QUEUE_ANNOUNCE_WORLD, ANNOUNCER_FLAG_DISABLE_BG_QUEUE, bgName, q_min_level, q_max_level, qAlliance + qHorde, MaxPlayers); } } } @@ -1128,7 +1128,7 @@ void BattlegroundQueue::SendJoinMessageArenaQueue(Player* leader, GroupQueueInfo return; } - ChatHandler(nullptr).SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, bgName.c_str(), arenatype.c_str(), q_min_level, q_max_level, qPlayers, playersNeed); + ChatHandler(nullptr).SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, bgName, arenatype, q_min_level, q_max_level, qPlayers, playersNeed); } } else @@ -1147,7 +1147,7 @@ void BattlegroundQueue::SendJoinMessageArenaQueue(Player* leader, GroupQueueInfo switch (announcementDetail) { case 3: - ChatHandler(nullptr).SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN_NAME_RATING, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, TeamName.c_str(), ArenaType, ArenaType, ArenaTeamRating); + ChatHandler(nullptr).SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN_NAME_RATING, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, TeamName, ArenaType, ArenaType, ArenaTeamRating); break; case 2: ChatHandler(nullptr).SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN_NAME, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, TeamName, ArenaType, ArenaType); @@ -1187,7 +1187,7 @@ void BattlegroundQueue::SendExitMessageArenaQueue(GroupQueueInfo* ginfo) switch (announcementDetail) { case 3: - ChatHandler(nullptr).SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT_NAME_RATING, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, TeamName.c_str(), ArenaType, ArenaType, ArenaTeamRating); + ChatHandler(nullptr).SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT_NAME_RATING, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, TeamName, ArenaType, ArenaType, ArenaTeamRating); break; case 2: ChatHandler(nullptr).SendWorldTextOptional(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT_NAME, ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, TeamName, ArenaType, ArenaType); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index cbaa8b1ec..20756ab7c 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2366,7 +2366,7 @@ void Aura::LoadScripts() m_loadedScripts.erase(bitr); continue; } - LOG_DEBUG("spells.aura", "Aura::LoadScripts: Script `{}` for aura `{}` is loaded now", (*itr)->_GetScriptName()->c_str(), m_spellInfo->Id); + LOG_DEBUG("spells.aura", "Aura::LoadScripts: Script `{}` for aura `{}` is loaded now", (*itr)->_GetScriptName(), m_spellInfo->Id); (*itr)->Register(); ++itr; } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index a57ceca6c..77c7b48e1 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -8493,7 +8493,7 @@ void Spell::LoadScripts() m_loadedScripts.erase(bitr); continue; } - LOG_DEBUG("spells.aura", "Spell::LoadScripts: Script `{}` for spell `{}` is loaded now", (*itr)->_GetScriptName()->c_str(), m_spellInfo->Id); + LOG_DEBUG("spells.aura", "Spell::LoadScripts: Script `{}` for spell `{}` is loaded now", (*itr)->_GetScriptName(), m_spellInfo->Id); (*itr)->Register(); ++itr; } diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 7f072edbe..7acdba59a 100644 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -25,7 +25,7 @@ bool _SpellScript::_Validate(SpellInfo const* entry) { if (!Validate(entry)) { - LOG_ERROR("scripts.spells", "_SpellScript::_Validate: Spell `{}` did not pass Validate() function of script `{}` - script will not be added to the spell", entry->Id, m_scriptName->c_str()); + LOG_ERROR("scripts.spells", "_SpellScript::_Validate: Spell `{}` did not pass Validate() function of script `{}` - script will not be added to the spell", entry->Id, m_scriptName); return false; } return true; @@ -317,31 +317,31 @@ bool SpellScript::_Validate(SpellInfo const* entry) { for (std::list::iterator itr = OnEffectLaunch.begin(); itr != OnEffectLaunch.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectLaunch` of SpellScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectLaunch` of SpellScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = OnEffectLaunchTarget.begin(); itr != OnEffectLaunchTarget.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectLaunchTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectLaunchTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = OnEffectHit.begin(); itr != OnEffectHit.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectHit` of SpellScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectHit` of SpellScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = OnEffectHitTarget.begin(); itr != OnEffectHitTarget.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectHitTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectHitTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = OnObjectAreaTargetSelect.begin(); itr != OnObjectAreaTargetSelect.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnObjectAreaTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnObjectAreaTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = OnObjectTargetSelect.begin(); itr != OnObjectTargetSelect.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnObjectTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnObjectTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = OnDestinationTargetSelect.begin(); itr != OnDestinationTargetSelect.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnDestinationTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnDestinationTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); return _SpellScript::_Validate(entry); } @@ -449,7 +449,7 @@ Unit* SpellScript::GetHitUnit() { if (!IsInTargetHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitUnit was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitUnit was called, but function has no effect in current hook!", m_scriptName, m_scriptSpellId); return nullptr; } return m_spell->unitTarget; @@ -459,7 +459,7 @@ Creature* SpellScript::GetHitCreature() { if (!IsInTargetHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitCreature was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitCreature was called, but function has no effect in current hook!", m_scriptName, m_scriptSpellId); return nullptr; } if (m_spell->unitTarget) @@ -472,7 +472,7 @@ Player* SpellScript::GetHitPlayer() { if (!IsInTargetHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitPlayer was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitPlayer was called, but function has no effect in current hook!", m_scriptName, m_scriptSpellId); return nullptr; } if (m_spell->unitTarget) @@ -485,7 +485,7 @@ Item* SpellScript::GetHitItem() { if (!IsInTargetHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitItem was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitItem was called, but function has no effect in current hook!", m_scriptName, m_scriptSpellId); return nullptr; } return m_spell->itemTarget; @@ -495,7 +495,7 @@ GameObject* SpellScript::GetHitGObj() { if (!IsInTargetHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitGObj was called, but function has no effect in current hook!", m_scriptName, m_scriptSpellId); return nullptr; } return m_spell->gameObjTarget; @@ -505,7 +505,7 @@ WorldLocation* SpellScript::GetHitDest() { if (!IsInEffectHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitDest was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitDest was called, but function has no effect in current hook!", m_scriptName, m_scriptSpellId); return nullptr; } return m_spell->destTarget; @@ -515,7 +515,7 @@ int32 SpellScript::GetHitDamage() { if (!IsInTargetHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitDamage was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitDamage was called, but function has no effect in current hook!", m_scriptName, m_scriptSpellId); return 0; } return m_spell->m_damage; @@ -525,7 +525,7 @@ void SpellScript::SetHitDamage(int32 damage) { if (!IsInTargetHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::SetHitDamage was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::SetHitDamage was called, but function has no effect in current hook!", m_scriptName, m_scriptSpellId); return; } m_spell->m_damage = damage; @@ -535,7 +535,7 @@ int32 SpellScript::GetHitHeal() { if (!IsInTargetHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitHeal was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitHeal was called, but function has no effect in current hook!", m_scriptName, m_scriptSpellId); return 0; } return m_spell->m_healing; @@ -545,7 +545,7 @@ void SpellScript::SetHitHeal(int32 heal) { if (!IsInTargetHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::SetHitHeal was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::SetHitHeal was called, but function has no effect in current hook!", m_scriptName, m_scriptSpellId); return; } m_spell->m_healing = heal; @@ -555,7 +555,7 @@ Aura* SpellScript::GetHitAura() { if (!IsInTargetHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitAura was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetHitAura was called, but function has no effect in current hook!", m_scriptName, m_scriptSpellId); return nullptr; } if (!m_spell->m_spellAura) @@ -569,7 +569,7 @@ void SpellScript::PreventHitAura() { if (!IsInTargetHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::PreventHitAura was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::PreventHitAura was called, but function has no effect in current hook!", m_scriptName, m_scriptSpellId); return; } if (m_spell->m_spellAura) @@ -580,7 +580,7 @@ void SpellScript::PreventHitEffect(SpellEffIndex effIndex) { if (!IsInHitPhase() && !IsInEffectHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::PreventHitEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::PreventHitEffect was called, but function has no effect in current hook!", m_scriptName, m_scriptSpellId); return; } m_hitPreventEffectMask |= 1 << effIndex; @@ -591,7 +591,7 @@ void SpellScript::PreventHitDefaultEffect(SpellEffIndex effIndex) { if (!IsInHitPhase() && !IsInEffectHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::PreventHitDefaultEffect was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::PreventHitDefaultEffect was called, but function has no effect in current hook!", m_scriptName, m_scriptSpellId); return; } m_hitPreventDefaultEffectMask |= 1 << effIndex; @@ -601,7 +601,7 @@ int32 SpellScript::GetEffectValue() const { if (!IsInEffectHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetEffectValue was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::GetEffectValue was called, but function has no effect in current hook!", m_scriptName, m_scriptSpellId); return 0; } return m_spell->damage; @@ -611,7 +611,7 @@ void SpellScript::SetEffectValue(int32 value) { if (!IsInEffectHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::SetEffectValue was called, but function has no effect in current hook!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::SetEffectValue was called, but function has no effect in current hook!", m_scriptName, m_scriptSpellId); return; } m_spell->damage = value; @@ -647,7 +647,7 @@ void SpellScript::SetCustomCastResultMessage(SpellCustomErrors result) { if (!IsInCheckCastHook()) { - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::SetCustomCastResultMessage was called while spell not in check cast phase!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}`: function SpellScript::SetCustomCastResultMessage was called while spell not in check cast phase!", m_scriptName, m_scriptSpellId); return; } @@ -663,99 +663,99 @@ bool AuraScript::_Validate(SpellInfo const* entry) { for (std::list::iterator itr = DoCheckAreaTarget.begin(); itr != DoCheckAreaTarget.end(); ++itr) if (!entry->HasAreaAuraEffect() && !entry->HasEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA)) - LOG_ERROR("spells.scripts", "Spell `{}` of script `{}` does not have area aura effect - handler bound to hook `DoCheckAreaTarget` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` of script `{}` does not have area aura effect - handler bound to hook `DoCheckAreaTarget` of AuraScript won't be executed", entry->Id, m_scriptName); for (std::list::iterator itr = OnDispel.begin(); itr != OnDispel.end(); ++itr) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) - LOG_ERROR("spells.scripts", "Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `OnDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `OnDispel` of AuraScript won't be executed", entry->Id, m_scriptName); for (std::list::iterator itr = AfterDispel.begin(); itr != AfterDispel.end(); ++itr) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) - LOG_ERROR("spells.scripts", "Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `AfterDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `AfterDispel` of AuraScript won't be executed", entry->Id, m_scriptName); for (std::list::iterator itr = OnEffectApply.begin(); itr != OnEffectApply.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = OnEffectRemove.begin(); itr != OnEffectRemove.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = AfterEffectApply.begin(); itr != AfterEffectApply.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `AfterEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `AfterEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = AfterEffectRemove.begin(); itr != AfterEffectRemove.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `AfterEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `AfterEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = OnEffectPeriodic.begin(); itr != OnEffectPeriodic.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = OnEffectUpdatePeriodic.begin(); itr != OnEffectUpdatePeriodic.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectUpdatePeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectUpdatePeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = DoEffectCalcAmount.begin(); itr != DoEffectCalcAmount.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `DoEffectCalcAmount` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `DoEffectCalcAmount` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = DoEffectCalcPeriodic.begin(); itr != DoEffectCalcPeriodic.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `DoEffectCalcPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `DoEffectCalcPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = DoEffectCalcSpellMod.begin(); itr != DoEffectCalcSpellMod.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `DoEffectCalcSpellMod` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `DoEffectCalcSpellMod` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = OnEffectAbsorb.begin(); itr != OnEffectAbsorb.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = AfterEffectAbsorb.begin(); itr != AfterEffectAbsorb.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `AfterEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `AfterEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = OnEffectManaShield.begin(); itr != OnEffectManaShield.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = AfterEffectManaShield.begin(); itr != AfterEffectManaShield.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `AfterEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `AfterEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = OnEffectSplit.begin(); itr != OnEffectSplit.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectSplit` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectSplit` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = DoCheckProc.begin(); itr != DoCheckProc.end(); ++itr) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) - LOG_ERROR("spells.scripts", "Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `DoCheckProc` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `DoCheckProc` of AuraScript won't be executed", entry->Id, m_scriptName); for (std::list::iterator itr = DoAfterCheckProc.begin(); itr != DoAfterCheckProc.end(); ++itr) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) - LOG_ERROR("spells.scripts", "Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `DoAfterCheckProc` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `DoAfterCheckProc` of AuraScript won't be executed", entry->Id, m_scriptName); for (std::list::iterator itr = DoPrepareProc.begin(); itr != DoPrepareProc.end(); ++itr) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) - LOG_ERROR("spells.scripts", "Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `DoPrepareProc` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `DoPrepareProc` of AuraScript won't be executed", entry->Id, m_scriptName); for (std::list::iterator itr = OnProc.begin(); itr != OnProc.end(); ++itr) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) - LOG_ERROR("spells.scripts", "Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `OnProc` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `OnProc` of AuraScript won't be executed", entry->Id, m_scriptName); for (std::list::iterator itr = AfterProc.begin(); itr != AfterProc.end(); ++itr) if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect()) - LOG_ERROR("spells.scripts", "Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `AfterProc` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` of script `{}` does not have apply aura effect - handler bound to hook `AfterProc` of AuraScript won't be executed", entry->Id, m_scriptName); for (std::list::iterator itr = OnEffectProc.begin(); itr != OnEffectProc.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectProc` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `OnEffectProc` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); for (std::list::iterator itr = AfterEffectProc.begin(); itr != AfterEffectProc.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) - LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `AfterEffectProc` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName->c_str()); + LOG_ERROR("spells.scripts", "Spell `{}` Effect `{}` of script `{}` did not match dbc effect data - handler bound to hook `AfterEffectProc` of AuraScript won't be executed", entry->Id, (*itr).ToString(), m_scriptName); return _SpellScript::_Validate(entry); } @@ -997,7 +997,7 @@ void AuraScript::PreventDefaultAction() m_defaultActionPrevented = true; break; default: - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}` AuraScript::PreventDefaultAction called in a hook in which the call won't have effect!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}` AuraScript::PreventDefaultAction called in a hook in which the call won't have effect!", m_scriptName, m_scriptSpellId); break; } } @@ -1185,7 +1185,7 @@ Unit* AuraScript::GetTarget() const case AURA_SCRIPT_HOOK_EFFECT_AFTER_PROC: return m_auraApplication->GetTarget(); default: - LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}` AuraScript::GetTarget called in a hook in which the call won't have effect!", m_scriptName->c_str(), m_scriptSpellId); + LOG_ERROR("spells.scripts", "Script: `{}` Spell: `{}` AuraScript::GetTarget called in a hook in which the call won't have effect!", m_scriptName, m_scriptSpellId); } return nullptr; diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index e4d2d94df..9d7335585 100644 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -407,7 +407,7 @@ void TicketMgr::ShowList(ChatHandler& handler, bool onlineOnly) const for (GmTicketList::const_iterator itr = _ticketList.begin(); itr != _ticketList.end(); ++itr) if (!itr->second->IsClosed() && !itr->second->IsCompleted()) if (!onlineOnly || itr->second->GetPlayer()) - handler.SendSysMessage(itr->second->FormatMessageString(handler).c_str()); + handler.SendSysMessage(itr->second->FormatMessageString(handler)); } void TicketMgr::ShowClosedList(ChatHandler& handler) const @@ -415,7 +415,7 @@ void TicketMgr::ShowClosedList(ChatHandler& handler) const handler.SendSysMessage(LANG_COMMAND_TICKETSHOWCLOSEDLIST); for (GmTicketList::const_iterator itr = _ticketList.begin(); itr != _ticketList.end(); ++itr) if (itr->second->IsClosed()) - handler.SendSysMessage(itr->second->FormatMessageString(handler).c_str()); + handler.SendSysMessage(itr->second->FormatMessageString(handler)); } void TicketMgr::ShowEscalatedList(ChatHandler& handler) const @@ -423,7 +423,7 @@ void TicketMgr::ShowEscalatedList(ChatHandler& handler) const handler.SendSysMessage(LANG_COMMAND_TICKETSHOWESCALATEDLIST); for (GmTicketList::const_iterator itr = _ticketList.begin(); itr != _ticketList.end(); ++itr) if (!itr->second->IsClosed() && itr->second->GetEscalatedStatus() == TICKET_IN_ESCALATION_QUEUE) - handler.SendSysMessage(itr->second->FormatMessageString(handler).c_str()); + handler.SendSysMessage(itr->second->FormatMessageString(handler)); } void TicketMgr::SendTicket(WorldSession* session, GmTicket* ticket) const diff --git a/src/server/scripts/Commands/PlayerCommand.cpp b/src/server/scripts/Commands/PlayerCommand.cpp index d4fd06796..ac0158bc9 100644 --- a/src/server/scripts/Commands/PlayerCommand.cpp +++ b/src/server/scripts/Commands/PlayerCommand.cpp @@ -37,7 +37,7 @@ bool Acore::PlayerCommand::HandleLearnSpellCommand(ChatHandler* handler, Player* } else { - handler->SendErrorMessage(LANG_TARGET_KNOWN_SPELL, handler->GetNameLink(targetPlayer).c_str()); + handler->SendErrorMessage(LANG_TARGET_KNOWN_SPELL, handler->GetNameLink(targetPlayer)); } return false; diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 9e908b632..fa8a5802a 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -164,7 +164,7 @@ public: } // new suggestion, or no token specified, output TOTP parameters - handler->SendErrorMessage(LANG_2FA_SECRET_SUGGESTION, Acore::Encoding::Base32::Encode(pair.first->second).c_str()); + handler->SendErrorMessage(LANG_2FA_SECRET_SUGGESTION, Acore::Encoding::Base32::Encode(pair.first->second)); return false; } @@ -328,14 +328,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 accountId = AccountMgr::GetId(accountName); if (!accountId) { - handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str()); + handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName); return false; } @@ -352,13 +352,13 @@ public: handler->PSendSysMessage(LANG_ACCOUNT_DELETED, accountName); 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_DB_INTERNAL_ERROR: - handler->SendErrorMessage(LANG_ACCOUNT_NOT_DELETED_SQL_ERROR, accountName.c_str()); + handler->SendErrorMessage(LANG_ACCOUNT_NOT_DELETED_SQL_ERROR, accountName); return false; default: - handler->SendErrorMessage(LANG_ACCOUNT_NOT_DELETED, accountName.c_str()); + handler->SendErrorMessage(LANG_ACCOUNT_NOT_DELETED, accountName); return false; } diff --git a/src/server/scripts/Commands/cs_bag.cpp b/src/server/scripts/Commands/cs_bag.cpp index 874405dcf..63cdd5ed3 100644 --- a/src/server/scripts/Commands/cs_bag.cpp +++ b/src/server/scripts/Commands/cs_bag.cpp @@ -148,7 +148,7 @@ public: str << " items from your bags."; - handler->SendSysMessage(str.str().c_str()); + handler->SendSysMessage(str.str()); return true; }; diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp index 92d4a3683..e95878ea8 100644 --- a/src/server/scripts/Commands/cs_ban.cpp +++ b/src/server/scripts/Commands/cs_ban.cpp @@ -444,7 +444,7 @@ public: if (banResult) { Field* fields2 = banResult->Fetch(); - handler->PSendSysMessage("%s", fields2[0].Get()); + handler->PSendSysMessage("{}", fields2[0].Get()); } } while (result->NextRow()); } @@ -480,14 +480,14 @@ public: if (fields2[0].Get() == fields2[1].Get()) { - handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|", + handler->PSendSysMessage("|%-15.15s|{:02}-{:02}-{:02} {:02}:{:02}| permanent |%-15.15s|%-15.15s|", accountName, tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min, fields2[2].Get(), fields2[3].Get()); } else { tm tmUnban = Acore::Time::TimeBreakdown(fields2[1].Get()); - handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|", + handler->PSendSysMessage("|%-15.15s|{:02}-{:02}-{:02} {:02}:{:02}|{:02}-{:02}-{:02} {:02}:{:02}|%-15.15s|%-15.15s|", accountName, tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min, tmUnban.tm_year % 100, tmUnban.tm_mon + 1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min, fields2[2].Get(), fields2[3].Get()); @@ -534,7 +534,7 @@ public: PreparedQueryResult banResult = CharacterDatabase.Query(stmt2); if (banResult) - handler->PSendSysMessage("%s", (*banResult)[0].Get()); + handler->PSendSysMessage("{}", (*banResult)[0].Get()); } while (result->NextRow()); } // Console wide output @@ -564,14 +564,14 @@ public: if (banFields[0].Get() == banFields[1].Get()) { - handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|", + handler->PSendSysMessage("|%-15.15s|{:02}-{:02}-{:02} {:02}:{:02}| permanent |%-15.15s|%-15.15s|", char_name, tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min, banFields[2].Get(), banFields[3].Get()); } else { tm tmUnban = Acore::Time::TimeBreakdown(banFields[1].Get()); - handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|", + handler->PSendSysMessage("|%-15.15s|{:02}-{:02}-{:02} {:02}:{:02}|{:02}-{:02}-{:02} {:02}:{:02}|%-15.15s|%-15.15s|", char_name, tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min, tmUnban.tm_year % 100, tmUnban.tm_mon + 1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min, banFields[2].Get(), banFields[3].Get()); @@ -621,7 +621,7 @@ public: do { Field* fields = result->Fetch(); - handler->PSendSysMessage("%s", fields[0].Get()); + handler->PSendSysMessage("{}", fields[0].Get()); } while (result->NextRow()); } // Console wide output @@ -637,14 +637,14 @@ public: tm tmBan = Acore::Time::TimeBreakdown(fields[1].Get()); if (fields[1].Get() == fields[2].Get()) { - handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|", + handler->PSendSysMessage("|%-15.15s|{:02}-{:02}-{:02} {:02}:{:02}| permanent |%-15.15s|%-15.15s|", fields[0].Get(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min, fields[3].Get(), fields[4].Get()); } else { tm tmUnban = Acore::Time::TimeBreakdown(fields[2].Get()); - handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|", + handler->PSendSysMessage("|%-15.15s|{:02}-{:02}-{:02} {:02}:{:02}|{:02}-{:02}-{:02} {:02}:{:02}|%-15.15s|%-15.15s|", fields[0].Get(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min, tmUnban.tm_year % 100, tmUnban.tm_mon + 1, tmUnban.tm_mday, tmUnban.tm_hour, tmUnban.tm_min, fields[3].Get(), fields[4].Get()); diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index 44d14e6e6..5d42492c2 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -570,7 +570,7 @@ public: if (faction.Flags & FACTION_FLAG_INACTIVE) ss << handler->GetAcoreString(LANG_FACTION_INACTIVE); - handler->SendSysMessage(ss.str().c_str()); + handler->SendSysMessage(ss.str()); } return true; diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 286282bd3..8712af111 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -535,7 +535,7 @@ public: if (!listQueue && !checkAll) { itemState = "The player has the following " + itemState + " items: "; - handler->SendSysMessage(itemState.c_str()); + handler->SendSysMessage(itemState); for (uint8 i = PLAYER_SLOT_START; i < PLAYER_SLOT_END; ++i) { if (i >= BUYBACK_SLOT_START && i < BUYBACK_SLOT_END) @@ -941,7 +941,7 @@ public: while (ss.str().size() < 128000) ss << "This is a dummy string to push the packet's size beyond 128000 bytes. "; - handler->SendSysMessage(ss.str().c_str()); + handler->SendSysMessage(ss.str()); return true; } diff --git a/src/server/scripts/Commands/cs_inventory.cpp b/src/server/scripts/Commands/cs_inventory.cpp index 09dc88381..d7f74856b 100644 --- a/src/server/scripts/Commands/cs_inventory.cpp +++ b/src/server/scripts/Commands/cs_inventory.cpp @@ -173,7 +173,7 @@ public: str << "."; - handler->SendSysMessage(str.str().c_str()); + handler->SendSysMessage(str.str()); return true; } diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index d64065bcc..b404be16a 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -153,7 +153,7 @@ public: ss << areaEntry->ID << " - " << name << ' ' << localeNames[locale]; } - handler->SendSysMessage(ss.str().c_str()); + handler->SendSysMessage(ss.str()); if (!found) { @@ -455,7 +455,7 @@ public: ss << handler->GetAcoreString(LANG_FACTION_NOREPUTATION); } - handler->SendSysMessage(ss.str().c_str()); + handler->SendSysMessage(ss.str()); if (!found) { @@ -1147,7 +1147,7 @@ public: ss << handler->GetAcoreString(LANG_ACTIVE); } - handler->SendSysMessage(ss.str().c_str()); + handler->SendSysMessage(ss.str()); if (!found) { @@ -1262,7 +1262,7 @@ public: ss << handler->GetAcoreString(LANG_ACTIVE); } - handler->SendSysMessage(ss.str().c_str()); + handler->SendSysMessage(ss.str()); if (!found) { @@ -1587,7 +1587,7 @@ public: break; } - handler->SendSysMessage(ss.str().c_str()); + handler->SendSysMessage(ss.str()); ++counter; } diff --git a/src/server/scripts/Commands/cs_message.cpp b/src/server/scripts/Commands/cs_message.cpp index dd42ce23d..7901825c2 100644 --- a/src/server/scripts/Commands/cs_message.cpp +++ b/src/server/scripts/Commands/cs_message.cpp @@ -170,12 +170,12 @@ public: if (Player* player = ObjectAccessor::FindPlayerByName(*playerNameArg)) { handler->GetSession()->GetPlayer()->RemoveFromWhisperWhiteList(player->GetGUID()); - handler->PSendSysMessage(LANG_COMMAND_WHISPEROFFPLAYER, playerNameArg->c_str()); + handler->PSendSysMessage(LANG_COMMAND_WHISPEROFFPLAYER, playerNameArg); return true; } else { - handler->SendErrorMessage(LANG_PLAYER_NOT_FOUND, playerNameArg->c_str()); + handler->SendErrorMessage(LANG_PLAYER_NOT_FOUND, playerNameArg); return false; } } diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 57ac36b43..e1718556a 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -627,7 +627,7 @@ public: if (object->GetTransport()) { - handler->PSendSysMessage("Transport offset: %.2f, %.2f, %.2f, %.2f", object->m_movementInfo.transport.pos.GetPositionX(), object->m_movementInfo.transport.pos.GetPositionY(), object->m_movementInfo.transport.pos.GetPositionZ(), object->m_movementInfo.transport.pos.GetOrientation()); + handler->PSendSysMessage("Transport offset: {0:.2f}, {0:.2f}, {0:.2f}, {0:.2f}", object->m_movementInfo.transport.pos.GetPositionX(), object->m_movementInfo.transport.pos.GetPositionY(), object->m_movementInfo.transport.pos.GetPositionZ(), object->m_movementInfo.transport.pos.GetOrientation()); } return true; diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp index dba16fab4..76201a55c 100644 --- a/src/server/scripts/Commands/cs_mmaps.cpp +++ b/src/server/scripts/Commands/cs_mmaps.cpp @@ -217,7 +217,7 @@ public: static bool HandleMmapStatsCommand(ChatHandler* handler) { handler->PSendSysMessage("mmap stats:"); - //handler->PSendSysMessage(" global mmap pathfinding is %sabled", DisableMgr::IsPathfindingEnabled(mapId) ? "en" : "dis"); + //handler->PSendSysMessage(" global mmap pathfinding is {}abled", DisableMgr::IsPathfindingEnabled(mapId) ? "en" : "dis"); MMAP::MMapMgr* manager = MMAP::MMapFactory::createOrGetMMapMgr(); handler->PSendSysMessage(" {} maps loaded with {} tiles overall", manager->getLoadedMapsCount(), manager->getLoadedTilesCount()); diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 91a8706ff..5daec38e7 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -409,7 +409,7 @@ public: if (player->IsInFlight() && checkInFlight) { - handler->SendErrorMessage(LANG_CHAR_IN_FLIGHT, handler->GetNameLink(player).c_str()); + handler->SendErrorMessage(LANG_CHAR_IN_FLIGHT, handler->GetNameLink(player)); return false; } } @@ -799,7 +799,7 @@ public: if (r >= MAX_REPUTATION_RANK) { - handler->SendErrorMessage(LANG_COMMAND_FACTION_INVPARAM, rankStr.c_str()); + handler->SendErrorMessage(LANG_COMMAND_FACTION_INVPARAM, rankStr); return false; } } diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index c06d9a3d9..c88b3c638 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -796,7 +796,7 @@ public: if (!sCreatureDisplayInfoStore.LookupEntry(displayId)) { - handler->SendErrorMessage(LANG_COMMAND_FACTION_INVPARAM, Acore::ToString(displayId).c_str()); + handler->SendErrorMessage(LANG_COMMAND_FACTION_INVPARAM, Acore::ToString(displayId)); return false; } @@ -1086,7 +1086,7 @@ public: if (/*creature->GetMotionMaster()->empty() ||*/ creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FOLLOW_MOTION_TYPE) { - handler->SendErrorMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName().c_str()); + handler->SendErrorMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName()); return false; } @@ -1094,7 +1094,7 @@ public: if (mgen->GetTarget() != player) { - handler->SendErrorMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName().c_str()); + handler->SendErrorMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName()); return false; } @@ -1259,7 +1259,7 @@ public: if (!sObjectMgr->SetCreatureLinkedRespawn(creature->GetSpawnId(), linkguid)) { - handler->SendErrorMessage("Selected creature can't link with guid '%u'", linkguid); + handler->SendErrorMessage("Selected creature can't link with guid '{}'", linkguid); return false; } diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index 1434f2e6b..93113cf66 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -81,7 +81,7 @@ public: { if (player->IsActiveQuest(entry)) { - handler->SendErrorMessage(LANG_COMMAND_QUEST_ACTIVE, quest->GetTitle().c_str(), entry); + handler->SendErrorMessage(LANG_COMMAND_QUEST_ACTIVE, quest->GetTitle(), entry); return false; } @@ -98,7 +98,7 @@ public: if (result) { - handler->SendErrorMessage(LANG_COMMAND_QUEST_ACTIVE, quest->GetTitle().c_str(), entry); + handler->SendErrorMessage(LANG_COMMAND_QUEST_ACTIVE, quest->GetTitle(), entry); return false; } diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index 259fd89ad..3ce61f99f 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -130,7 +130,7 @@ public: if (target->IsBeingTeleported()) { - handler->SendErrorMessage(LANG_IS_TELEPORTED, chrNameLink.c_str()); + handler->SendErrorMessage(LANG_IS_TELEPORTED, chrNameLink); return false; } @@ -233,7 +233,7 @@ public: Group* grp = target->GetGroup(); if (!grp) { - handler->SendErrorMessage(LANG_NOT_IN_GROUP, nameLink.c_str()); + handler->SendErrorMessage(LANG_NOT_IN_GROUP, nameLink); return false; } @@ -256,7 +256,7 @@ public: continue; } - handler->PSendSysMessage(LANG_TELEPORTING_TO, plNameLink.c_str(), "", tele->name); + handler->PSendSysMessage(LANG_TELEPORTING_TO, plNameLink, "", tele->name); if (handler->needReportToTarget(player)) ChatHandler(player->GetSession()).PSendSysMessage(LANG_TELEPORTED_TO_BY, nameLink);