diff options
Diffstat (limited to 'src/server/scripts')
38 files changed, 164 insertions, 165 deletions
diff --git a/src/server/scripts/Battlefield/BattlefieldWG.cpp b/src/server/scripts/Battlefield/BattlefieldWG.cpp index e1302b05b2a..529e75c6af9 100644 --- a/src/server/scripts/Battlefield/BattlefieldWG.cpp +++ b/src/server/scripts/Battlefield/BattlefieldWG.cpp @@ -808,7 +808,7 @@ uint8 BattlefieldWG::GetSpiritGraveyardId(uint32 areaId) const case AREA_THE_CHILLED_QUAGMIRE: return BATTLEFIELD_WG_GY_HORDE; default: - TC_LOG_ERROR("bg.battlefield", "BattlefieldWG::GetSpiritGraveyardId: Unexpected Area Id %u", areaId); + TC_LOG_ERROR("bg.battlefield", "BattlefieldWG::GetSpiritGraveyardId: Unexpected Area Id {}", areaId); break; } diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 111beebe989..41664a47f20 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -109,7 +109,7 @@ public: if (!result) { - TC_LOG_ERROR("misc", "Account %u not found in login database when processing .account 2fa setup command.", accountId); + TC_LOG_ERROR("misc", "Account {} not found in login database when processing .account 2fa setup command.", accountId); handler->SendSysMessage(LANG_UNKNOWN_ERROR); handler->SetSentErrorMessage(true); return false; @@ -173,7 +173,7 @@ public: if (!result) { - TC_LOG_ERROR("misc", "Account %u not found in login database when processing .account 2fa setup command.", accountId); + TC_LOG_ERROR("misc", "Account {} not found in login database when processing .account 2fa setup command.", accountId); handler->SendSysMessage(LANG_UNKNOWN_ERROR); handler->SetSentErrorMessage(true); return false; @@ -197,7 +197,7 @@ public: bool success = Trinity::Crypto::AEDecrypt<Trinity::Crypto::AES>(secret, *masterKey); if (!success) { - TC_LOG_ERROR("misc", "Account %u has invalid ciphertext in TOTP token.", accountId); + TC_LOG_ERROR("misc", "Account {} has invalid ciphertext in TOTP token.", accountId); handler->SendSysMessage(LANG_UNKNOWN_ERROR); handler->SetSentErrorMessage(true); return false; @@ -258,10 +258,10 @@ public: handler->PSendSysMessage(LANG_ACCOUNT_CREATED, accountName); if (handler->GetSession()) { - TC_LOG_INFO("entities.player.character", "Account: %d (IP: %s) Character:[%s] %s) created Account %s (Email: '%s')", - handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(), - handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUID().ToString().c_str(), - accountName.c_str(), email.value_or("").c_str()); + TC_LOG_INFO("entities.player.character", "Account: {} (IP: {}) Character:[{}] {}) created Account {} (Email: '{}')", + handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress(), + handler->GetSession()->GetPlayer()->GetName(), handler->GetSession()->GetPlayer()->GetGUID().ToString(), + accountName, email.value_or("")); } break; case AccountOpResult::AOR_NAME_TOO_LONG: @@ -485,10 +485,10 @@ public: handler->SendSysMessage(LANG_COMMAND_WRONGEMAIL); sScriptMgr->OnFailedEmailChange(handler->GetSession()->GetAccountId()); handler->SetSentErrorMessage(true); - TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Character:[%s] %s Tried to change email, but the provided email [%s] is not equal to registration email [%s].", - handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(), - handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUID().ToString().c_str(), - email.c_str(), oldEmail.c_str()); + TC_LOG_INFO("entities.player.character", "Account: {} (IP: {}) Character:[{}] {} Tried to change email, but the provided email [{}] is not equal to registration email [{}].", + handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress(), + handler->GetSession()->GetPlayer()->GetName(), handler->GetSession()->GetPlayer()->GetGUID().ToString(), + email, oldEmail); return false; } @@ -497,9 +497,9 @@ public: handler->SendSysMessage(LANG_COMMAND_WRONGOLDPASSWORD); sScriptMgr->OnFailedEmailChange(handler->GetSession()->GetAccountId()); handler->SetSentErrorMessage(true); - TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Character:[%s] %s Tried to change email, but the provided password is wrong.", - handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(), - handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUID().ToString().c_str()); + TC_LOG_INFO("entities.player.character", "Account: {} (IP: {}) Character:[{}] {} Tried to change email, but the provided password is wrong.", + handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress(), + handler->GetSession()->GetPlayer()->GetName(), handler->GetSession()->GetPlayer()->GetGUID().ToString()); return false; } @@ -516,9 +516,9 @@ public: handler->SendSysMessage(LANG_NEW_EMAILS_NOT_MATCH); sScriptMgr->OnFailedEmailChange(handler->GetSession()->GetAccountId()); handler->SetSentErrorMessage(true); - TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Character:[%s] %s Tried to change email, but the confirm email does not match.", - handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(), - handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUID().ToString().c_str()); + TC_LOG_INFO("entities.player.character", "Account: {} (IP: {}) Character:[{}] {} Tried to change email, but the confirm email does not match.", + handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress(), + handler->GetSession()->GetPlayer()->GetName(), handler->GetSession()->GetPlayer()->GetGUID().ToString()); return false; } @@ -528,10 +528,10 @@ public: case AccountOpResult::AOR_OK: handler->SendSysMessage(LANG_COMMAND_EMAIL); sScriptMgr->OnEmailChange(handler->GetSession()->GetAccountId()); - TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Character:[%s] %s Changed Email from [%s] to [%s].", - handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(), - handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUID().ToString().c_str(), - oldEmail.c_str(), email.c_str()); + TC_LOG_INFO("entities.player.character", "Account: {} (IP: {}) Character:[{}] {} Changed Email from [{}] to [{}].", + handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress(), + handler->GetSession()->GetPlayer()->GetName(), handler->GetSession()->GetPlayer()->GetGUID().ToString(), + oldEmail, email); break; case AccountOpResult::AOR_EMAIL_TOO_LONG: handler->SendSysMessage(LANG_EMAIL_TOO_LONG); @@ -558,9 +558,9 @@ public: handler->SendSysMessage(LANG_COMMAND_WRONGOLDPASSWORD); sScriptMgr->OnFailedPasswordChange(handler->GetSession()->GetAccountId()); handler->SetSentErrorMessage(true); - TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Character:[%s] %s Tried to change password, but the provided old password is wrong.", - handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(), - handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUID().ToString().c_str()); + TC_LOG_INFO("entities.player.character", "Account: {} (IP: {}) Character:[{}] {} Tried to change password, but the provided old password is wrong.", + handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress(), + handler->GetSession()->GetPlayer()->GetName(), handler->GetSession()->GetPlayer()->GetGUID().ToString()); return false; } @@ -571,10 +571,10 @@ public: handler->SendSysMessage(LANG_COMMAND_WRONGEMAIL); sScriptMgr->OnFailedPasswordChange(handler->GetSession()->GetAccountId()); handler->SetSentErrorMessage(true); - TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Character:[%s] %s Tried to change password, but the entered email [%s] is wrong.", - handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(), - handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUID().ToString().c_str(), - confirmEmail.value_or("").c_str()); + TC_LOG_INFO("entities.player.character", "Account: {} (IP: {}) Character:[{}] {} Tried to change password, but the entered email [{}] is wrong.", + handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress(), + handler->GetSession()->GetPlayer()->GetName(), handler->GetSession()->GetPlayer()->GetGUID().ToString(), + confirmEmail.value_or("")); return false; } @@ -594,9 +594,9 @@ public: case AccountOpResult::AOR_OK: handler->SendSysMessage(LANG_COMMAND_PASSWORD); sScriptMgr->OnPasswordChange(handler->GetSession()->GetAccountId()); - TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Character:[%s] %s changed password.", - handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(), - handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUID().ToString().c_str()); + TC_LOG_INFO("entities.player.character", "Account: {} (IP: {}) Character:[{}] {} changed password.", + handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress(), + handler->GetSession()->GetPlayer()->GetName(), handler->GetSession()->GetPlayer()->GetGUID().ToString()); break; case AccountOpResult::AOR_PASS_TOO_LONG: handler->SendSysMessage(LANG_PASSWORD_TOO_LONG); @@ -944,8 +944,8 @@ public: { case AccountOpResult::AOR_OK: handler->SendSysMessage(LANG_COMMAND_EMAIL); - TC_LOG_INFO("entities.player.character", "ChangeEmail: Account %s [Id: %u] had it's email changed to %s.", - accountName.c_str(), targetAccountId, email.c_str()); + TC_LOG_INFO("entities.player.character", "ChangeEmail: Account {} [Id: {}] had it's email changed to {}.", + accountName, targetAccountId, email); break; case AccountOpResult::AOR_NAME_NOT_EXIST: handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str()); @@ -999,8 +999,8 @@ public: { case AccountOpResult::AOR_OK: handler->SendSysMessage(LANG_COMMAND_EMAIL); - TC_LOG_INFO("entities.player.character", "ChangeRegEmail: Account %s [Id: %u] had it's Registration Email changed to %s.", - accountName.c_str(), targetAccountId, email.c_str()); + TC_LOG_INFO("entities.player.character", "ChangeRegEmail: Account {} [Id: {}] had it's Registration Email changed to {}.", + accountName, targetAccountId, email); break; case AccountOpResult::AOR_NAME_NOT_EXIST: handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str()); diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp index c2318c616f5..d3abce72b30 100644 --- a/src/server/scripts/Commands/cs_ban.cpp +++ b/src/server/scripts/Commands/cs_ban.cpp @@ -277,7 +277,7 @@ public: static bool HandleBanInfoHelper(uint32 accountId, char const* accountName, ChatHandler* handler) { - QueryResult result = LoginDatabase.PQuery("SELECT FROM_UNIXTIME(bandate), unbandate-bandate, active, unbandate, banreason, bannedby FROM account_banned WHERE id = '%u' ORDER BY bandate ASC", accountId); + QueryResult result = LoginDatabase.PQuery("SELECT FROM_UNIXTIME(bandate), unbandate-bandate, active, unbandate, banreason, bannedby FROM account_banned WHERE id = '{}' ORDER BY bandate ASC", accountId); if (!result) { handler->PSendSysMessage(LANG_BANINFO_NOACCOUNTBAN, accountName); @@ -376,7 +376,7 @@ public: std::string IP = ipStr; LoginDatabase.EscapeString(IP); - QueryResult result = LoginDatabase.PQuery("SELECT ip, FROM_UNIXTIME(bandate), FROM_UNIXTIME(unbandate), unbandate-UNIX_TIMESTAMP(), banreason, bannedby, unbandate-bandate FROM ip_banned WHERE ip = '%s'", IP.c_str()); + QueryResult result = LoginDatabase.PQuery("SELECT ip, FROM_UNIXTIME(bandate), FROM_UNIXTIME(unbandate), unbandate-UNIX_TIMESTAMP(), banreason, bannedby, unbandate-bandate FROM ip_banned WHERE ip = '{}'", IP); if (!result) { handler->PSendSysMessage(LANG_BANINFO_NOIP); @@ -437,7 +437,7 @@ public: Field* fields = result->Fetch(); uint32 accountid = fields[0].GetUInt32(); - QueryResult banResult = LoginDatabase.PQuery("SELECT account.username FROM account, account_banned WHERE account_banned.id='%u' AND account_banned.id = account.id", accountid); + QueryResult banResult = LoginDatabase.PQuery("SELECT account.username FROM account, account_banned WHERE account_banned.id='{}' AND account_banned.id = account.id", accountid); if (banResult) { Field* fields2 = banResult->Fetch(); @@ -468,7 +468,7 @@ public: AccountMgr::GetName(accountId, accountName); // No SQL injection. id is uint32. - QueryResult banInfo = LoginDatabase.PQuery("SELECT bandate, unbandate, bannedby, banreason FROM account_banned WHERE id = %u ORDER BY unbandate", accountId); + QueryResult banInfo = LoginDatabase.PQuery("SELECT bandate, unbandate, bannedby, banreason FROM account_banned WHERE id = {} ORDER BY unbandate", accountId); if (banInfo) { Field* fields2 = banInfo->Fetch(); diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index d5a6e348ae2..4ebe7e0f9b6 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -269,7 +269,7 @@ public: if (target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->MaskID) activeStr = handler->GetTrinityString(LANG_ACTIVE); - std::string titleName = Trinity::StringFormat(name, player->GetName().c_str()); + std::string titleName = fmt::sprintf(name, player->GetName()); // send title in "id (idx:idx) - [namedlink locale]" format if (handler->GetSession()) @@ -360,10 +360,10 @@ public: if (WorldSession* session = handler->GetSession()) { if (Player* player = session->GetPlayer()) - sLog->outCommand(session->GetAccountId(), "GM %s (Account: %u) forced rename %s to player %s (Account: %u)", player->GetName().c_str(), session->GetAccountId(), newName.c_str(), player->GetName().c_str(), sCharacterCache->GetCharacterAccountIdByGuid(player->GetGUID())); + sLog->OutCommand(session->GetAccountId(), "GM %s (Account: %u) forced rename %s to player %s (Account: %u)", player->GetName().c_str(), session->GetAccountId(), newName.c_str(), player->GetName().c_str(), sCharacterCache->GetCharacterAccountIdByGuid(player->GetGUID())); } else - sLog->outCommand(0, "CONSOLE forced rename '%s' to '%s' (%s)", player->GetName().c_str(), newName.c_str(), player->GetGUID().ToString().c_str()); + sLog->OutCommand(0, "CONSOLE forced rename '%s' to '%s' (%s)", player->GetName().c_str(), newName.c_str(), player->GetGUID().ToString().c_str()); } else { @@ -508,14 +508,14 @@ public: handler->PSendSysMessage(LANG_CHANGEACCOUNT_SUCCESS, player->GetName().c_str(), newAccount.GetName().c_str()); - std::string logString = Trinity::StringFormat("changed ownership of player %s (%s) from account %u to account %u", player->GetName().c_str(), player->GetGUID().ToString().c_str(), oldAccountId, newAccount.GetID()); + std::string logString = Trinity::StringFormat("changed ownership of player {} ({}) from account {} to account {}", player->GetName(), player->GetGUID().ToString(), oldAccountId, newAccount.GetID()); if (WorldSession* session = handler->GetSession()) { if (Player* player = session->GetPlayer()) - sLog->outCommand(session->GetAccountId(), "GM %s (Account: %u) %s", player->GetName().c_str(), session->GetAccountId(), logString.c_str()); + sLog->OutCommand(session->GetAccountId(), "GM %s (Account: %u) %s", player->GetName().c_str(), session->GetAccountId(), logString.c_str()); } else - sLog->outCommand(0, "%s %s", handler->GetTrinityString(LANG_CONSOLE), logString.c_str()); + sLog->OutCommand(0, "%s %s", handler->GetTrinityString(LANG_CONSOLE), logString.c_str()); return true; } diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 05d970cf4a9..e6f44cc4762 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -445,11 +445,11 @@ public: } else { - TC_LOG_ERROR("misc", "Sending opcode that has unknown type '%s'", type.c_str()); + TC_LOG_ERROR("misc", "Sending opcode that has unknown type '{}'", type); break; } } - TC_LOG_DEBUG("network", "Sending opcode %u", data.GetOpcode()); + TC_LOG_DEBUG("network", "Sending opcode {}", data.GetOpcode()); data.hexlike(); player->SendDirectMessage(&data); handler->PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName().c_str()); @@ -1164,12 +1164,12 @@ public: if (value.holds_alternative<uint32>()) { target->SetUInt32Value(index, value.get<uint32>()); - handler->PSendSysMessage(LANG_SET_UINT_FIELD, target->GetGUID().GetCounter(), index, value); + handler->PSendSysMessage(LANG_SET_UINT_FIELD, target->GetGUID().GetCounter(), index, value.get<uint32>()); } else if (value.holds_alternative<float>()) { target->SetFloatValue(index, value.get<float>()); - handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, target->GetGUID().GetCounter(), index, value); + handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, target->GetGUID().GetCounter(), index, value.get<float>()); } return true; @@ -1341,7 +1341,7 @@ public: { Player* player = handler->GetPlayer(); - TC_LOG_INFO("sql.dev", "(@PATH, XX, %.3f, %.3f, %.5f, %.5f, 0, 0, 0, 100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation()); + TC_LOG_INFO("sql.dev", "(@PATH, XX, {:.3f}, {:.3f}, {:.5f}, {:.5f}, 0, 0, 0, 100, 0),", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetOrientation()); handler->PSendSysMessage("Waypoint SQL written to SQL Developer log"); return true; diff --git a/src/server/scripts/Commands/cs_event.cpp b/src/server/scripts/Commands/cs_event.cpp index f13592aa3aa..225ae5ce515 100644 --- a/src/server/scripts/Commands/cs_event.cpp +++ b/src/server/scripts/Commands/cs_event.cpp @@ -81,7 +81,7 @@ public: return true; } - static bool HandleEventInfoCommand(ChatHandler* handler, Variant<Hyperlink<gameevent>, uint16> const eventId) + static bool HandleEventInfoCommand(ChatHandler* handler, Variant<Hyperlink<gameevent>, uint16> eventId) { GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap(); @@ -92,7 +92,7 @@ public: return false; } - GameEventData const& eventData = events[eventId]; + GameEventData const& eventData = events[*eventId]; if (!eventData.isValid()) { handler->SendSysMessage(LANG_EVENT_NOT_EXIST); @@ -120,7 +120,7 @@ public: return true; } - static bool HandleEventStartCommand(ChatHandler* handler, Variant<Hyperlink<gameevent>, uint16> const eventId) + static bool HandleEventStartCommand(ChatHandler* handler, Variant<Hyperlink<gameevent>, uint16> eventId) { GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap(); @@ -131,7 +131,7 @@ public: return false; } - GameEventData const& eventData = events[eventId]; + GameEventData const& eventData = events[*eventId]; if (!eventData.isValid()) { handler->SendSysMessage(LANG_EVENT_NOT_EXIST); @@ -151,7 +151,7 @@ public: return true; } - static bool HandleEventStopCommand(ChatHandler* handler, Variant<Hyperlink<gameevent>, uint16> const eventId) + static bool HandleEventStopCommand(ChatHandler* handler, Variant<Hyperlink<gameevent>, uint16> eventId) { GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap(); @@ -162,7 +162,7 @@ public: return false; } - GameEventData const& eventData = events[eventId]; + GameEventData const& eventData = events[*eventId]; if (!eventData.isValid()) { handler->SendSysMessage(LANG_EVENT_NOT_EXIST); diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 0293ae9a93c..38861797e85 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -118,7 +118,7 @@ public: if (objectInfo->displayId && !sGameObjectDisplayInfoStore.LookupEntry(objectInfo->displayId)) { // report to DB errors log as in loading case - TC_LOG_ERROR("sql.sql", "Gameobject (Entry %u GoType: %u) have invalid displayId (%u), not spawned.", *objectId, objectInfo->type, objectInfo->displayId); + TC_LOG_ERROR("sql.sql", "Gameobject (Entry {} GoType: {}) have invalid displayId ({}), not spawned.", *objectId, objectInfo->type, objectInfo->displayId); handler->PSendSysMessage(LANG_GAMEOBJECT_HAVE_INVALID_DATA, objectId); handler->SetSentErrorMessage(true); return false; @@ -193,7 +193,7 @@ public: { if (objectId->holds_alternative<GameObjectEntry>()) { - result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, orientation, map, phaseMask, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE map = '%i' AND id = '%u' ORDER BY order_ ASC LIMIT 1", + result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, orientation, map, phaseMask, (POW(position_x - '{}', 2) + POW(position_y - '{}', 2) + POW(position_z - '{}', 2)) AS order_ FROM gameobject WHERE map = '{}' AND id = '{}' ORDER BY order_ ASC LIMIT 1", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), static_cast<uint32>(objectId->get<GameObjectEntry>())); } else @@ -201,9 +201,9 @@ public: std::string name = std::string(objectId->get<std::string_view>()); WorldDatabase.EscapeString(name); result = WorldDatabase.PQuery( - "SELECT guid, id, position_x, position_y, position_z, orientation, map, phaseMask, (POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ " - "FROM gameobject LEFT JOIN gameobject_template ON gameobject_template.entry = gameobject.id WHERE map = %i AND name LIKE '%%%s%%' ORDER BY order_ ASC LIMIT 1", - player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), name.c_str()); + "SELECT guid, id, position_x, position_y, position_z, orientation, map, phaseMask, (POW(position_x - {}, 2) + POW(position_y - {}, 2) + POW(position_z - {}, 2)) AS order_ " + "FROM gameobject LEFT JOIN gameobject_template ON gameobject_template.entry = gameobject.id WHERE map = {} AND name LIKE '%{}%' ORDER BY order_ ASC LIMIT 1", + player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), name); } } else @@ -229,10 +229,10 @@ public: eventFilter << ')'; result = WorldDatabase.PQuery("SELECT gameobject.guid, id, position_x, position_y, position_z, orientation, map, phaseMask, " - "(POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ FROM gameobject " - "LEFT OUTER JOIN game_event_gameobject on gameobject.guid = game_event_gameobject.guid WHERE map = '%i' %s ORDER BY order_ ASC LIMIT 10", + "(POW(position_x - {}, 2) + POW(position_y - {}, 2) + POW(position_z - {}, 2)) AS order_ FROM gameobject " + "LEFT OUTER JOIN game_event_gameobject on gameobject.guid = game_event_gameobject.guid WHERE map = '{}' {} ORDER BY order_ ASC LIMIT 10", handler->GetSession()->GetPlayer()->GetPositionX(), handler->GetSession()->GetPlayer()->GetPositionY(), handler->GetSession()->GetPlayer()->GetPositionZ(), - handler->GetSession()->GetPlayer()->GetMapId(), eventFilter.str().c_str()); + handler->GetSession()->GetPlayer()->GetMapId(), eventFilter.str()); } if (!result) diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index 6d70d7ec308..e076acad15e 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -91,18 +91,18 @@ public: QueryResult result; uint32 creatureCount = 0; - result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'", creatureId); + result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='{}'", creatureId); if (result) creatureCount = (*result)[0].GetUInt64(); if (handler->GetSession()) { Player* player = handler->GetSession()->GetPlayer(); - result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM creature WHERE id = '%u' ORDER BY order_ ASC LIMIT %u", + result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, (POW(position_x - '{}', 2) + POW(position_y - '{}', 2) + POW(position_z - '{}', 2)) AS order_ FROM creature WHERE id = '{}' ORDER BY order_ ASC LIMIT {}", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), creatureId, count); } else - result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map FROM creature WHERE id = '%u' LIMIT %u", + result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map FROM creature WHERE id = '{}' LIMIT {}", creatureId, count); if (result) @@ -369,18 +369,18 @@ public: QueryResult result; uint32 objectCount = 0; - result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'", gameObjectId); + result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='{}'", gameObjectId); if (result) objectCount = (*result)[0].GetUInt64(); if (handler->GetSession()) { Player* player = handler->GetSession()->GetPlayer(); - result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE id = '%u' ORDER BY order_ ASC LIMIT %u", + result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id, (POW(position_x - '{}', 2) + POW(position_y - '{}', 2) + POW(position_z - '{}', 2)) AS order_ FROM gameobject WHERE id = '{}' ORDER BY order_ ASC LIMIT {}", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), gameObjectId, count); } else - result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id FROM gameobject WHERE id = '%u' LIMIT %u", + result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id FROM gameobject WHERE id = '{}' LIMIT {}", gameObjectId, count); if (result) @@ -580,7 +580,7 @@ public: if (hasItem == 1) { QueryResult result2; - result2 = CharacterDatabase.PQuery("SELECT item_guid FROM mail_items WHERE mail_id = '%u'", messageId); + result2 = CharacterDatabase.PQuery("SELECT item_guid FROM mail_items WHERE mail_id = '{}'", messageId); if (result2) { do @@ -597,7 +597,7 @@ public: uint32 item_entry = fields3[0].GetUInt32(); uint32 item_count = fields3[1].GetUInt32(); QueryResult result4; - result4 = WorldDatabase.PQuery("SELECT name, quality FROM item_template WHERE entry = '%u'", item_entry); + result4 = WorldDatabase.PQuery("SELECT name, quality FROM item_template WHERE entry = '{}'", item_entry); Field* fields1 = result4->Fetch(); std::string item_name = fields1[0].GetString(); int item_quality = fields1[1].GetUInt8(); diff --git a/src/server/scripts/Commands/cs_message.cpp b/src/server/scripts/Commands/cs_message.cpp index 1cd21ab021e..c34a586ad05 100644 --- a/src/server/scripts/Commands/cs_message.cpp +++ b/src/server/scripts/Commands/cs_message.cpp @@ -151,7 +151,7 @@ public: if (message.empty()) return false; - sWorld->SendServerMessage(SERVER_MSG_STRING, Trinity::StringFormat(handler->GetTrinityString(LANG_SYSTEMMESSAGE), message.data()).c_str()); + sWorld->SendServerMessage(SERVER_MSG_STRING, handler->PGetParseString(LANG_SYSTEMMESSAGE, message.data())); return true; } diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index da9b6ad5ec7..bfbda9be376 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -168,7 +168,6 @@ public: NotifyModification(handler, target, LANG_YOU_CHANGE_ENERGY, LANG_YOURS_ENERGY_CHANGED, energy / energyMultiplier, energymax / energyMultiplier); target->SetMaxPower(POWER_ENERGY, energymax); target->SetPower(POWER_ENERGY, energy); - TC_LOG_DEBUG("misc", handler->GetTrinityString(LANG_CURRENT_ENERGY), target->GetMaxPower(POWER_ENERGY)); return true; } return false; @@ -578,7 +577,7 @@ public: { int32 newmoney = int32(targetMoney) + moneyToAdd; - TC_LOG_DEBUG("misc", handler->GetTrinityString(LANG_CURRENT_MONEY), targetMoney, moneyToAdd, newmoney); + TC_LOG_DEBUG("misc", "{}", handler->PGetParseString(LANG_CURRENT_MONEY, targetMoney, moneyToAdd, newmoney)); if (newmoney <= 0) { NotifyModification(handler, target, LANG_YOU_TAKE_ALL_MONEY, LANG_YOURS_ALL_MONEY_GONE); @@ -607,7 +606,7 @@ public: target->ModifyMoney(moneyToAdd); } - TC_LOG_DEBUG("misc", handler->GetTrinityString(LANG_NEW_MONEY), targetMoney, moneyToAdd, target->GetMoney()); + TC_LOG_DEBUG("misc", "{}", handler->PGetParseString(LANG_NEW_MONEY, targetMoney, moneyToAdd, target->GetMoney())); return true; } diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index b2c6cef3229..e85636f282d 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -1122,7 +1122,7 @@ public: continue; ObjectGuid guid = ObjectGuid::Create<HighGuid::Player>(pair.first); Player const* player = ObjectAccessor::FindConnectedPlayer(guid); - handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_SUBLABEL, player ? player->GetName() : Trinity::StringFormat("Offline player (GuidLow 0x%08x)", pair.first).c_str(), pair.second->size()); + handler->PSendSysMessage(LANG_COMMAND_NPC_SHOWLOOT_SUBLABEL, player ? player->GetName() : Trinity::StringFormat("Offline player (GuidLow 0x{:08X})", pair.first), pair.second->size()); for (auto it = pair.second->cbegin(); it != pair.second->cend(); ++it) { diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 23e1ea13925..125f83a15f4 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -446,7 +446,7 @@ public: continue; } - TC_LOG_INFO("misc", "Reloading creature template entry %u", entry); + TC_LOG_INFO("misc", "Reloading creature template entry {}", entry); Field* fields = result->Fetch(); sObjectMgr->LoadCreatureTemplate(fields); diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index be78a9054b7..0680f7985b5 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -99,7 +99,7 @@ public: ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(player->GetClass()); if (!classEntry) { - TC_LOG_ERROR("misc", "Class %u not found in DBC (Wrong DBC files?)", player->GetClass()); + TC_LOG_ERROR("misc", "Class {} not found in DBC (Wrong DBC files?)", player->GetClass()); return false; } diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index c32662b992a..10978ef3782 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -130,13 +130,13 @@ public: { uint16 dbPort = 0; - if (QueryResult res = LoginDatabase.PQuery("SELECT port FROM realmlist WHERE id = %u", realm.Id.Realm)) + if (QueryResult res = LoginDatabase.PQuery("SELECT port FROM realmlist WHERE id = {}", realm.Id.Realm)) dbPort = (*res)[0].GetUInt16(); if (dbPort) - dbPortOutput = Trinity::StringFormat("Realmlist (Realm Id: %u) configured in port %" PRIu16, realm.Id.Realm, dbPort); + dbPortOutput = Trinity::StringFormat("Realmlist (Realm Id: {}) configured in port %" PRIu16, realm.Id.Realm, dbPort); else - dbPortOutput = Trinity::StringFormat("Realm Id: %u not found in `realmlist` table. Please check your setup", realm.Id.Realm); + dbPortOutput = Trinity::StringFormat("Realm Id: {} not found in `realmlist` table. Please check your setup", realm.Id.Realm); } handler->PSendSysMessage("%s", GitRevision::GetFullVersion()); diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index db98dbd630f..57227f93b1f 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -365,7 +365,7 @@ public: std::string normalizedName(name); WorldDatabase.EscapeString(normalizedName); - QueryResult result = WorldDatabase.PQuery("SELECT c.position_x, c.position_y, c.position_z, c.orientation, c.map, ct.name FROM creature c INNER JOIN creature_template ct ON c.id = ct.entry WHERE ct.name LIKE '%s'", normalizedName.c_str()); + QueryResult result = WorldDatabase.PQuery("SELECT c.position_x, c.position_y, c.position_z, c.orientation, c.map, ct.name FROM creature c INNER JOIN creature_template ct ON c.id = ct.entry WHERE ct.name LIKE '{}'", normalizedName); if (!result) { handler->SendSysMessage(LANG_COMMAND_GOCREATNOTFOUND); diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp index 0175d72ca59..954d5ab813b 100644 --- a/src/server/scripts/Commands/cs_titles.cpp +++ b/src/server/scripts/Commands/cs_titles.cpp @@ -79,7 +79,7 @@ public: } std::string tNameLink = handler->GetNameLink(target); - std::string titleNameStr = Trinity::StringFormat(target->GetNativeGender() == GENDER_MALE ? titleInfo->Name[handler->GetSessionDbcLocale()] : titleInfo->Name1[handler->GetSessionDbcLocale()], target->GetName()); + std::string titleNameStr = fmt::sprintf(target->GetNativeGender() == GENDER_MALE ? titleInfo->Name[handler->GetSessionDbcLocale()] : titleInfo->Name1[handler->GetSessionDbcLocale()], target->GetName()); target->SetTitle(titleInfo); target->SetUInt32Value(PLAYER_CHOSEN_TITLE, titleInfo->MaskID); @@ -112,7 +112,7 @@ public: } std::string tNameLink = handler->GetNameLink(target); - std::string titleNameStr = Trinity::StringFormat(target->GetNativeGender() == GENDER_MALE ? titleInfo->Name[handler->GetSessionDbcLocale()] : titleInfo->Name1[handler->GetSessionDbcLocale()], target->GetName()); + std::string titleNameStr = fmt::sprintf(target->GetNativeGender() == GENDER_MALE ? titleInfo->Name[handler->GetSessionDbcLocale()] : titleInfo->Name1[handler->GetSessionDbcLocale()], target->GetName()); target->SetTitle(titleInfo); handler->PSendSysMessage(LANG_TITLE_ADD_RES, titleId, titleNameStr, tNameLink); @@ -145,7 +145,7 @@ public: target->SetTitle(titleInfo, true); std::string tNameLink = handler->GetNameLink(target); - std::string titleNameStr = Trinity::StringFormat(target->GetNativeGender() == GENDER_MALE ? titleInfo->Name[handler->GetSessionDbcLocale()] : titleInfo->Name1[handler->GetSessionDbcLocale()], target->GetName()); + std::string titleNameStr = fmt::sprintf(target->GetNativeGender() == GENDER_MALE ? titleInfo->Name[handler->GetSessionDbcLocale()] : titleInfo->Name1[handler->GetSessionDbcLocale()], target->GetName()); handler->PSendSysMessage(LANG_TITLE_REMOVE_RES, titleId, titleNameStr, tNameLink); diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index 1ec41265b99..d987d054bc6 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -525,7 +525,7 @@ public: } else if (arg_str_2 == "dataint") { - WorldDatabase.PExecute("UPDATE waypoint_scripts SET %s='%u' WHERE guid='%u'", arg_2, atoi(arg_3), id); // Query can't be a prepared statement + WorldDatabase.PExecute("UPDATE waypoint_scripts SET {}='{}' WHERE guid='{}'", arg_2, arg_3, id); // Query can't be a prepared statement handler->PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 dataint updated.|r", id); return true; @@ -534,7 +534,7 @@ public: { std::string arg_str_3 = arg_3; WorldDatabase.EscapeString(arg_str_3); - WorldDatabase.PExecute("UPDATE waypoint_scripts SET %s='%s' WHERE guid='%u'", arg_2, arg_str_3.c_str(), id); // Query can't be a prepared statement + WorldDatabase.PExecute("UPDATE waypoint_scripts SET {}='{}' WHERE guid='{}'", arg_2, arg_str_3, id); // Query can't be a prepared statement } } handler->PSendSysMessage("%s%s|r|cff00ffff%u:|r|cff00ff00 %s %s|r", "|cff00ff00", "Waypoint script:", id, arg_2, "updated."); @@ -712,14 +712,14 @@ public: if (text == 0) { // show_str check for present in list of correct values, no sql injection possible - WorldDatabase.PExecute("UPDATE waypoint_data SET %s=NULL WHERE id='%u' AND point='%u'", show_str, pathid, point); // Query can't be a prepared statement + WorldDatabase.PExecute("UPDATE waypoint_data SET {}=NULL WHERE id='{}' AND point='{}'", show_str, pathid, point); // Query can't be a prepared statement } else { // show_str check for present in list of correct values, no sql injection possible std::string text2 = text; WorldDatabase.EscapeString(text2); - WorldDatabase.PExecute("UPDATE waypoint_data SET %s='%s' WHERE id='%u' AND point='%u'", show_str, text2.c_str(), pathid, point); // Query can't be a prepared statement + WorldDatabase.PExecute("UPDATE waypoint_data SET {}='{}' WHERE id='{}' AND point='{}'", show_str, text2, pathid, point); // Query can't be a prepared statement } handler->PSendSysMessage(LANG_WAYPOINT_CHANGED_NO, show_str); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp index c4a6c5f9f1e..a7c359818e1 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp @@ -212,7 +212,7 @@ public: void SetGuidData(uint32 type, ObjectGuid data) override { - TC_LOG_DEBUG("scripts", "Instance Blackrock Depths: SetGuidData update (Type: %u Data %s)", type, data.ToString().c_str()); + TC_LOG_DEBUG("scripts", "Instance Blackrock Depths: SetGuidData update (Type: {} Data {})", type, data.ToString()); switch (type) { @@ -228,7 +228,7 @@ public: void SetData(uint32 type, uint32 data) override { - TC_LOG_DEBUG("scripts", "Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data); + TC_LOG_DEBUG("scripts", "Instance Blackrock Depths: SetData update (Type: {} Data {})", type, data); switch (type) { diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 5b8105b95d4..ce27b13e9e3 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -246,7 +246,7 @@ public: void PrepareEncounter() { - TC_LOG_DEBUG("scripts", "Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId); + TC_LOG_DEBUG("scripts", "Barnes Opera Event - Introduction complete - preparing encounter {}", m_uiEventId); uint8 index = 0; uint8 count = 0; @@ -352,17 +352,17 @@ public: case GOSSIP_ACTION_INFO_DEF + 3: CloseGossipMenuFor(player); m_uiEventId = EVENT_OZ; - TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_OZ", player->GetGUID().ToString().c_str()); + TC_LOG_DEBUG("scripts", "player ({}) manually set Opera event to EVENT_OZ", player->GetGUID().ToString()); break; case GOSSIP_ACTION_INFO_DEF + 4: CloseGossipMenuFor(player); m_uiEventId = EVENT_HOOD; - TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_HOOD", player->GetGUID().ToString().c_str()); + TC_LOG_DEBUG("scripts", "player ({}) manually set Opera event to EVENT_HOOD", player->GetGUID().ToString()); break; case GOSSIP_ACTION_INFO_DEF + 5: CloseGossipMenuFor(player); m_uiEventId = EVENT_RAJ; - TC_LOG_DEBUG("scripts", "player (%s) manually set Opera event to EVENT_RAJ", player->GetGUID().ToString().c_str()); + TC_LOG_DEBUG("scripts", "player ({}) manually set Opera event to EVENT_RAJ", player->GetGUID().ToString()); break; } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index b6c3e849f4b..61049c875a2 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -224,7 +224,7 @@ public: else { me->GetMotionMaster()->MovePoint(1, anchorX, anchorY, me->GetPositionZ()); - //TC_LOG_DEBUG("scripts", "npc_unworthy_initiateAI: move to %f %f %f", anchorX, anchorY, me->GetPositionZ()); + //TC_LOG_DEBUG("scripts", "npc_unworthy_initiateAI: move to {} {} {}", anchorX, anchorY, me->GetPositionZ()); phase = PHASE_EQUIPING; wait_timer = 0; } diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp index 7c14a894836..c1d21da6571 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp @@ -350,7 +350,7 @@ class instance_stratholme : public InstanceMapScript TC_LOG_DEBUG("scripts", "Instance Stratholme: Ramstein spawned."); } else - TC_LOG_DEBUG("scripts", "Instance Stratholme: %u Abomnation left to kill.", count); + TC_LOG_DEBUG("scripts", "Instance Stratholme: {} Abomnation left to kill.", count); } if (data == NOT_STARTED) @@ -491,7 +491,7 @@ class instance_stratholme : public InstanceMapScript case EVENT_BARON_RUN: if (GetData(TYPE_BARON_RUN) != DONE) SetData(TYPE_BARON_RUN, FAIL); - TC_LOG_DEBUG("scripts", "Instance Stratholme: Baron run event reached end. Event has state %u.", GetData(TYPE_BARON_RUN)); + TC_LOG_DEBUG("scripts", "Instance Stratholme: Baron run event reached end. Event has state {}.", GetData(TYPE_BARON_RUN)); break; case EVENT_SLAUGHTER_SQUARE: if (Creature* baron = instance->GetCreature(baronGUID)) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index 38827b3e32b..b5028ba0f6d 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -238,7 +238,7 @@ class boss_janalai : public CreatureScript GetCreatureListWithEntryInGrid(templist, me, NPC_EGG, 100.0f); - //TC_LOG_ERROR("scripts", "Eggs %d at middle", templist.size()); + //TC_LOG_ERROR("scripts", "Eggs {} at middle", templist.size()); if (templist.empty()) return false; @@ -504,7 +504,7 @@ class npc_janalai_hatcher : public CreatureScript GetCreatureListWithEntryInGrid(templist, me, NPC_EGG, 50.0f); - //TC_LOG_ERROR("scripts", "Eggs %d at %d", templist.size(), side); + //TC_LOG_ERROR("scripts", "Eggs {} at {}", templist.size(), side); for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end() && num > 0; ++i) if ((*i)->GetDisplayId() != 11686) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index 9a017828b78..e72e1bdf4cd 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp @@ -173,7 +173,7 @@ public: break; } - TC_LOG_DEBUG("scripts", "Instance Hyjal: Instance data updated for event %u (Data=%u)", type, data); + TC_LOG_DEBUG("scripts", "Instance Hyjal: Instance data updated for event {} (Data={})", type, data); } bool SetBossState(uint32 id, EncounterState state) override diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index 200ee9d35ca..3573cf7b610 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -383,12 +383,12 @@ class npc_chromie_start : public CreatureScript for (uint32 state = 1; state <= COMPLETE; state = state << 1) { if (GetStableStateFor(COSProgressStates(state)) == state) - AddGossipItemFor(player, GOSSIP_ICON_INTERACT_1, Trinity::StringFormat("Set instance progress to 0x%05X", state), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_GM_INITIAL) + state); + AddGossipItemFor(player, GOSSIP_ICON_INTERACT_1, Trinity::StringFormat("Set instance progress to 0x{:05X}", state), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_GM_INITIAL) + state); } for (uint32 state = 1; state <= COMPLETE; state = state << 1) { if (GetStableStateFor(COSProgressStates(state)) != state) - AddGossipItemFor(player, GOSSIP_ICON_INTERACT_1, Trinity::StringFormat("Force state to 0x%05X (UNSTABLE)", state), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_GM_INITIAL) + state); + AddGossipItemFor(player, GOSSIP_ICON_INTERACT_1, Trinity::StringFormat("Force state to 0x{:05X} (UNSTABLE)", state), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + AsUnderlyingType(GOSSIP_OFFSET_GM_INITIAL) + state); } SendGossipMenuFor(player, GOSSIP_TEXT_SKIP_1, me->GetGUID()); break; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp index a0cb5205c47..3a95460b595 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp @@ -311,7 +311,7 @@ class instance_culling_of_stratholme : public InstanceMapScript if (!infiniteGuardianTime) timediff = -1; - TC_LOG_DEBUG("scripts.cos", "instance_culling_of_stratholme::ReadSaveDataMore: Loaded with state %u and guardian timeout at %zu minutes %zu seconds from now", (uint32)loadState, timediff / MINUTE, timediff % MINUTE); + TC_LOG_DEBUG("scripts.cos", "instance_culling_of_stratholme::ReadSaveDataMore: Loaded with state {} and guardian timeout at {} minutes {} seconds from now", (uint32)loadState, timediff / MINUTE, timediff % MINUTE); } void SetData(uint32 type, uint32 data) override @@ -617,7 +617,7 @@ class instance_culling_of_stratholme : public InstanceMapScript _plagueCrates.push_back(creature->GetGUID()); break; case NPC_ARTHAS: - TC_LOG_DEBUG("scripts.cos", "instance_culling_of_stratholme::OnCreatureCreate: Arthas spawned at %s", creature->GetPosition().ToString().c_str()); + TC_LOG_DEBUG("scripts.cos", "instance_culling_of_stratholme::OnCreatureCreate: Arthas spawned at {}", creature->GetPosition().ToString()); _arthasGUID = creature->GetGUID(); creature->setActive(true); break; @@ -655,7 +655,7 @@ class instance_culling_of_stratholme : public InstanceMapScript void SetInstanceProgress(COSProgressStates state, bool force) { - TC_LOG_DEBUG("scripts.cos", "instance_culling_of_stratholme::SetInstanceProgress: Instance progress is now 0x%X", (uint32)state); + TC_LOG_DEBUG("scripts.cos", "instance_culling_of_stratholme::SetInstanceProgress: Instance progress is now 0x{:X}", (uint32)state); _currentState = state; /* Spawn group management */ @@ -796,7 +796,7 @@ class instance_culling_of_stratholme : public InstanceMapScript void SetWorldState(COSWorldStates state, uint32 value, bool immediate = true) { - TC_LOG_DEBUG("scripts.cos", "instance_culling_of_stratholme::SetWorldState: %u %u", uint32(state), value); + TC_LOG_DEBUG("scripts.cos", "instance_culling_of_stratholme::SetWorldState: {} {}", uint32(state), value); _currentWorldStates[state] = value; if (immediate) PropagateWorldStateUpdate(); @@ -810,7 +810,7 @@ class instance_culling_of_stratholme : public InstanceMapScript uint32& sent = _sentWorldStates[it->first]; if (sent != it->second) { - TC_LOG_DEBUG("scripts.cos", "instance_culling_of_stratholme::PropagateWorldStateUpdate: Sending world state %u (%u)", it->first, it->second); + TC_LOG_DEBUG("scripts.cos", "instance_culling_of_stratholme::PropagateWorldStateUpdate: Sending world state {} ({})", it->first, it->second); DoUpdateWorldState(it->first, it->second); sent = it->second; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp index 4c12db12493..85c540a0953 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/npc_arthas.cpp @@ -556,10 +556,10 @@ public: void AdvanceToState(COSProgressStates newState) { - TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::AdvanceToState: advancing to 0x%X", newState); + TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::AdvanceToState: advancing to 0x{:X}", newState); if (!_progressRP) { - TC_LOG_WARN("scripts.cos", "npc_arthas_stratholmeAI::AdvanceToState: advancing to instance state 0x%X, but RP is paused. Overriding!", newState); + TC_LOG_WARN("scripts.cos", "npc_arthas_stratholmeAI::AdvanceToState: advancing to instance state 0x{:X}, but RP is paused. Overriding!", newState); _progressRP = true; } @@ -581,7 +581,7 @@ public: else me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP); - TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::AdvanceToState: has snapback for this state, distance = %f", target.SnapbackPosition->GetExactDist(me)); + TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::AdvanceToState: has snapback for this state, distance = {}", target.SnapbackPosition->GetExactDist(me)); // Snapback handling - if we're too far from where we're supposed to be, teleport there if (target.SnapbackPosition->GetExactDist(me) > ArthasSnapbackDistanceThreshold) me->NearTeleportTo(*target.SnapbackPosition); @@ -1534,7 +1534,7 @@ public: void JustEngagedWith(Unit* who) override { - TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::JustEngagedWith: RP in progress? '%s'", _progressRP ? "YES" : "NO"); + TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::JustEngagedWith: RP in progress? '{}'", _progressRP ? "YES" : "NO"); if (_progressRP) { _progressRP = false; @@ -1551,7 +1551,7 @@ public: void EnterEvadeMode(EvadeReason why) override { - TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::EnterEvadeMode: why = %u ", why); + TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::EnterEvadeMode: why = {} ", why); ScriptedAI::EnterEvadeMode(why); } @@ -1601,7 +1601,7 @@ public: bool OnGossipSelect(Player* player, uint32 /*sender*/, uint32 listId) override { uint32 const action = GetGossipActionFor(player, listId); - TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::GossipSelect: '%s' selects action '%u' on '%s'", player->GetGUID().ToString().c_str(), action, me->GetGUID().ToString().c_str()); + TC_LOG_TRACE("scripts.cos", "npc_arthas_stratholmeAI::GossipSelect: '{}' selects action '{}' on '{}'", player->GetGUID().ToString(), action, me->GetGUID().ToString()); AdvanceDungeon(player, PURGE_PENDING, DATA_START_PURGE); AdvanceDungeon(player, TOWN_HALL_PENDING, DATA_START_TOWN_HALL); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp index f26927edd59..4f62ed6e605 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp @@ -113,7 +113,7 @@ public: ++mBarrelCount; DoUpdateWorldState(WORLD_STATE_OH, mBarrelCount); - TC_LOG_DEBUG("scripts", "Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u", mBarrelCount); + TC_LOG_DEBUG("scripts", "Instance Old Hillsbrad: go_barrel_old_hillsbrad count {}", mBarrelCount); if (mBarrelCount == 5) { @@ -140,7 +140,7 @@ public: else ThrallEscortState = OH_ESCORT_PRISON_TO_SKARLOC; // not correct, see npc_thrall_old_hillsbrad::InitializeAI for details } - TC_LOG_DEBUG("scripts", "Instance Old Hillsbrad: Thrall escort event adjusted to data %u.", data); + TC_LOG_DEBUG("scripts", "Instance Old Hillsbrad: Thrall escort event adjusted to data {}.", data); break; } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp index e8c6b8e6259..b949def4ae4 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/instance_the_black_morass.cpp @@ -266,7 +266,7 @@ public: if (entry == RIFT_BOSS) entry = RandRiftBoss(); - TC_LOG_DEBUG("scripts", "Instance The Black Morass: Summoning rift boss entry %u.", entry); + TC_LOG_DEBUG("scripts", "Instance The Black Morass: Summoning rift boss entry {}.", entry); Position pos = me->GetRandomNearPosition(10.0f); @@ -289,7 +289,7 @@ public: if (tmp >= _currentRiftId) ++tmp; - TC_LOG_DEBUG("scripts", "Instance The Black Morass: Creating Time Rift at locationId %i (old locationId was %u).", tmp, _currentRiftId); + TC_LOG_DEBUG("scripts", "Instance The Black Morass: Creating Time Rift at locationId {} (old locationId was {}).", tmp, _currentRiftId); _currentRiftId = tmp; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp index 2627af6a3d3..5de389a58c9 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp @@ -347,7 +347,7 @@ struct npc_time_rift : public ScriptedAI uint32 entry = 0; entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount]; - TC_LOG_DEBUG("scripts", "npc_time_rift: summoning wave Creature (Wave %u, Entry %u).", mRiftWaveCount, entry); + TC_LOG_DEBUG("scripts", "npc_time_rift: summoning wave Creature (Wave {}, Entry {}).", mRiftWaveCount, entry); ++mRiftWaveCount; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index cb16b522807..ebfb82b8f51 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -298,7 +298,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript if (type < EncounterCount) { - TC_LOG_DEBUG("scripts", "[ToCr] BossState(type %u) %u = state %u;", type, GetBossState(type), state); + TC_LOG_DEBUG("scripts", "[ToCr] BossState(type {}) {} = state {};", type, GetBossState(type), state); if (state == FAIL) { if (instance->IsHeroic()) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index 0367f0b5975..6bf76c9540a 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -146,7 +146,7 @@ struct boss_four_horsemen_baseAI : public BossAI uint32 deathTime = cBoss->AI()->GetData(DATA_DEATH_TIME); if (!deathTime) { - TC_LOG_WARN("scripts", "FourHorsemenAI: Checking for achievement credit but horseman %s is reporting not dead", cBoss->GetName().c_str()); + TC_LOG_WARN("scripts", "FourHorsemenAI: Checking for achievement credit but horseman {} is reporting not dead", cBoss->GetName()); return 0; } if (!minTime || deathTime < minTime) @@ -156,7 +156,7 @@ struct boss_four_horsemen_baseAI : public BossAI } else { - TC_LOG_WARN("scripts", "FourHorsemenAI: Checking for achievement credit but horseman with id %u is not present", uint32(boss)); + TC_LOG_WARN("scripts", "FourHorsemenAI: Checking for achievement credit but horseman with id {} is not present", uint32(boss)); return 0; } return (getMSTimeDiff(minTime, maxTime) <= 15 * IN_MILLISECONDS) ? 1 : 0; @@ -194,7 +194,7 @@ struct boss_four_horsemen_baseAI : public BossAI } else { - TC_LOG_WARN("scripts", "FourHorsemenAI: Checking if movement is finished but horseman with id %u is not present", uint32(boss)); + TC_LOG_WARN("scripts", "FourHorsemenAI: Checking if movement is finished but horseman with id {} is not present", uint32(boss)); ResetEncounter(); return; } @@ -251,7 +251,7 @@ struct boss_four_horsemen_baseAI : public BossAI } else { - TC_LOG_WARN("scripts", "FourHorsemenAI: Encounter starting but horseman with id %u is not present", uint32(boss)); + TC_LOG_WARN("scripts", "FourHorsemenAI: Encounter starting but horseman with id {} is not present", uint32(boss)); ResetEncounter(); return; } @@ -268,7 +268,7 @@ struct boss_four_horsemen_baseAI : public BossAI if (Creature* cBoss = getHorsemanHandle(boss)) cBoss->DespawnOrUnsummon(0s, 15s); else - TC_LOG_WARN("scripts", "FourHorsemenAI: Encounter resetting but horseman with id %u is not present", uint32(boss)); + TC_LOG_WARN("scripts", "FourHorsemenAI: Encounter resetting but horseman with id {} is not present", uint32(boss)); } } @@ -339,7 +339,7 @@ struct boss_four_horsemen_baseAI : public BossAI } else { - TC_LOG_WARN("scripts", "FourHorsemenAI: %s died but horseman with id %u is not present", me->GetName().c_str(), uint32(boss)); + TC_LOG_WARN("scripts", "FourHorsemenAI: {} died but horseman with id {} is not present", me->GetName(), uint32(boss)); ResetEncounter(); } } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index f66aee2d665..82f7fd5afdf 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -437,7 +437,7 @@ struct boss_gothik : public BossAI { if (RAID_MODE(waves10,waves25).size() <= _waveCount) // bounds check { - TC_LOG_INFO("scripts", "GothikAI: Wave count %d is out of range for difficulty %d.", _waveCount, static_cast<uint32>(GetDifficulty())); + TC_LOG_INFO("scripts", "GothikAI: Wave count {} is out of range for difficulty {}.", _waveCount, static_cast<uint32>(GetDifficulty())); break; } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index e11fdce65a5..81264592509 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -255,7 +255,7 @@ class spell_gen_arena_drink : public AuraScript { if (!spellInfo->GetEffect(EFFECT_0).IsAura(SPELL_AURA_MOD_POWER_REGEN)) { - TC_LOG_ERROR("spells", "Aura %d structure has been changed - first aura is no longer SPELL_AURA_MOD_POWER_REGEN", GetId()); + TC_LOG_ERROR("spells", "Aura {} structure has been changed - first aura is no longer SPELL_AURA_MOD_POWER_REGEN", GetId()); return false; } @@ -4216,7 +4216,7 @@ class spell_gen_mixology_bonus : public AuraScript SetBonusValueForEffect(EFFECT_0, 5, aurEff); break; default: - TC_LOG_ERROR("spells", "SpellId %u couldn't be processed in spell_gen_mixology_bonus", GetId()); + TC_LOG_ERROR("spells", "SpellId {} couldn't be processed in spell_gen_mixology_bonus", GetId()); break; } amount += bonus; diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index bf46ebf0228..fc4d7ee5b1f 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -250,7 +250,7 @@ class spell_rog_deadly_poison : public SpellScript SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(enchant->EffectArg[s]); if (!spellInfo) { - TC_LOG_ERROR("spells", "Player::CastItemCombatSpell Enchant %i, player (Name: %s, %s) cast unknown spell %i", enchant->ID, player->GetName().c_str(), player->GetGUID().ToString().c_str(), enchant->EffectArg[s]); + TC_LOG_ERROR("spells", "Player::CastItemCombatSpell Enchant {}, player (Name: {}, {}) cast unknown spell {}", enchant->ID, player->GetName(), player->GetGUID().ToString(), enchant->EffectArg[s]); continue; } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 8e05a5ecdaa..e1de6fd68d5 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -213,7 +213,7 @@ class spell_warl_create_healthstone : public SpellScriptLoader rank = 2; break; default: - TC_LOG_ERROR("spells", "Unknown rank of Improved Healthstone id: %d", aurEff->GetId()); + TC_LOG_ERROR("spells", "Unknown rank of Improved Healthstone id: {}", aurEff->GetId()); break; } } diff --git a/src/server/scripts/World/chat_log.cpp b/src/server/scripts/World/chat_log.cpp index be353a82a19..7c961180b8c 100644 --- a/src/server/scripts/World/chat_log.cpp +++ b/src/server/scripts/World/chat_log.cpp @@ -38,26 +38,26 @@ class ChatLogScript : public PlayerScript switch (type) { case CHAT_MSG_SAY: - TC_LOG_CHAT("say", "Player %s says (language %u): %s", - player->GetName().c_str(), lang, msg.c_str()); + TC_LOG_CHAT("say", "Player {} says (language {}): {}", + player->GetName(), lang, msg); break; case CHAT_MSG_EMOTE: - TC_LOG_CHAT("emote", "Player %s emotes: %s", - player->GetName().c_str(), msg.c_str()); + TC_LOG_CHAT("emote", "Player {} emotes: {}", + player->GetName(), msg); break; case CHAT_MSG_YELL: - TC_LOG_CHAT("yell", "Player %s yells (language %u): %s", - player->GetName().c_str(), lang, msg.c_str()); + TC_LOG_CHAT("yell", "Player {} yells (language {}): {}", + player->GetName(), lang, msg); break; } } void OnChat(Player* player, uint32 /*type*/, uint32 lang, std::string& msg, Player* receiver) override { - TC_LOG_CHAT("whisper", "Player %s tells %s: %s", - player->GetName().c_str(), receiver ? receiver->GetName().c_str() : "<unknown>", msg.c_str()); + TC_LOG_CHAT("whisper", "Player {} tells {}: {}", + player->GetName(), receiver ? receiver->GetName() : "<unknown>", msg); } void OnChat(Player* player, uint32 type, uint32 lang, std::string& msg, Group* group) override @@ -67,38 +67,38 @@ class ChatLogScript : public PlayerScript switch (type) { case CHAT_MSG_PARTY: - TC_LOG_CHAT("party", "Player %s tells group with leader %s: %s", - player->GetName().c_str(), group ? group->GetLeaderName() : "<unknown>", msg.c_str()); + TC_LOG_CHAT("party", "Player {} tells group with leader {}: {}", + player->GetName(), group ? group->GetLeaderName() : "<unknown>", msg); break; case CHAT_MSG_PARTY_LEADER: - TC_LOG_CHAT("party", "Leader %s tells group: %s", - player->GetName().c_str(), msg.c_str()); + TC_LOG_CHAT("party", "Leader {} tells group: {}", + player->GetName(), msg); break; case CHAT_MSG_RAID: - TC_LOG_CHAT("raid", "Player %s tells raid with leader %s: %s", - player->GetName().c_str(), group ? group->GetLeaderName() : "<unknown>", msg.c_str()); + TC_LOG_CHAT("raid", "Player {} tells raid with leader {}: {}", + player->GetName(), group ? group->GetLeaderName() : "<unknown>", msg); break; case CHAT_MSG_RAID_LEADER: - TC_LOG_CHAT("raid", "Leader player %s tells raid: %s", - player->GetName().c_str(), msg.c_str()); + TC_LOG_CHAT("raid", "Leader player {} tells raid: {}", + player->GetName(), msg); break; case CHAT_MSG_RAID_WARNING: - TC_LOG_CHAT("raid", "Leader player %s warns raid with: %s", - player->GetName().c_str(), msg.c_str()); + TC_LOG_CHAT("raid", "Leader player {} warns raid with: {}", + player->GetName(), msg); break; case CHAT_MSG_BATTLEGROUND: - TC_LOG_CHAT("bg", "Player %s tells battleground with leader %s: %s", - player->GetName().c_str(), group ? group->GetLeaderName() : "<unknown>", msg.c_str()); + TC_LOG_CHAT("bg", "Player {} tells battleground with leader {}: {}", + player->GetName(), group ? group->GetLeaderName() : "<unknown>", msg); break; case CHAT_MSG_BATTLEGROUND_LEADER: - TC_LOG_CHAT("bg", "Leader player %s tells battleground: %s", - player->GetName().c_str(), msg.c_str()); + TC_LOG_CHAT("bg", "Leader player {} tells battleground: {}", + player->GetName(), msg); break; } } @@ -108,13 +108,13 @@ class ChatLogScript : public PlayerScript switch (type) { case CHAT_MSG_GUILD: - TC_LOG_CHAT("guild", "Player %s tells guild %s: %s", - player->GetName().c_str(), guild ? guild->GetName().c_str() : "<unknown>", msg.c_str()); + TC_LOG_CHAT("guild", "Player {} tells guild {}: {}", + player->GetName(), guild ? guild->GetName() : "<unknown>", msg); break; case CHAT_MSG_OFFICER: - TC_LOG_CHAT("guild.officer", "Player %s tells guild %s officers: %s", - player->GetName().c_str(), guild ? guild->GetName().c_str() : "<unknown>", msg.c_str()); + TC_LOG_CHAT("guild.officer", "Player {} tells guild {} officers: {}", + player->GetName(), guild ? guild->GetName() : "<unknown>", msg); break; } } @@ -129,14 +129,14 @@ class ChatLogScript : public PlayerScript if (isSystem) { - TC_LOG_CHAT("system", "Player %s tells channel %s: %s", - player->GetName().c_str(), channel->GetName().c_str(), msg.c_str()); + TC_LOG_CHAT("system", "Player {} tells channel {}: {}", + player->GetName(), channel->GetName(), msg); } else { std::string channelName = channel ? channel->GetName() : "<unknown>"; - TC_LOG_CHAT("channel." + channelName, "Player %s tells channel %s: %s", - player->GetName().c_str(), channelName.c_str(), msg.c_str()); + TC_LOG_CHAT("channel." + channelName, "Player {} tells channel {}: {}", + player->GetName(), channelName, msg); } } }; diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index ef4c44d10a0..6f525746b12 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -174,7 +174,7 @@ public: if (Spell) creature->CastSpell(player, Spell, false); else - TC_LOG_ERROR("scripts", "go_ethereum_prison summoned Creature (entry %u) but faction (%u) are not expected by script.", creature->GetEntry(), creature->GetFaction()); + TC_LOG_ERROR("scripts", "go_ethereum_prison summoned Creature (entry {}) but faction ({}) are not expected by script.", creature->GetEntry(), creature->GetFaction()); } } } diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 59ec7ff224d..31c4702224e 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -271,7 +271,7 @@ bool EquippedOk(Player* player, uint32 spellId) if (item && item->GetTemplate()->RequiredSpell == reqSpell) { //player has item equipped that require specialty. Not allow to unlearn, player has to unequip first - TC_LOG_DEBUG("scripts", "player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry()); + TC_LOG_DEBUG("scripts", "player attempt to unlearn spell {}, but item {} is equipped.", reqSpell, item->GetEntry()); return false; } } |