diff --git a/data/sql/updates/pending_db_world/rev_1721436522058676600.sql b/data/sql/updates/pending_db_world/rev_1721436522058676600.sql new file mode 100644 index 000000000..46e12d0ce --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1721436522058676600.sql @@ -0,0 +1,204 @@ +-- +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%s', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%u', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%i', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%f', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%d', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%c', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%x', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%2.2f', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%.*s', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%3d', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%4d', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%5d', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%20s', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%19s', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%16s', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%12s', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%15s', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%-10s', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%6u', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%8u', '{}'); +UPDATE `acore_string` SET `content_default` = REPLACE(content_default, '%10u', '{}'); + +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%s', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%u', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%i', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%f', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%d', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%c', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%x', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%2.2f', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%.*s', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%3d', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%4d', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%5d', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%20s', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%19s', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%16s', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%12s', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%15s', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%-10s', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%6u', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%8u', '{}'); +UPDATE `acore_string` SET `locale_koKR` = REPLACE(locale_koKR, '%10u', '{}'); + +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%s', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%u', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%i', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%f', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%d', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%c', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%x', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%2.2f', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%.*s', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%3d', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%4d', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%5d', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%20s', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%19s', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%16s', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%12s', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%15s', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%-10s', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%6u', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%8u', '{}'); +UPDATE `acore_string` SET `locale_frFR` = REPLACE(locale_frFR, '%10u', '{}'); + +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%s', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%u', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%i', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%f', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%d', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%c', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%x', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%2.2f', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%.*s', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%3d', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%4d', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%5d', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%20s', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%19s', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%16s', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%12s', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%15s', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%-10s', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%6u', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%8u', '{}'); +UPDATE `acore_string` SET `locale_deDE` = REPLACE(locale_deDE, '%10u', '{}'); + +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%s', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%u', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%i', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%f', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%d', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%c', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%x', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%2.2f', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%.*s', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%3d', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%4d', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%5d', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%20s', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%19s', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%16s', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%12s', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%15s', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%-10s', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%6u', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%8u', '{}'); +UPDATE `acore_string` SET `locale_zhCN` = REPLACE(locale_zhCN, '%10u', '{}'); + +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%s', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%u', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%i', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%f', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%d', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%c', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%x', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%2.2f', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%.*s', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%3d', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%4d', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%5d', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%20s', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%19s', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%16s', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%12s', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%15s', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%-10s', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%6u', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%8u', '{}'); +UPDATE `acore_string` SET `locale_zhTW` = REPLACE(locale_zhTW, '%10u', '{}'); + +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%s', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%u', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%i', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%f', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%d', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%c', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%x', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%2.2f', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%.*s', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%3d', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%4d', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%5d', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%20s', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%19s', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%16s', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%12s', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%15s', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%-10s', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%6u', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%8u', '{}'); +UPDATE `acore_string` SET `locale_esES` = REPLACE(locale_esES, '%10u', '{}'); + +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%s', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%u', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%i', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%f', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%d', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%c', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%x', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%2.2f', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%.*s', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%3d', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%4d', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%5d', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%20s', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%19s', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%16s', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%12s', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%15s', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%-10s', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%6u', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%8u', '{}'); +UPDATE `acore_string` SET `locale_esMX` = REPLACE(locale_esMX, '%10u', '{}'); + +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%s', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%u', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%i', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%f', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%d', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%c', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%x', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%2.2f', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%.*s', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%3d', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%4d', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%5d', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%20s', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%19s', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%16s', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%12s', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%15s', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%-10s', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%6u', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%8u', '{}'); +UPDATE `acore_string` SET `locale_ruRU` = REPLACE(locale_ruRU, '%10u', '{}'); + +-- Only case I found that got broke. Due to these being sent to the client via WorldPacket +DELETE FROM `acore_string` WHERE `entry` IN (6613,6615); +INSERT INTO `acore_string` (`entry`, `content_default`, `locale_koKR`, `locale_frFR`, `locale_deDE`, `locale_zhCN`, `locale_zhTW`, `locale_esES`, `locale_esMX`, `locale_ruRU`) VALUES +(6613, '|cfff00000[GM Announcement]: %s|r', NULL, NULL, '|cfff00000[GM Ankündigung von [%s]]: %s|r', '|cfff00000[管理员公告]: %s|r', NULL, NULL, NULL, NULL), +(6615, '|cffffff00[|c1f40af20GM Announce by|r |cffff0000%s|cffffff00]:|r %s|r', NULL, NULL, '|cffffff00[|c1f40af20GM Ankündigung von|r |cffff0000%s|cffffff00]:|r %s|r', '|cffffff00[|c1f40af20管理员广播|r |cffff0000%s|cffffff00]:|r %s|r', NULL, NULL, NULL, NULL); diff --git a/src/server/game/ArenaSpectator/ArenaSpectator.cpp b/src/server/game/ArenaSpectator/ArenaSpectator.cpp index 0f5e11c35..049f2fcdc 100644 --- a/src/server/game/ArenaSpectator/ArenaSpectator.cpp +++ b/src/server/game/ArenaSpectator/ArenaSpectator.cpp @@ -156,7 +156,7 @@ bool ArenaSpectator::HandleSpectatorSpectateCommand(ChatHandler* handler, std::s { handler->PSendSysMessage("To spectate, please fix the following:"); for (std::list::const_iterator itr = errors.begin(); itr != errors.end(); ++itr) - handler->PSendSysMessage("- %s", (*itr).c_str()); + handler->PSendSysMessage("- {}", (*itr)); return true; } diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index f0d4fe2b5..e0b77a01a 100644 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -1057,7 +1057,7 @@ void BattlegroundQueue::SendMessageBGQueue(Player* leader, Battleground* bg, PvP // Show queue status to player only (when joining battleground queue or Arena and arena world announcer is disabled) if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY)) { - ChatHandler(leader->GetSession()).PSendSysMessage(LANG_BG_QUEUE_ANNOUNCE_SELF, bgName.c_str(), q_min_level, q_max_level, + ChatHandler(leader->GetSession()).PSendSysMessage(LANG_BG_QUEUE_ANNOUNCE_SELF, bgName, q_min_level, q_max_level, qAlliance, (MinPlayers > qAlliance) ? MinPlayers - qAlliance : (uint32)0, qHorde, (MinPlayers > qHorde) ? MinPlayers - qHorde : (uint32)0); } @@ -1119,7 +1119,7 @@ void BattlegroundQueue::SendJoinMessageArenaQueue(Player* leader, GroupQueueInfo if (sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY)) { ChatHandler(leader->GetSession()).PSendSysMessage(LANG_ARENA_QUEUE_ANNOUNCE_SELF, - bgName, arenatype.c_str(), q_min_level, q_max_level, qPlayers, playersNeed - qPlayers); + bgName, arenatype, q_min_level, q_max_level, qPlayers, playersNeed - qPlayers); } else { diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 6dbe45666..73b0a5e14 100644 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -213,7 +213,7 @@ void Channel::JoinChannel(Player* player, std::string const& pass) playersStore[guid] = pinfo; if (_channelRights.joinMessage.length()) - ChatHandler(player->GetSession()).PSendSysMessage("%s", _channelRights.joinMessage.c_str()); + ChatHandler(player->GetSession()).PSendSysMessage("{}", _channelRights.joinMessage); WorldPacket data; MakeYouJoined(&data); @@ -364,7 +364,7 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b } else { - ChatHandler(player->GetSession()).PSendSysMessage("Character %s has other faction!", badname.c_str()); + ChatHandler(player->GetSession()).PSendSysMessage("Character {} has other faction!", badname); return; } } diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 57836678c..fcd405fa9 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -150,6 +150,11 @@ void ChatHandler::SendSysMessage(uint32 entry) SendSysMessage(GetAcoreString(entry)); } +void ChatHandler::PSendSysMessage(std::string_view str, bool escapeCharacters) +{ + SendSysMessage(str, escapeCharacters); +} + void ChatHandler::SendErrorMessage(uint32 entry) { SendSysMessage(entry); @@ -172,7 +177,7 @@ bool ChatHandler::_ParseCommands(std::string_view text) return false; // Send error message for GMs - SendErrorMessage(LANG_CMD_INVALID, STRING_VIEW_FMT_ARG(text)); + SendErrorMessage(LANG_CMD_INVALID, text); return true; } diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index c4873f2cc..acb6760db 100644 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -55,23 +55,24 @@ public: virtual void SendSysMessage(std::string_view str, bool escapeCharacters = false); void SendSysMessage(uint32 entry); + void PSendSysMessage(std::string_view str, bool escapeCharacters = false); template void PSendSysMessage(char const* fmt, Args&&... args) { - SendSysMessage(Acore::StringFormat(fmt, std::forward(args)...).c_str()); + SendSysMessage(Acore::StringFormatFmt(fmt, std::forward(args)...)); } template void PSendSysMessage(uint32 entry, Args&&... args) { - SendSysMessage(PGetParseString(entry, std::forward(args)...).c_str()); + SendSysMessage(PGetParseString(entry, std::forward(args)...)); } template std::string PGetParseString(uint32 entry, Args&&... args) const { - return Acore::StringFormat(GetAcoreString(entry), std::forward(args)...); + return Acore::StringFormatFmt(GetAcoreString(entry), std::forward(args)...); } void SendErrorMessage(uint32 entry); diff --git a/src/server/game/Chat/ChatCommands/ChatCommand.cpp b/src/server/game/Chat/ChatCommands/ChatCommand.cpp index 9a68a213c..4ff2c34fb 100644 --- a/src/server/game/Chat/ChatCommands/ChatCommand.cpp +++ b/src/server/game/Chat/ChatCommands/ChatCommand.cpp @@ -198,8 +198,8 @@ void Acore::Impl::ChatCommands::ChatCommandNode::SendCommandHelp(ChatHandler& ha handler.SendSysMessage(std::get(_help)); else { - handler.PSendSysMessage(LANG_CMD_HELP_GENERIC, STRING_VIEW_FMT_ARG(_name)); - handler.PSendSysMessage(LANG_CMD_NO_HELP_AVAILABLE, STRING_VIEW_FMT_ARG(_name)); + handler.PSendSysMessage(LANG_CMD_HELP_GENERIC, _name); + handler.PSendSysMessage(LANG_CMD_NO_HELP_AVAILABLE, _name); } } @@ -218,14 +218,14 @@ void Acore::Impl::ChatCommands::ChatCommandNode::SendCommandHelp(ChatHandler& ha { if (!hasInvoker) { - handler.PSendSysMessage(LANG_CMD_HELP_GENERIC, STRING_VIEW_FMT_ARG(_name)); + handler.PSendSysMessage(LANG_CMD_HELP_GENERIC, _name); } handler.SendSysMessage(LANG_SUBCMDS_LIST); header = true; } - handler.PSendSysMessage(subCommandHasSubCommand ? LANG_SUBCMDS_LIST_ENTRY_ELLIPSIS : LANG_SUBCMDS_LIST_ENTRY, STRING_VIEW_FMT_ARG(it->second._name)); + handler.PSendSysMessage(subCommandHasSubCommand ? LANG_SUBCMDS_LIST_ENTRY_ELLIPSIS : LANG_SUBCMDS_LIST_ENTRY, it->second._name); } } @@ -301,14 +301,14 @@ namespace Acore::Impl::ChatCommands if (it2) { /* there are multiple matching subcommands - print possibilities and return */ if (cmd) - handler.PSendSysMessage(LANG_SUBCMD_AMBIGUOUS, STRING_VIEW_FMT_ARG(cmd->_name), COMMAND_DELIMITER, STRING_VIEW_FMT_ARG(token)); + handler.PSendSysMessage(LANG_SUBCMD_AMBIGUOUS, cmd->_name, COMMAND_DELIMITER, token); else - handler.PSendSysMessage(LANG_CMD_AMBIGUOUS, STRING_VIEW_FMT_ARG(token)); + handler.PSendSysMessage(LANG_CMD_AMBIGUOUS, token); - handler.PSendSysMessage(it1->second.HasVisibleSubCommands(handler) ? LANG_SUBCMDS_LIST_ENTRY_ELLIPSIS : LANG_SUBCMDS_LIST_ENTRY, STRING_VIEW_FMT_ARG(it1->first)); + handler.PSendSysMessage(it1->second.HasVisibleSubCommands(handler) ? LANG_SUBCMDS_LIST_ENTRY_ELLIPSIS : LANG_SUBCMDS_LIST_ENTRY, it1->first); do { - handler.PSendSysMessage(it2->second.HasVisibleSubCommands(handler) ? LANG_SUBCMDS_LIST_ENTRY_ELLIPSIS : LANG_SUBCMDS_LIST_ENTRY, STRING_VIEW_FMT_ARG(it2->first)); + handler.PSendSysMessage(it2->second.HasVisibleSubCommands(handler) ? LANG_SUBCMDS_LIST_ENTRY_ELLIPSIS : LANG_SUBCMDS_LIST_ENTRY, it2->first); } while (++it2); return true; @@ -359,10 +359,10 @@ namespace Acore::Impl::ChatCommands if (cmd) { cmd->SendCommandHelp(handler); - handler.PSendSysMessage(LANG_SUBCMD_INVALID, STRING_VIEW_FMT_ARG(cmd->_name), COMMAND_DELIMITER, STRING_VIEW_FMT_ARG(token)); + handler.PSendSysMessage(LANG_SUBCMD_INVALID, cmd->_name, COMMAND_DELIMITER, token); } else - handler.PSendSysMessage(LANG_CMD_INVALID, STRING_VIEW_FMT_ARG(token)); + handler.PSendSysMessage(LANG_CMD_INVALID, token); return; } @@ -374,14 +374,14 @@ namespace Acore::Impl::ChatCommands if (it2) { /* there are multiple matching subcommands - print possibilities and return */ if (cmd) - handler.PSendSysMessage(LANG_SUBCMD_AMBIGUOUS, STRING_VIEW_FMT_ARG(cmd->_name), COMMAND_DELIMITER, STRING_VIEW_FMT_ARG(token)); + handler.PSendSysMessage(LANG_SUBCMD_AMBIGUOUS, cmd->_name, COMMAND_DELIMITER, token); else - handler.PSendSysMessage(LANG_CMD_AMBIGUOUS, STRING_VIEW_FMT_ARG(token)); + handler.PSendSysMessage(LANG_CMD_AMBIGUOUS, token); - handler.PSendSysMessage(it1->second.HasVisibleSubCommands(handler) ? LANG_SUBCMDS_LIST_ENTRY_ELLIPSIS : LANG_SUBCMDS_LIST_ENTRY, STRING_VIEW_FMT_ARG(it1->first)); + handler.PSendSysMessage(it1->second.HasVisibleSubCommands(handler) ? LANG_SUBCMDS_LIST_ENTRY_ELLIPSIS : LANG_SUBCMDS_LIST_ENTRY, it1->first); do { - handler.PSendSysMessage(it2->second.HasVisibleSubCommands(handler) ? LANG_SUBCMDS_LIST_ENTRY_ELLIPSIS : LANG_SUBCMDS_LIST_ENTRY, STRING_VIEW_FMT_ARG(it2->first)); + handler.PSendSysMessage(it2->second.HasVisibleSubCommands(handler) ? LANG_SUBCMDS_LIST_ENTRY_ELLIPSIS : LANG_SUBCMDS_LIST_ENTRY, it2->first); } while (++it2); return; @@ -402,11 +402,11 @@ namespace Acore::Impl::ChatCommands handler.SendSysMessage(LANG_AVAILABLE_CMDS); do { - handler.PSendSysMessage(it->second.HasVisibleSubCommands(handler) ? LANG_SUBCMDS_LIST_ENTRY_ELLIPSIS : LANG_SUBCMDS_LIST_ENTRY, STRING_VIEW_FMT_ARG(it->second._name)); + handler.PSendSysMessage(it->second.HasVisibleSubCommands(handler) ? LANG_SUBCMDS_LIST_ENTRY_ELLIPSIS : LANG_SUBCMDS_LIST_ENTRY, it->second._name); } while (++it); } else - handler.PSendSysMessage(LANG_CMD_INVALID, STRING_VIEW_FMT_ARG(cmdStr)); + handler.PSendSysMessage(LANG_CMD_INVALID, cmdStr); } /*static*/ std::vector Acore::Impl::ChatCommands::ChatCommandNode::GetAutoCompletionsFor(ChatHandler const& handler, std::string_view cmdStr) diff --git a/src/server/game/Chat/ChatCommands/ChatCommandArgs.cpp b/src/server/game/Chat/ChatCommands/ChatCommandArgs.cpp index 44d77f933..da32757e6 100644 --- a/src/server/game/Chat/ChatCommands/ChatCommandArgs.cpp +++ b/src/server/game/Chat/ChatCommands/ChatCommandArgs.cpp @@ -63,7 +63,7 @@ ChatCommandResult Acore::Impl::ChatCommands::ArgInfo::TryConsum if (val.holds_alternative>()) return FormatAcoreString(handler, LANG_CMDPARSER_GAME_TELE_ID_NO_EXIST, static_cast(std::get>(val))); else - return FormatAcoreString(handler, LANG_CMDPARSER_GAME_TELE_NO_EXIST, STRING_VIEW_FMT_ARG(std::get(val))); + return FormatAcoreString(handler, LANG_CMDPARSER_GAME_TELE_NO_EXIST, std::get(val)); } struct ItemTemplateVisitor diff --git a/src/server/game/Chat/ChatCommands/ChatCommandArgs.h b/src/server/game/Chat/ChatCommands/ChatCommandArgs.h index 6b75e2355..d151dcc27 100644 --- a/src/server/game/Chat/ChatCommands/ChatCommandArgs.h +++ b/src/server/game/Chat/ChatCommands/ChatCommandArgs.h @@ -62,12 +62,12 @@ namespace Acore::Impl::ChatCommands if (Optional v = StringTo(token, 0)) val = *v; else - return FormatAcoreString(handler, LANG_CMDPARSER_STRING_VALUE_INVALID, STRING_VIEW_FMT_ARG(token), GetTypeName().c_str()); + return FormatAcoreString(handler, LANG_CMDPARSER_STRING_VALUE_INVALID, token, GetTypeName()); if constexpr (std::is_floating_point_v) { if (!std::isfinite(val)) - return FormatAcoreString(handler, LANG_CMDPARSER_STRING_VALUE_INVALID, STRING_VIEW_FMT_ARG(token), GetTypeName().c_str()); + return FormatAcoreString(handler, LANG_CMDPARSER_STRING_VALUE_INVALID, token, GetTypeName()); } return tail; @@ -200,7 +200,7 @@ namespace Acore::Impl::ChatCommands } if (next1) - return FormatAcoreString(handler, LANG_CMDPARSER_STRING_VALUE_INVALID, STRING_VIEW_FMT_ARG(strVal), GetTypeName().c_str()); + return FormatAcoreString(handler, LANG_CMDPARSER_STRING_VALUE_INVALID, strVal, GetTypeName()); else return next1; } diff --git a/src/server/game/Chat/ChatCommands/ChatCommandHelpers.h b/src/server/game/Chat/ChatCommands/ChatCommandHelpers.h index 6ead51731..dac07038d 100644 --- a/src/server/game/Chat/ChatCommands/ChatCommandHelpers.h +++ b/src/server/game/Chat/ChatCommands/ChatCommandHelpers.h @@ -125,7 +125,7 @@ namespace Acore::Impl::ChatCommands template std::string FormatAcoreString(ChatHandler const* handler, AcoreStrings which, Ts&&... args) { - return Acore::StringFormat(GetAcoreString(handler, which), std::forward(args)...); + return Acore::StringFormatFmt(GetAcoreString(handler, which), std::forward(args)...); } } diff --git a/src/server/game/Chat/ChatCommands/ChatCommandTags.cpp b/src/server/game/Chat/ChatCommands/ChatCommandTags.cpp index 40fcc277c..e9510e2f9 100644 --- a/src/server/game/Chat/ChatCommands/ChatCommandTags.cpp +++ b/src/server/game/Chat/ChatCommands/ChatCommandTags.cpp @@ -77,7 +77,7 @@ ChatCommandResult Acore::ChatCommands::AccountIdentifier::TryConsume(ChatHandler // try parsing as account id instead Optional id = Acore::StringTo(text, 10); if (!id) - return FormatAcoreString(handler, LANG_CMDPARSER_ACCOUNT_NAME_NO_EXIST, STRING_VIEW_FMT_ARG(_name)); + return FormatAcoreString(handler, LANG_CMDPARSER_ACCOUNT_NAME_NO_EXIST, _name); _id = *id; @@ -104,7 +104,7 @@ ChatCommandResult Acore::ChatCommands::PlayerIdentifier::TryConsume(ChatHandler } else if (!sCharacterCache->GetCharacterNameByGuid(_guid, _name)) { - return FormatAcoreString(handler, LANG_CMDPARSER_CHAR_GUID_NO_EXIST, _guid.ToString().c_str()); + return FormatAcoreString(handler, LANG_CMDPARSER_CHAR_GUID_NO_EXIST, _guid.ToString()); } return next; @@ -117,7 +117,7 @@ ChatCommandResult Acore::ChatCommands::PlayerIdentifier::TryConsume(ChatHandler _name.assign(val.get()); if (!normalizePlayerName(_name)) - return FormatAcoreString(handler, LANG_CMDPARSER_CHAR_NAME_INVALID, STRING_VIEW_FMT_ARG(_name)); + return FormatAcoreString(handler, LANG_CMDPARSER_CHAR_NAME_INVALID, _name); if ((_player = ObjectAccessor::FindPlayerByName(_name))) { @@ -125,7 +125,7 @@ ChatCommandResult Acore::ChatCommands::PlayerIdentifier::TryConsume(ChatHandler } else if (!(_guid = sCharacterCache->GetCharacterGuidByName(_name))) { - return FormatAcoreString(handler, LANG_CMDPARSER_CHAR_NAME_NO_EXIST, STRING_VIEW_FMT_ARG(_name)); + return FormatAcoreString(handler, LANG_CMDPARSER_CHAR_NAME_NO_EXIST, _name); } return next; diff --git a/src/server/game/Chat/ChatCommands/ChatCommandTags.h b/src/server/game/Chat/ChatCommands/ChatCommandTags.h index bea015ef4..bfc61504f 100644 --- a/src/server/game/Chat/ChatCommands/ChatCommandTags.h +++ b/src/server/game/Chat/ChatCommands/ChatCommandTags.h @@ -101,7 +101,7 @@ namespace Acore::ChatCommands return tail; start = args.substr(0, _string.length() + remainingToken.length()); } - return Acore::Impl::ChatCommands::FormatAcoreString(handler, LANG_CMDPARSER_EXACT_SEQ_MISMATCH, STRING_VIEW_FMT_ARG(_string), STRING_VIEW_FMT_ARG(start)); + return Acore::Impl::ChatCommands::FormatAcoreString(handler, LANG_CMDPARSER_EXACT_SEQ_MISMATCH, _string, start); } private: diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index aeec7a934..0b643923b 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -9393,11 +9393,11 @@ void Player::Whisper(std::string_view text, Language language, Player* target, b // announce afk or dnd message if (target->isAFK()) { - ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_AFK, target->GetName().c_str(), target->autoReplyMsg.c_str()); + ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_AFK, target->GetName(), target->autoReplyMsg); } else if (target->isDND()) { - ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_DND, target->GetName().c_str(), target->autoReplyMsg.c_str()); + ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_DND, target->GetName(), target->autoReplyMsg); } } diff --git a/src/server/game/Entities/Player/PlayerStorage.cpp b/src/server/game/Entities/Player/PlayerStorage.cpp index 65671e9a6..f350b3e9a 100644 --- a/src/server/game/Entities/Player/PlayerStorage.cpp +++ b/src/server/game/Entities/Player/PlayerStorage.cpp @@ -6640,11 +6640,11 @@ void Player::PrettyPrintRequirementsQuestList(const std::vectornote.empty()) { - ChatHandler(GetSession()).PSendSysMessage(" - %s", stream.str().c_str()); + ChatHandler(GetSession()).PSendSysMessage(" - {}", stream.str()); } else { - ChatHandler(GetSession()).PSendSysMessage(" - %s %s %s", stream.str().c_str(), sObjectMgr->GetAcoreString(LANG_ACCESS_REQUIREMENT_NOTE, loc_idx), missingReq->note.c_str()); + ChatHandler(GetSession()).PSendSysMessage(" - {} {} {}", stream.str(), sObjectMgr->GetAcoreString(LANG_ACCESS_REQUIREMENT_NOTE, loc_idx), missingReq->note); } } } @@ -6673,11 +6673,11 @@ void Player::PrettyPrintRequirementsAchievementsList(const std::vectornote.empty()) { - ChatHandler(GetSession()).PSendSysMessage(" - %s", stream.str().c_str()); + ChatHandler(GetSession()).PSendSysMessage(" - {}", stream.str()); } else { - ChatHandler(GetSession()).PSendSysMessage(" - %s %s %s", stream.str().c_str(), sObjectMgr->GetAcoreString(LANG_ACCESS_REQUIREMENT_NOTE, loc_idx), missingReq->note.c_str()); + ChatHandler(GetSession()).PSendSysMessage(" - {} {} {}", stream.str(), sObjectMgr->GetAcoreString(LANG_ACCESS_REQUIREMENT_NOTE, loc_idx), missingReq->note); } } } @@ -6711,11 +6711,11 @@ void Player::PrettyPrintRequirementsItemsList(const std::vectornote.empty()) { - ChatHandler(GetSession()).PSendSysMessage(" - %s", stream.str().c_str()); + ChatHandler(GetSession()).PSendSysMessage(" - {}", stream.str()); } else { - ChatHandler(GetSession()).PSendSysMessage(" - %s %s %s", stream.str().c_str(), sObjectMgr->GetAcoreString(LANG_ACCESS_REQUIREMENT_NOTE, loc_idx), missingReq->note.c_str()); + ChatHandler(GetSession()).PSendSysMessage(" - {} {} {}", stream.str(), sObjectMgr->GetAcoreString(LANG_ACCESS_REQUIREMENT_NOTE, loc_idx), missingReq->note); } } } @@ -6860,11 +6860,11 @@ bool Player::Satisfy(DungeonProgressionRequirements const* ar, uint32 target_map //Blizzlike method of printing out the requirements if (missingPlayerQuests.size() && !missingPlayerQuests[0]->note.empty()) { - ChatHandler(GetSession()).PSendSysMessage("%s", missingPlayerQuests[0]->note.c_str()); + ChatHandler(GetSession()).PSendSysMessage("{}", missingPlayerQuests[0]->note); } else if (missingLeaderQuests.size() && !missingLeaderQuests[0]->note.empty()) { - ChatHandler(GetSession()).PSendSysMessage("%s", missingLeaderQuests[0]->note.c_str()); + ChatHandler(GetSession()).PSendSysMessage("{}", missingLeaderQuests[0]->note); } else if (mapDiff->hasErrorMessage) { @@ -6902,7 +6902,7 @@ bool Player::Satisfy(DungeonProgressionRequirements const* ar, uint32 target_map } if (missingLeaderQuests.size()) { - ChatHandler(GetSession()).PSendSysMessage(LANG_ACCESS_REQUIREMENT_LEADER_COMPLETE_QUESTS, leaderName.c_str()); + ChatHandler(GetSession()).PSendSysMessage(LANG_ACCESS_REQUIREMENT_LEADER_COMPLETE_QUESTS, leaderName); PrettyPrintRequirementsQuestList(missingLeaderQuests); errorAlreadyPrinted = true; } @@ -6915,7 +6915,7 @@ bool Player::Satisfy(DungeonProgressionRequirements const* ar, uint32 target_map } if (missingLeaderAchievements.size()) { - ChatHandler(GetSession()).PSendSysMessage(LANG_ACCESS_REQUIREMENT_LEADER_COMPLETE_ACHIEVEMENTS, leaderName.c_str()); + ChatHandler(GetSession()).PSendSysMessage(LANG_ACCESS_REQUIREMENT_LEADER_COMPLETE_ACHIEVEMENTS, leaderName); PrettyPrintRequirementsAchievementsList(missingLeaderAchievements); errorAlreadyPrinted = true; } @@ -6929,7 +6929,7 @@ bool Player::Satisfy(DungeonProgressionRequirements const* ar, uint32 target_map if (missingLeaderItems.size()) { - ChatHandler(GetSession()).PSendSysMessage(LANG_ACCESS_REQUIREMENT_LEADER_OBTAIN_ITEMS, leaderName.c_str()); + ChatHandler(GetSession()).PSendSysMessage(LANG_ACCESS_REQUIREMENT_LEADER_OBTAIN_ITEMS, leaderName); PrettyPrintRequirementsItemsList(missingLeaderItems); errorAlreadyPrinted = true; } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index cd00e46b3..458dfcfc3 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -9348,7 +9348,7 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (maxcount > 0 && incrtime == 0) { if (player) - ChatHandler(player->GetSession()).PSendSysMessage("MaxCount != 0 (%u) but IncrTime == 0", maxcount); + ChatHandler(player->GetSession()).PSendSysMessage("MaxCount != 0 ({}) but IncrTime == 0", maxcount); else LOG_ERROR("sql.sql", "Table `(game_event_)npc_vendor` has `maxcount` ({}) for item {} of vendor (Entry: {}) but `incrtime`=0, ignore", maxcount, item_id, vendor_entry); return false; diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index eee354541..d42c1313d 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1447,7 +1447,7 @@ void Guild::HandleInviteMember(WorldSession* session, std::string const& name) uint32 memberLimit = sConfigMgr->GetOption("Guild.MemberLimit", 0); if (memberLimit > 0 && player->GetGuild()->GetMemberCount() >= memberLimit) { - ChatHandler(player->GetSession()).PSendSysMessage("Your guild has reached the maximum amount of members (%u). You cannot send another invite until the guild member count is lower.", memberLimit); + ChatHandler(player->GetSession()).PSendSysMessage("Your guild has reached the maximum amount of members ({}). You cannot send another invite until the guild member count is lower.", memberLimit); SendCommandResult(session, GUILD_COMMAND_INVITE, ERR_GUILD_INTERNAL, name); return; } diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index ad8ddbbce..6c503243c 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -831,7 +831,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder) // send server info if (sWorld->getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1) - chH.PSendSysMessage("%s", GitRevision::GetFullVersion()); + chH.PSendSysMessage("{}", GitRevision::GetFullVersion()); } if (uint32 guildId = sCharacterCache->GetCharacterGuildIdByGuid(pCurrChar->GetGUID())) @@ -879,7 +879,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder) // send new char string if not empty if (!sWorld->GetNewCharString().empty()) - chH.PSendSysMessage("%s", sWorld->GetNewCharString().c_str()); + chH.PSendSysMessage("{}", sWorld->GetNewCharString()); } } @@ -1150,7 +1150,7 @@ void WorldSession::HandlePlayerLoginToCharInWorld(Player* pCurrChar) // send server info if (sWorld->getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1) - chH.PSendSysMessage("%s", GitRevision::GetFullVersion()); + chH.PSendSysMessage("{}", GitRevision::GetFullVersion()); LOG_DEBUG("network.opcode", "WORLD: Sent server info"); } diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index c93b0c1b6..bbdf138b1 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -610,7 +610,7 @@ void WorldSession::HandleCharacterAuraFrozen(PreparedQueryResult result) { Field* fields = result->Fetch(); std::string player = fields[0].Get(); - handler.PSendSysMessage(LANG_COMMAND_FROZEN_PLAYERS, player.c_str()); + handler.PSendSysMessage(LANG_COMMAND_FROZEN_PLAYERS, player); } while (result->NextRow()); } @@ -1402,11 +1402,11 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket& recv_data) switch (group->GetDifficultyChangePreventionReason()) { case DIFFICULTY_PREVENTION_CHANGE_BOSS_KILLED: - ChatHandler(this).PSendSysMessage("Raid was in combat recently and may not change difficulty again for %u sec.", preventionTime); + ChatHandler(this).PSendSysMessage("Raid was in combat recently and may not change difficulty again for {} sec.", preventionTime); break; case DIFFICULTY_PREVENTION_CHANGE_RECENTLY_CHANGED: default: - ChatHandler(this).PSendSysMessage("Raid difficulty has changed recently, and may not change again for %u sec.", preventionTime); + ChatHandler(this).PSendSysMessage("Raid difficulty has changed recently, and may not change again for {} sec.", preventionTime); break; } diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 922ea5cb1..94d3893d6 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -348,7 +348,7 @@ public: switch (result) { case AOR_OK: - handler->PSendSysMessage(LANG_ACCOUNT_DELETED, accountName.c_str()); + handler->PSendSysMessage(LANG_ACCOUNT_DELETED, accountName); break; case AOR_NAME_NOT_EXIST: handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str()); @@ -400,12 +400,12 @@ public: { Field* fieldsLogin = resultLogin->Fetch(); handler->PSendSysMessage(LANG_ACCOUNT_LIST_LINE, - fieldsLogin[0].Get().c_str(), name.c_str(), fieldsLogin[1].Get().c_str(), + fieldsLogin[0].Get(), name, fieldsLogin[1].Get(), fieldsDB[2].Get(), fieldsDB[3].Get(), fieldsLogin[3].Get(), fieldsLogin[2].Get()); } else - handler->PSendSysMessage(LANG_ACCOUNT_LIST_ERROR, name.c_str()); + handler->PSendSysMessage(LANG_ACCOUNT_LIST_ERROR, name); } while (result->NextRow()); handler->SendSysMessage(LANG_ACCOUNT_LIST_BAR); @@ -428,14 +428,14 @@ public: std::string accountName = _accountName; if (!Utf8ToUpperOnlyLatin(accountName)) { - handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str()); + handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName); return false; } uint32 accountId = AccountMgr::GetId(accountName); if (!accountId) { - handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str()); + handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName); return false; } @@ -599,14 +599,14 @@ public: if (!Utf8ToUpperOnlyLatin(accountName)) { - handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str()); + handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName); return false; } uint32 targetAccountId = AccountMgr::GetId(accountName); if (!targetAccountId) { - handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str()); + handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName); return false; } @@ -651,7 +651,7 @@ public: stmt->SetData(1, targetAccountId); LoginDatabase.Execute(stmt); - handler->PSendSysMessage(LANG_2FA_SECRET_SET_COMPLETE, accountName.c_str()); + handler->PSendSysMessage(LANG_2FA_SECRET_SET_COMPLETE, accountName); return true; } @@ -691,14 +691,14 @@ public: accountName = account; if (!Utf8ToUpperOnlyLatin(accountName)) { - handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str()); + handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName); return false; } accountId = AccountMgr::GetId(accountName); if (!accountId) { - handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str()); + handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName); return false; } } @@ -720,7 +720,7 @@ public: LoginDatabase.Execute(stmt); - handler->PSendSysMessage(LANG_ACCOUNT_SETADDON, accountName.c_str(), accountId, *expansion); + handler->PSendSysMessage(LANG_ACCOUNT_SETADDON, accountName, accountId, *expansion); return true; } @@ -755,7 +755,7 @@ public: targetAccountName = arg1; if (!Utf8ToUpperOnlyLatin(targetAccountName)) { - handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, targetAccountName.c_str()); + handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, targetAccountName); return false; } } @@ -838,7 +838,7 @@ public: LoginDatabase.Execute(stmt); } - handler->PSendSysMessage(LANG_YOU_CHANGE_SECURITY, targetAccountName.c_str(), gm); + handler->PSendSysMessage(LANG_YOU_CHANGE_SECURITY, targetAccountName, gm); return true; } @@ -859,14 +859,14 @@ public: std::string accountName = account; if (!Utf8ToUpperOnlyLatin(accountName)) { - handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str()); + handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName); return false; } uint32 targetAccountId = AccountMgr::GetId(accountName); if (!targetAccountId) { - handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str()); + handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName); return false; } @@ -889,7 +889,7 @@ public: handler->SendSysMessage(LANG_COMMAND_PASSWORD); break; case AOR_NAME_NOT_EXIST: - handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str()); + handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, accountName); return false; case AOR_PASS_TOO_LONG: handler->SendErrorMessage(LANG_PASSWORD_TOO_LONG); diff --git a/src/server/scripts/Commands/cs_arena.cpp b/src/server/scripts/Commands/cs_arena.cpp index 3531d62de..b556238e2 100644 --- a/src/server/scripts/Commands/cs_arena.cpp +++ b/src/server/scripts/Commands/cs_arena.cpp @@ -58,7 +58,7 @@ public: { if (sArenaTeamMgr->GetArenaTeamByName(name)) { - handler->SendErrorMessage(LANG_ARENA_ERROR_NAME_EXISTS, name.c_str()); + handler->SendErrorMessage(LANG_ARENA_ERROR_NAME_EXISTS, name); return false; } @@ -70,7 +70,7 @@ public: if (Player::GetArenaTeamIdFromDB(captain->GetGUID(), type) != 0) { - handler->SendErrorMessage(LANG_ARENA_ERROR_SIZE, captain->GetName().c_str()); + handler->SendErrorMessage(LANG_ARENA_ERROR_SIZE, captain->GetName()); return false; } @@ -84,7 +84,7 @@ public: } sArenaTeamMgr->AddArenaTeam(arena); - handler->PSendSysMessage(LANG_ARENA_CREATE, arena->GetName().c_str(), arena->GetId(), arena->GetType(), arena->GetCaptain().GetCounter()); + handler->PSendSysMessage(LANG_ARENA_CREATE, arena->GetName(), arena->GetId(), arena->GetType(), arena->GetCaptain().ToString()); return true; } @@ -110,7 +110,7 @@ public: delete(arena); - handler->PSendSysMessage(LANG_ARENA_DISBAND, name.c_str(), teamId); + handler->PSendSysMessage(LANG_ARENA_DISBAND, name, teamId); return true; } @@ -119,13 +119,13 @@ public: ArenaTeam* arena = sArenaTeamMgr->GetArenaTeamByName(oldName); if (!arena) { - handler->SendErrorMessage(LANG_ARENA_ERROR_NAME_NOT_FOUND, oldName.c_str()); + handler->SendErrorMessage(LANG_ARENA_ERROR_NAME_NOT_FOUND, oldName); return false; } if (sArenaTeamMgr->GetArenaTeamByName(newName)) { - handler->SendErrorMessage(LANG_ARENA_ERROR_NAME_EXISTS, oldName.c_str()); + handler->SendErrorMessage(LANG_ARENA_ERROR_NAME_EXISTS, oldName); return false; } @@ -141,7 +141,7 @@ public: return false; } - handler->PSendSysMessage(LANG_ARENA_RENAME, arena->GetId(), oldName.c_str(), newName.c_str()); + handler->PSendSysMessage(LANG_ARENA_RENAME, arena->GetId(), oldName, newName); return true; } @@ -169,13 +169,13 @@ public: if (!arena->IsMember(target->GetGUID())) { - handler->SendErrorMessage(LANG_ARENA_ERROR_NOT_MEMBER, target->GetName().c_str(), arena->GetName().c_str()); + handler->SendErrorMessage(LANG_ARENA_ERROR_NOT_MEMBER, target->GetName(), arena->GetName()); return false; } if (arena->GetCaptain() == target->GetGUID()) { - handler->SendErrorMessage(LANG_ARENA_ERROR_CAPTAIN, target->GetName().c_str(), arena->GetName().c_str()); + handler->SendErrorMessage(LANG_ARENA_ERROR_CAPTAIN, target->GetName(), arena->GetName()); return false; } @@ -183,7 +183,7 @@ public: sCharacterCache->GetCharacterNameByGuid(arena->GetCaptain(), oldCaptainName); arena->SetCaptain(target->GetGUID()); - handler->PSendSysMessage(LANG_ARENA_CAPTAIN, arena->GetName().c_str(), arena->GetId(), oldCaptainName.c_str(), target->GetName().c_str()); + handler->PSendSysMessage(LANG_ARENA_CAPTAIN, arena->GetName(), arena->GetId(), oldCaptainName, target->GetName()); return true; } @@ -197,10 +197,10 @@ public: return false; } - handler->PSendSysMessage(LANG_ARENA_INFO_HEADER, arena->GetName().c_str(), arena->GetId(), arena->GetRating(), arena->GetType(), arena->GetType()); + handler->PSendSysMessage(LANG_ARENA_INFO_HEADER, arena->GetName(), arena->GetId(), arena->GetRating(), arena->GetType(), arena->GetType()); for (auto const& itr : arena->GetMembers()) - handler->PSendSysMessage(LANG_ARENA_INFO_MEMBERS, itr.Name.c_str(), itr.Guid.GetCounter(), itr.PersonalRating, (arena->GetCaptain() == itr.Guid ? "- Captain" : "")); + handler->PSendSysMessage(LANG_ARENA_INFO_MEMBERS, itr.Name, itr.Guid.ToString(), itr.PersonalRating, (arena->GetCaptain() == itr.Guid ? "- Captain" : "")); return true; } @@ -217,7 +217,7 @@ public: { if (handler->GetSession()) { - handler->PSendSysMessage(LANG_ARENA_LOOKUP, team->GetName().c_str(), team->GetId(), team->GetType(), team->GetType()); + handler->PSendSysMessage(LANG_ARENA_LOOKUP, team->GetName(), team->GetId(), team->GetType(), team->GetType()); found = true; continue; } @@ -225,7 +225,7 @@ public: } if (!found) - handler->PSendSysMessage(LANG_ARENA_ERROR_NAME_NOT_FOUND, std::string(needle).c_str()); + handler->PSendSysMessage(LANG_ARENA_ERROR_NAME_NOT_FOUND, std::string(needle)); return true; } diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp index a17880f23..92d4a3683 100644 --- a/src/server/scripts/Commands/cs_ban.cpp +++ b/src/server/scripts/Commands/cs_ban.cpp @@ -131,17 +131,17 @@ public: if (atoi(durationStr) > 0) { if (!sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD)) - handler->PSendSysMessage(LANG_BAN_YOUBANNED, name.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr); + handler->PSendSysMessage(LANG_BAN_YOUBANNED, name, secsToTimeString(TimeStringToSecs(durationStr), true), reasonStr); } else { if (!sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD)) - handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, name.c_str(), reasonStr); + handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, name, reasonStr); } break; case BAN_NOTFOUND: { - handler->SendErrorMessage(LANG_BAN_NOTFOUND, "character", name.c_str()); + handler->SendErrorMessage(LANG_BAN_NOTFOUND, "character", name); return false; } default: @@ -185,7 +185,7 @@ public: case BAN_ACCOUNT: if (!Utf8ToUpperOnlyLatin(nameOrIP)) { - handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, nameOrIP.c_str()); + handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, nameOrIP); return false; } break; @@ -224,12 +224,12 @@ public: if (atoi(durationStr) > 0) { if (!sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD)) - handler->PSendSysMessage(LANG_BAN_YOUBANNED, nameOrIP.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr); + handler->PSendSysMessage(LANG_BAN_YOUBANNED, nameOrIP, secsToTimeString(TimeStringToSecs(durationStr), true), reasonStr); } else { if (!sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD)) - handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, nameOrIP.c_str(), reasonStr); + handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, nameOrIP, reasonStr); } break; case BAN_SYNTAX_ERROR: @@ -238,13 +238,13 @@ public: switch (mode) { default: - handler->SendErrorMessage(LANG_BAN_NOTFOUND, "account", nameOrIP.c_str()); + handler->SendErrorMessage(LANG_BAN_NOTFOUND, "account", nameOrIP); break; case BAN_CHARACTER: - handler->SendErrorMessage(LANG_BAN_NOTFOUND, "character", nameOrIP.c_str()); + handler->SendErrorMessage(LANG_BAN_NOTFOUND, "character", nameOrIP); break; case BAN_IP: - handler->SendErrorMessage(LANG_BAN_NOTFOUND, "ip", nameOrIP.c_str()); + handler->SendErrorMessage(LANG_BAN_NOTFOUND, "ip", nameOrIP); break; } return false; @@ -270,14 +270,14 @@ public: std::string accountName = nameStr; 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->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str()); + handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName); return true; } @@ -305,7 +305,7 @@ public: bool permanent = (fields[1].Get() == uint64(0)); std::string banTime = permanent ? handler->GetAcoreString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].Get(), true); handler->PSendSysMessage(LANG_BANINFO_HISTORYENTRY, - fields[0].Get().c_str(), banTime.c_str(), active ? handler->GetAcoreString(LANG_YES) : handler->GetAcoreString(LANG_NO), fields[4].Get().c_str(), fields[5].Get().c_str()); + fields[0].Get(), banTime, active ? handler->GetAcoreString(LANG_YES) : handler->GetAcoreString(LANG_NO), fields[4].Get(), fields[5].Get()); } while (result->NextRow()); return true; @@ -338,11 +338,11 @@ public: PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) { - handler->PSendSysMessage(LANG_CHAR_NOT_BANNED, name.c_str()); + handler->PSendSysMessage(LANG_CHAR_NOT_BANNED, name); return true; } - handler->PSendSysMessage(LANG_BANINFO_BANHISTORY, name.c_str()); + handler->PSendSysMessage(LANG_BANINFO_BANHISTORY, name); do { Field* fields = result->Fetch(); @@ -353,7 +353,7 @@ public: bool permanent = (fields[1].Get() == uint32(0)); std::string banTime = permanent ? handler->GetAcoreString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].Get(), true); handler->PSendSysMessage(LANG_BANINFO_HISTORYENTRY, - fields[0].Get().c_str(), banTime.c_str(), active ? handler->GetAcoreString(LANG_YES) : handler->GetAcoreString(LANG_NO), fields[4].Get().c_str(), fields[5].Get().c_str()); + fields[0].Get(), banTime, active ? handler->GetAcoreString(LANG_YES) : handler->GetAcoreString(LANG_NO), fields[4].Get(), fields[5].Get()); } while (result->NextRow()); return true; @@ -391,8 +391,8 @@ public: Field* fields = result->Fetch(); bool permanent = fields[6].Get() == 1; handler->PSendSysMessage(LANG_BANINFO_IPENTRY, - fields[0].Get().c_str(), fields[1].Get().c_str(), permanent ? handler->GetAcoreString(LANG_BANINFO_NEVER) : fields[2].Get().c_str(), - permanent ? handler->GetAcoreString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[3].Get(), true).c_str(), fields[4].Get().c_str(), fields[5].Get().c_str()); + fields[0].Get(), fields[1].Get(), permanent ? handler->GetAcoreString(LANG_BANINFO_NEVER) : fields[2].Get(), + permanent ? handler->GetAcoreString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[3].Get(), true), fields[4].Get(), fields[5].Get()); return true; } @@ -444,7 +444,7 @@ public: if (banResult) { Field* fields2 = banResult->Fetch(); - handler->PSendSysMessage("%s", fields2[0].Get().c_str()); + handler->PSendSysMessage("%s", fields2[0].Get()); } } while (result->NextRow()); } @@ -481,16 +481,16 @@ public: if (fields2[0].Get() == fields2[1].Get()) { handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|", - accountName.c_str(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min, - fields2[2].Get().c_str(), fields2[3].Get().c_str()); + 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|", - accountName.c_str(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min, + 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().c_str(), fields2[3].Get().c_str()); + fields2[2].Get(), fields2[3].Get()); } } while (banInfo->NextRow()); } @@ -534,7 +534,7 @@ public: PreparedQueryResult banResult = CharacterDatabase.Query(stmt2); if (banResult) - handler->PSendSysMessage("%s", (*banResult)[0].Get().c_str()); + handler->PSendSysMessage("%s", (*banResult)[0].Get()); } while (result->NextRow()); } // Console wide output @@ -565,16 +565,16 @@ public: if (banFields[0].Get() == banFields[1].Get()) { handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|", - char_name.c_str(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min, - banFields[2].Get().c_str(), banFields[3].Get().c_str()); + 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|", - char_name.c_str(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min, + 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().c_str(), banFields[3].Get().c_str()); + banFields[2].Get(), banFields[3].Get()); } } while (banInfo->NextRow()); } @@ -621,7 +621,7 @@ public: do { Field* fields = result->Fetch(); - handler->PSendSysMessage("%s", fields[0].Get().c_str()); + handler->PSendSysMessage("%s", fields[0].Get()); } while (result->NextRow()); } // Console wide output @@ -638,16 +638,16 @@ public: if (fields[1].Get() == fields[2].Get()) { handler->PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d| permanent |%-15.15s|%-15.15s|", - fields[0].Get().c_str(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min, - fields[3].Get().c_str(), fields[4].Get().c_str()); + 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|", - fields[0].Get().c_str(), tmBan.tm_year % 100, tmBan.tm_mon + 1, tmBan.tm_mday, tmBan.tm_hour, tmBan.tm_min, + 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().c_str(), fields[4].Get().c_str()); + fields[3].Get(), fields[4].Get()); } } while (result->NextRow()); @@ -714,7 +714,7 @@ public: case BAN_ACCOUNT: if (!Utf8ToUpperOnlyLatin(nameOrIP)) { - handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, nameOrIP.c_str()); + handler->SendErrorMessage(LANG_ACCOUNT_NOT_EXIST, nameOrIP); return false; } break; @@ -735,21 +735,21 @@ public: { case BAN_ACCOUNT: if (sBan->RemoveBanAccount(nameOrIP)) - handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str()); + handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP); else - handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str()); + handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP); break; case BAN_CHARACTER: if (sBan->RemoveBanAccountByPlayerName(nameOrIP)) - handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str()); + handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP); else - handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str()); + handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP); break; case BAN_IP: if (sBan->RemoveBanIP(nameOrIP)) - handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str()); + handler->PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP); else - handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str()); + handler->PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP); break; default: break; diff --git a/src/server/scripts/Commands/cs_cache.cpp b/src/server/scripts/Commands/cs_cache.cpp index d32ba2575..396f4dd0b 100644 --- a/src/server/scripts/Commands/cs_cache.cpp +++ b/src/server/scripts/Commands/cs_cache.cpp @@ -65,8 +65,8 @@ public: return false; } - handler->PSendSysMessage(LANG_COMMAND_CACHE_INFO, cache->Name, cache->Guid.GetCounter(), cache->AccountId, - cache->Class, cache->Race, cache->Sex, cache->Level, cache->MailCount, cache->GuildId, cache->GroupGuid.GetCounter(), + handler->PSendSysMessage(LANG_COMMAND_CACHE_INFO, cache->Name, cache->Guid.ToString(), cache->AccountId, + cache->Class, cache->Race, cache->Sex, cache->Level, cache->MailCount, cache->GuildId, cache->GroupGuid.ToString(), cache->ArenaTeamId[ARENA_SLOT_2v2], cache->ArenaTeamId[ARENA_SLOT_3v3], cache->ArenaTeamId[ARENA_SLOT_5v5]); handler->SetSentErrorMessage(false); @@ -87,7 +87,7 @@ public: } sCharacterCache->DeleteCharacterCacheEntry(player->GetGUID(), player->GetName()); - handler->PSendSysMessage(LANG_COMMAND_CACHE_DELETE, player->GetName(), player->GetGUID().GetCounter()); + handler->PSendSysMessage(LANG_COMMAND_CACHE_DELETE, player->GetName(), player->GetGUID().ToString()); handler->SetSentErrorMessage(false); return true; } @@ -141,7 +141,7 @@ public: sCharacterCache->RefreshCacheEntry(player->GetGUID().GetCounter()); } - handler->PSendSysMessage(LANG_COMMAND_CACHE_REFRESH, player->GetName(), player->GetGUID().GetCounter()); + handler->PSendSysMessage(LANG_COMMAND_CACHE_REFRESH, player->GetName(), player->GetGUID().ToString()); handler->SetSentErrorMessage(false); return true; } diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index e04c96904..44d14e6e6 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -188,12 +188,12 @@ public: if (!handler->GetSession()) handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CONSOLE, - itr->lowGuid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), - itr->accountId, dateStr.c_str()); + itr->lowGuid, itr->name, itr->accountName.empty() ? "" : itr->accountName, + itr->accountId, dateStr); else handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CHAT, - itr->lowGuid, itr->name.c_str(), itr->accountName.empty() ? "" : itr->accountName.c_str(), - itr->accountId, dateStr.c_str()); + itr->lowGuid, itr->name, itr->accountName.empty() ? "" : itr->accountName, + itr->accountId, dateStr); } if (!handler->GetSession()) @@ -214,7 +214,7 @@ public: { if (delInfo.accountName.empty()) // account does not exist { - handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.lowGuid, delInfo.accountId); + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name, delInfo.lowGuid, delInfo.accountId); return; } @@ -222,13 +222,13 @@ public: uint32 charcount = AccountMgr::GetCharactersCount(delInfo.accountId); if (charcount >= 10) { - handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.lowGuid, delInfo.accountId); + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name, delInfo.lowGuid, delInfo.accountId); return; } if (sCharacterCache->GetCharacterGuidByName(delInfo.name)) { - handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.lowGuid, delInfo.accountId); + handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name, delInfo.lowGuid, delInfo.accountId); return; } @@ -257,11 +257,11 @@ public: if (handler->needReportToTarget(player)) { if (oldLevel == newLevel) - ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_LEVEL_PROGRESS_RESET, handler->GetNameLink().c_str()); + ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_LEVEL_PROGRESS_RESET, handler->GetNameLink()); else if (oldLevel < newLevel) - ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_LEVEL_UP, handler->GetNameLink().c_str(), newLevel); + ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_LEVEL_UP, handler->GetNameLink(), newLevel); else // if (oldlevel > newlevel) - ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_LEVEL_DOWN, handler->GetNameLink().c_str(), newLevel); + ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_LEVEL_DOWN, handler->GetNameLink(), newLevel); } } else @@ -314,7 +314,7 @@ public: // send title in "id (idx:idx) - [namedlink locale]" format if (handler->GetSession()) - handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleName.c_str(), localeNames[loc], knownStr, activeStr); + handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleName, localeNames[loc], knownStr, activeStr); else handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name, localeNames[loc], knownStr, activeStr); } @@ -371,7 +371,7 @@ public: PreparedQueryResult result = CharacterDatabase.Query(stmt); if (result) { - handler->SendErrorMessage(LANG_RENAME_PLAYER_ALREADY_EXISTS, newName.c_str()); + handler->SendErrorMessage(LANG_RENAME_PLAYER_ALREADY_EXISTS, newName); return false; } @@ -399,13 +399,13 @@ public: sCharacterCache->UpdateCharacterData(player->GetGUID(), newName); - handler->PSendSysMessage(LANG_RENAME_PLAYER_WITH_NEW_NAME, player->GetName().c_str(), newName.c_str()); + handler->PSendSysMessage(LANG_RENAME_PLAYER_WITH_NEW_NAME, player->GetName(), newName); } else { if (Player* target = player->GetConnectedPlayer()) { - handler->PSendSysMessage(LANG_RENAME_PLAYER, handler->GetNameLink(target).c_str()); + handler->PSendSysMessage(LANG_RENAME_PLAYER, handler->GetNameLink(target)); target->SetAtLoginFlag(AT_LOGIN_RENAME); } else @@ -414,7 +414,7 @@ public: if (handler->HasLowerSecurity(nullptr, player->GetGUID())) return false; - handler->PSendSysMessage(LANG_RENAME_PLAYER_GUID, handler->playerLink(*player).c_str(), player->GetGUID().GetCounter()); + handler->PSendSysMessage(LANG_RENAME_PLAYER_GUID, handler->playerLink(*player), player->GetGUID().ToString()); CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); stmt->SetData(0, uint16(AT_LOGIN_RENAME)); @@ -450,7 +450,7 @@ public: HandleCharacterLevel(player->GetConnectedPlayer(), player->GetGUID(), oldlevel, newlevel, handler); if (!handler->GetSession() || (handler->GetSession()->GetPlayer() != player->GetConnectedPlayer())) // including chr == NULL - handler->PSendSysMessage(LANG_YOU_CHANGE_LVL, handler->playerLink(*player).c_str(), newlevel); + handler->PSendSysMessage(LANG_YOU_CHANGE_LVL, handler->playerLink(*player), newlevel); return true; } @@ -465,12 +465,12 @@ public: if (Player* target = player->GetConnectedPlayer()) { - handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str()); + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target)); target->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE); } else { - handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, handler->playerLink(*player).c_str(), player->GetGUID().GetCounter()); + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, handler->playerLink(*player), player->GetGUID().ToString()); CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); stmt->SetData(0, static_cast(AT_LOGIN_CUSTOMIZE)); stmt->SetData(1, player->GetGUID().GetCounter()); @@ -489,12 +489,12 @@ public: if (Player* target = player->GetConnectedPlayer()) { - handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str()); + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target)); target->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION); } else { - handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, handler->playerLink(*player).c_str(), player->GetGUID().GetCounter()); + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, handler->playerLink(*player), player->GetGUID().ToString()); CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); stmt->SetData(0, uint16(AT_LOGIN_CHANGE_FACTION)); stmt->SetData(1, player->GetGUID().GetCounter()); @@ -513,12 +513,12 @@ public: if (Player* target = player->GetConnectedPlayer()) { - handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str()); + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target)); target->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE); } else { - handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, handler->playerLink(*player).c_str(), player->GetGUID().GetCounter()); + handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, handler->playerLink(*player), player->GetGUID().ToString()); CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG); stmt->SetData(0, uint16(AT_LOGIN_CHANGE_RACE)); stmt->SetData(1, player->GetGUID().GetCounter()); @@ -746,7 +746,7 @@ public: AccountMgr::GetName(accountId, accountName); Player::DeleteFromDB(player.GetGUID().GetCounter(), accountId, true, true); - handler->PSendSysMessage(LANG_CHARACTER_DELETED, player.GetName().c_str(), player.GetGUID().GetCounter(), accountName.c_str(), accountId); + handler->PSendSysMessage(LANG_CHARACTER_DELETED, player.GetName(), player.GetGUID().ToString(), accountName, accountId); return true; } @@ -771,7 +771,7 @@ public: HandleCharacterLevel(player->GetConnectedPlayer(), player->GetGUID(), oldlevel, newlevel, handler); if (!handler->GetSession() || (handler->GetSession()->GetPlayer() != player->GetConnectedPlayer())) // including chr == NULL - handler->PSendSysMessage(LANG_YOU_CHANGE_LVL, handler->playerLink(*player).c_str(), newlevel); + handler->PSendSysMessage(LANG_YOU_CHANGE_LVL, handler->playerLink(*player), newlevel); return true; } @@ -819,13 +819,13 @@ public: handler->PSendSysMessage(LANG_COMMAND_IMPORT_SUCCESS); break; case DUMP_FILE_OPEN_ERROR: - handler->SendErrorMessage(LANG_FILE_OPEN_FAIL, fileName.c_str()); + handler->SendErrorMessage(LANG_FILE_OPEN_FAIL, fileName); return false; case DUMP_FILE_BROKEN: - handler->SendErrorMessage(LANG_DUMP_BROKEN, fileName.c_str()); + handler->SendErrorMessage(LANG_DUMP_BROKEN, fileName); return false; case DUMP_TOO_MANY_CHARS: - handler->SendErrorMessage(LANG_ACCOUNT_CHARACTER_LIST_FULL, account.GetName().c_str(), account.GetID()); + handler->SendErrorMessage(LANG_ACCOUNT_CHARACTER_LIST_FULL, account.GetName(), account.GetID()); return false; default: handler->SendErrorMessage(LANG_COMMAND_IMPORT_FAILED); @@ -860,7 +860,7 @@ public: case DUMP_SUCCESS: break; case DUMP_TOO_MANY_CHARS: - handler->SendErrorMessage(LANG_ACCOUNT_CHARACTER_LIST_FULL, account.GetName().c_str(), account.GetID()); + handler->SendErrorMessage(LANG_ACCOUNT_CHARACTER_LIST_FULL, account.GetName(), account.GetID()); return false; case DUMP_FILE_OPEN_ERROR: // this error code should not happen case DUMP_FILE_BROKEN: // this error code should not happen @@ -884,7 +884,7 @@ public: handler->PSendSysMessage(LANG_COMMAND_EXPORT_SUCCESS); break; case DUMP_FILE_OPEN_ERROR: - handler->SendErrorMessage(LANG_FILE_OPEN_FAIL, fileName.c_str()); + handler->SendErrorMessage(LANG_FILE_OPEN_FAIL, fileName); return false; case DUMP_CHARACTER_DELETED: handler->SendErrorMessage(LANG_COMMAND_EXPORT_DELETED_CHAR); @@ -942,7 +942,7 @@ public: std::ostringstream ItemString; ItemString << std::hex << ItemQualityColors[item->GetTemplate()->Quality]; - handler->PSendSysMessage("%u - |c%s|Hitem:%u:0:0:0:0:0:0:0:0:0|h[%s]|h|r - %u", Counter, ItemString.str().c_str(), item->GetEntry(), item->GetTemplate()->Name1.c_str(), item->GetCount()); + handler->PSendSysMessage("{} - |c{}|Hitem:{}:0:0:0:0:0:0:0:0:0|h[{}]|h|r - {}", Counter, ItemString.str(), item->GetEntry(), item->GetTemplate()->Name1, item->GetCount()); } } } @@ -958,7 +958,7 @@ public: std::ostringstream ItemString; ItemString << std::hex << ItemQualityColors[item->GetTemplate()->Quality]; - handler->PSendSysMessage("%u - |c%s|Hitem:%u:0:0:0:0:0:0:0:0:0|h[%s]|h|r - %u", Counter, ItemString.str().c_str(), item->GetEntry(), item->GetTemplate()->Name1.c_str(), item->GetCount()); + handler->PSendSysMessage("{} - |c{}|Hitem:{}:0:0:0:0:0:0:0:0:0|h[{}]|h|r - {}", Counter, ItemString.str(), item->GetEntry(), item->GetTemplate()->Name1, item->GetCount()); } } } @@ -998,43 +998,43 @@ public: switch (SkillID) { case SKILL_ALCHEMY: - handler->PSendSysMessage("%u - Alchemy - %u", Counter, player->GetSkillValue(SkillID)); + handler->PSendSysMessage("{} - Alchemy - {}", Counter, player->GetSkillValue(SkillID)); break; case SKILL_BLACKSMITHING: - handler->PSendSysMessage("%u - Blacksmithing - %u", Counter, player->GetSkillValue(SkillID)); + handler->PSendSysMessage("{} - Blacksmithing - {}", Counter, player->GetSkillValue(SkillID)); break; case SKILL_ENCHANTING: - handler->PSendSysMessage("%u - Enchanting - %u", Counter, player->GetSkillValue(SkillID)); + handler->PSendSysMessage("{} - Enchanting - {}", Counter, player->GetSkillValue(SkillID)); break; case SKILL_ENGINEERING: - handler->PSendSysMessage("%u - Engineering - %u", Counter, player->GetSkillValue(SkillID)); + handler->PSendSysMessage("{} - Engineering - {}", Counter, player->GetSkillValue(SkillID)); break; case SKILL_INSCRIPTION: - handler->PSendSysMessage("%u - Inscription - %u", Counter, player->GetSkillValue(SkillID)); + handler->PSendSysMessage("{} - Inscription - {}", Counter, player->GetSkillValue(SkillID)); break; case SKILL_JEWELCRAFTING: - handler->PSendSysMessage("%u - Jewelcrafting - %u", Counter, player->GetSkillValue(SkillID)); + handler->PSendSysMessage("{} - Jewelcrafting - {}", Counter, player->GetSkillValue(SkillID)); break; case SKILL_LEATHERWORKING: - handler->PSendSysMessage("%u - Leatherworking - %u", Counter, player->GetSkillValue(SkillID)); + handler->PSendSysMessage("{} - Leatherworking - {}", Counter, player->GetSkillValue(SkillID)); break; case SKILL_TAILORING: - handler->PSendSysMessage("%u - Tailoring - %u", Counter, player->GetSkillValue(SkillID)); + handler->PSendSysMessage("{} - Tailoring - {}", Counter, player->GetSkillValue(SkillID)); break; case SKILL_SKINNING: - handler->PSendSysMessage("%u - Skinning - %u", Counter, player->GetSkillValue(SkillID)); + handler->PSendSysMessage("{} - Skinning - {}", Counter, player->GetSkillValue(SkillID)); break; case SKILL_HERBALISM: - handler->PSendSysMessage("%u - Herbalism - %u", Counter, player->GetSkillValue(SkillID)); + handler->PSendSysMessage("{} - Herbalism - {}", Counter, player->GetSkillValue(SkillID)); break; case SKILL_MINING: - handler->PSendSysMessage("%u - Mining - %u", Counter, player->GetSkillValue(SkillID)); + handler->PSendSysMessage("{} - Mining - {}", Counter, player->GetSkillValue(SkillID)); break; case SKILL_COOKING: - handler->PSendSysMessage("%u - Cooking - %u", Counter, player->GetSkillValue(SkillID)); + handler->PSendSysMessage("{} - Cooking - {}", Counter, player->GetSkillValue(SkillID)); break; case SKILL_FIRST_AID: - handler->PSendSysMessage("%u - First Aid - %u", Counter, player->GetSkillValue(SkillID)); + handler->PSendSysMessage("{} - First Aid - {}", Counter, player->GetSkillValue(SkillID)); break; default: break; @@ -1071,7 +1071,7 @@ public: { std::string accName; AccountMgr::GetName(cache->AccountId, accName); - handler->PSendSysMessage(LANG_CMD_CHAR_CHANGE_ACC_SUCCESS, player->GetName(), player->GetGUID().GetCounter(), accName, cache->AccountId, accountName, accountId); + handler->PSendSysMessage(LANG_CMD_CHAR_CHANGE_ACC_SUCCESS, player->GetName(), player->GetGUID().ToString(), accName, cache->AccountId, accountName, accountId); } if (player->IsConnected()) diff --git a/src/server/scripts/Commands/cs_cheat.cpp b/src/server/scripts/Commands/cs_cheat.cpp index 5b6eadd47..340176e19 100644 --- a/src/server/scripts/Commands/cs_cheat.cpp +++ b/src/server/scripts/Commands/cs_cheat.cpp @@ -185,16 +185,16 @@ public: if (enable) { chr->SetTaxiCheater(true); - handler->PSendSysMessage(LANG_YOU_GIVE_TAXIS, handler->GetNameLink(chr).c_str()); + handler->PSendSysMessage(LANG_YOU_GIVE_TAXIS, handler->GetNameLink(chr)); if (handler->needReportToTarget(chr)) - ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, handler->GetNameLink().c_str()); + ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, handler->GetNameLink()); } else { chr->SetTaxiCheater(false); - handler->PSendSysMessage(LANG_YOU_REMOVE_TAXIS, handler->GetNameLink(chr).c_str()); + handler->PSendSysMessage(LANG_YOU_REMOVE_TAXIS, handler->GetNameLink(chr)); if (handler->needReportToTarget(chr)) - ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, handler->GetNameLink().c_str()); + ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, handler->GetNameLink()); } return true; @@ -211,15 +211,15 @@ public: if (reveal) { - handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, handler->GetNameLink(chr).c_str()); + handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, handler->GetNameLink(chr)); if (handler->needReportToTarget(chr)) - ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL, handler->GetNameLink().c_str()); + ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL, handler->GetNameLink()); } else { - handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, handler->GetNameLink(chr).c_str()); + handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, handler->GetNameLink(chr)); if (handler->needReportToTarget(chr)) - ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, handler->GetNameLink().c_str()); + ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, handler->GetNameLink()); } for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i) diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 612537c8f..286282bd3 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -127,14 +127,14 @@ public: // Dump camera locations if (std::vector const* flyByCameras = GetFlyByCameras(cineSeq->cinematicCamera)) { - handler->PSendSysMessage("Waypoints for sequence %u, camera %u", cinematicId, cineSeq->cinematicCamera); + handler->PSendSysMessage("Waypoints for sequence {}, camera {}", cinematicId, cineSeq->cinematicCamera); uint32 count = 1; for (FlyByCamera const& cam : *flyByCameras) { - handler->PSendSysMessage("%02u - %7ums [%s (%f degrees)]", count, cam.timeStamp, cam.locations.ToString().c_str(), cam.locations.GetOrientation() * (180 / M_PI)); + handler->PSendSysMessage("{} - {}ms [{} ({} degrees)]", count, cam.timeStamp, cam.locations.ToString(), cam.locations.GetOrientation() * (180 / M_PI)); ++count; } - handler->PSendSysMessage("%u waypoints dumped", flyByCameras->size()); + handler->PSendSysMessage("{} waypoints dumped", flyByCameras->size()); } handler->GetPlayer()->SendCinematicStart(cinematicId); @@ -437,7 +437,7 @@ public: data.hexlike(); player->GetSession()->SendPacket(&data); - handler->PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName().c_str()); + handler->PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName()); return true; } @@ -495,9 +495,9 @@ public: if (!target) return false; - handler->PSendSysMessage("Loot recipient for creature %s (GUID %u, SpawnID %u) is %s", - target->GetName().c_str(), target->GetGUID().GetCounter(), target->GetSpawnId(), - target->hasLootRecipient() ? (target->GetLootRecipient() ? target->GetLootRecipient()->GetName().c_str() : "offline") : "no loot recipient"); + handler->PSendSysMessage("Loot recipient for creature {} (GUID {}, SpawnID {}) is {}", + target->GetName(), target->GetGUID().ToString(), target->GetSpawnId(), + target->hasLootRecipient() ? (target->GetLootRecipient() ? target->GetLootRecipient()->GetName() : "offline") : "no loot recipient"); return true; } @@ -548,10 +548,10 @@ public: for (uint8 j = 0; j < bag->GetBagSize(); ++j) if (Item* item2 = bag->GetItemByPos(j)) if (item2->GetState() == state) - handler->PSendSysMessage("bag: 255 slot: %d %s owner: %s", item2->GetSlot(), item2->GetGUID().ToString().c_str(), item2->GetOwnerGUID().ToString().c_str()); + handler->PSendSysMessage("bag: 255 slot: {} {} owner: {}", item2->GetSlot(), item2->GetGUID().ToString(), item2->GetOwnerGUID().ToString()); } else if (item->GetState() == state) - handler->PSendSysMessage("bag: 255 slot: %d %s owner: %s", item->GetSlot(), item->GetGUID().ToString().c_str(), item->GetOwnerGUID().ToString().c_str()); + handler->PSendSysMessage("bag: 255 slot: {} {} owner: {}", item->GetSlot(), item->GetGUID().ToString(), item->GetOwnerGUID().ToString()); } } } @@ -582,7 +582,7 @@ public: break; } - handler->PSendSysMessage("bag: %d slot: %d guid: %d - state: %s", bagSlot, item->GetSlot(), item->GetGUID().GetCounter(), st.c_str()); + handler->PSendSysMessage("bag: {} slot: {} guid: {} - state: {}", bagSlot, item->GetSlot(), item->GetGUID().ToString(), st); } if (updateQueue.empty()) @@ -604,21 +604,21 @@ public: if (item->GetSlot() != i) { - handler->PSendSysMessage("Item with slot %d and guid %d has an incorrect slot value: %d", i, item->GetGUID().GetCounter(), item->GetSlot()); + handler->PSendSysMessage("Item with slot {} and guid {} has an incorrect slot value: {}", i, item->GetGUID().ToString(), item->GetSlot()); error = true; continue; } if (item->GetOwnerGUID() != player->GetGUID()) { - handler->PSendSysMessage("The item with slot %d %s does have non-matching owner guid %s and %s!", item->GetSlot(), item->GetGUID().ToString().c_str(), item->GetOwnerGUID().ToString().c_str(), player->GetGUID().ToString().c_str()); + handler->PSendSysMessage("The item with slot {} {} does have non-matching owner guid {} and {}!", item->GetSlot(), item->GetGUID().ToString(), item->GetOwnerGUID().ToString(), player->GetGUID().ToString()); error = true; continue; } if (Bag* container = item->GetContainer()) { - handler->PSendSysMessage("The item with slot %d %s has a container (slot: %d, %s) but shouldn't!", item->GetSlot(), item->GetGUID().ToString().c_str(), container->GetSlot(), container->GetGUID().ToString().c_str()); + handler->PSendSysMessage("The item with slot {} {} has a container (slot: {}, {}) but shouldn't!", item->GetSlot(), item->GetGUID().ToString(), container->GetSlot(), container->GetGUID().ToString()); error = true; continue; } @@ -628,28 +628,28 @@ public: uint16 qp = item->GetQueuePos(); if (qp > updateQueue.size()) { - handler->PSendSysMessage("The item with slot %d and guid %d has its queuepos (%d) larger than the update queue size! ", item->GetSlot(), item->GetGUID().GetCounter(), qp); + handler->PSendSysMessage("The item with slot {} and guid {} has its queuepos ({}) larger than the update queue size! ", item->GetSlot(), item->GetGUID().ToString(), qp); error = true; continue; } if (!updateQueue[qp]) { - handler->PSendSysMessage("The item with slot %d and guid %d has its queuepos (%d) pointing to NULL in the queue!", item->GetSlot(), item->GetGUID().GetCounter(), qp); + handler->PSendSysMessage("The item with slot {} and guid {} has its queuepos ({}) pointing to NULL in the queue!", item->GetSlot(), item->GetGUID().ToString(), qp); error = true; continue; } if (updateQueue[qp] != item) { - handler->PSendSysMessage("The item with slot %d and guid %d has a queuepos (%d) that points to another item in the queue (bag: %d, slot: %d, guid: %d)", item->GetSlot(), item->GetGUID().GetCounter(), qp, updateQueue[qp]->GetBagSlot(), updateQueue[qp]->GetSlot(), updateQueue[qp]->GetGUID().GetCounter()); + handler->PSendSysMessage("The item with slot {} and guid {} has a queuepos ({}) that points to another item in the queue (bag: {}, slot: {}, guid: {})", item->GetSlot(), item->GetGUID().ToString(), qp, updateQueue[qp]->GetBagSlot(), updateQueue[qp]->GetSlot(), updateQueue[qp]->GetGUID().ToString()); error = true; continue; } } else if (item->GetState() != ITEM_UNCHANGED) { - handler->PSendSysMessage("The item with slot %d and guid %d is not in queue but should be (state: %d)!", item->GetSlot(), item->GetGUID().GetCounter(), item->GetState()); + handler->PSendSysMessage("The item with slot {} and guid {} is not in queue but should be (state: {})!", item->GetSlot(), item->GetGUID().ToString(), item->GetState()); error = true; continue; } @@ -664,14 +664,14 @@ public: if (item2->GetSlot() != j) { - handler->PSendSysMessage("The item in bag %d and slot %d (guid: %d) has an incorrect slot value: %d", bag->GetSlot(), j, item2->GetGUID().GetCounter(), item2->GetSlot()); + handler->PSendSysMessage("The item in bag {} and slot {} (guid: {}) has an incorrect slot value: {}", bag->GetSlot(), j, item2->GetGUID().ToString(), item2->GetSlot()); error = true; continue; } if (item2->GetOwnerGUID() != player->GetGUID()) { - handler->PSendSysMessage("The item in bag %d at slot %d and %s, the owner (%s) and the player (%s) don't match!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString().c_str(), item2->GetOwnerGUID().ToString().c_str(), player->GetGUID().ToString().c_str()); + handler->PSendSysMessage("The item in bag {} at slot {} and {}, the owner ({}) and the player ({}) don't match!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString(), item2->GetOwnerGUID().ToString(), player->GetGUID().ToString()); error = true; continue; } @@ -679,14 +679,14 @@ public: Bag* container = item2->GetContainer(); if (!container) { - handler->PSendSysMessage("The item in bag %d at slot %d %s has no container!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString().c_str()); + handler->PSendSysMessage("The item in bag {} at slot {} {} has no container!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString()); error = true; continue; } if (container != bag) { - handler->PSendSysMessage("The item in bag %d at slot %d %s has a different container(slot %d %s)!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString().c_str(), container->GetSlot(), container->GetGUID().ToString().c_str()); + handler->PSendSysMessage("The item in bag {} at slot {} {} has a different container(slot {} {})!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString(), container->GetSlot(), container->GetGUID().ToString()); error = true; continue; } @@ -696,28 +696,28 @@ public: uint16 qp = item2->GetQueuePos(); if (qp > updateQueue.size()) { - handler->PSendSysMessage("The item in bag %d at slot %d having guid %d has a queuepos (%d) larger than the update queue size! ", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().GetCounter(), qp); + handler->PSendSysMessage("The item in bag {} at slot {} having guid {} has a queuepos ({}) larger than the update queue size! ", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString(), qp); error = true; continue; } if (!updateQueue[qp]) { - handler->PSendSysMessage("The item in bag %d at slot %d having guid %d has a queuepos (%d) that points to NULL in the queue!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().GetCounter(), qp); + handler->PSendSysMessage("The item in bag {} at slot {} having guid {} has a queuepos ({}) that points to NULL in the queue!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString(), qp); error = true; continue; } if (updateQueue[qp] != item2) { - handler->PSendSysMessage("The item in bag %d at slot %d having guid %d has a queuepos (%d) that points to another item in the queue (bag: %d, slot: %d, guid: %d)", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().GetCounter(), qp, updateQueue[qp]->GetBagSlot(), updateQueue[qp]->GetSlot(), updateQueue[qp]->GetGUID().GetCounter()); + handler->PSendSysMessage("The item in bag {} at slot {} having guid {} has a queuepos ({}) that points to another item in the queue (bag: {}, slot: {}, guid: {})", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString(), qp, updateQueue[qp]->GetBagSlot(), updateQueue[qp]->GetSlot(), updateQueue[qp]->GetGUID().ToString()); error = true; continue; } } else if (item2->GetState() != ITEM_UNCHANGED) { - handler->PSendSysMessage("The item in bag %d at slot %d having guid %d is not in queue but should be (state: %d)!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().GetCounter(), item2->GetState()); + handler->PSendSysMessage("The item in bag {} at slot {} having guid {} is not in queue but should be (state: {})!", bag->GetSlot(), item2->GetSlot(), item2->GetGUID().ToString(), item2->GetState()); error = true; continue; } @@ -759,7 +759,7 @@ public: if (test != item) { - handler->SendSysMessage(Acore::StringFormatFmt("queue({}): The bag({}) and slot({}) values for the %s are incorrect, {} is there instead!", index, item->GetBagSlot(), item->GetSlot(), item->GetGUID().ToString(), test->GetGUID().ToString())); + handler->SendSysMessage(Acore::StringFormatFmt("queue({}): The bag({}) and slot({}) values for the {} are incorrect, {} is there instead!", index, item->GetBagSlot(), item->GetSlot(), item->GetGUID().ToString(), test->GetGUID().ToString())); error = true; continue; } @@ -800,18 +800,18 @@ public: ThreatContainer::StorageType::const_iterator itr; uint32 count = 0; - handler->PSendSysMessage("Threat list of %s (%s)", target->GetName().c_str(), target->GetGUID().ToString().c_str()); + handler->PSendSysMessage("Threat list of {} ({})", target->GetName(), target->GetGUID().ToString()); for (itr = threatList.begin(); itr != threatList.end(); ++itr) { Unit* unit = (*itr)->getTarget(); if (!unit) { - handler->PSendSysMessage(" %u. No Unit - threat %f", ++count, (*itr)->GetThreat()); + handler->PSendSysMessage(" {}. No Unit - threat {}", ++count, (*itr)->GetThreat()); continue; } - handler->PSendSysMessage(" %u. %s (%s) - threat %f", ++count, unit->GetName().c_str(), unit->GetGUID().ToString().c_str(), (*itr)->GetThreat()); + handler->PSendSysMessage(" {}. {} ({}) - threat {}", ++count, unit->GetName(), unit->GetGUID().ToString(), (*itr)->GetThreat()); } auto const& threatList2 = target->GetThreatMgr().GetOfflineThreatList(); @@ -820,11 +820,11 @@ public: Unit* unit = (*itr)->getTarget(); if (!unit) { - handler->PSendSysMessage(" %u. [offline] No Unit - threat %f", ++count, (*itr)->GetThreat()); + handler->PSendSysMessage(" {}. [offline] No Unit - threat {}", ++count, (*itr)->GetThreat()); continue; } - handler->PSendSysMessage(" %u. [offline] %s (%s) - threat %f", ++count, unit->GetName().c_str(), unit->GetGUID().ToString().c_str(), (*itr)->GetThreat()); + handler->PSendSysMessage(" {}. [offline] {} ({}) - threat {}", ++count, unit->GetName(), unit->GetGUID().ToString(), (*itr)->GetThreat()); } handler->SendSysMessage("End of threat list."); @@ -841,18 +841,18 @@ public: HostileReference* ref = target->getHostileRefMgr().getFirst(); uint32 count = 0; - handler->PSendSysMessage("Hostile reference list of %s (%s)", target->GetName().c_str(), target->GetGUID().ToString().c_str()); + handler->PSendSysMessage("Hostile reference list of {} ({})", target->GetName(), target->GetGUID().ToString()); while (ref) { if (Unit* unit = ref->GetSource()->GetOwner()) { - handler->PSendSysMessage(" %u. %s %s (%s) - threat %f", ++count, (ref->IsOnline() ? "" : "[offline]"), - unit->GetName().c_str(), unit->GetGUID().ToString().c_str(), ref->GetThreat()); + handler->PSendSysMessage(" {}. {} {} ({}) - threat {}", ++count, (ref->IsOnline() ? "" : "[offline]"), + unit->GetName(), unit->GetGUID().ToString(), ref->GetThreat()); } else { - handler->PSendSysMessage(" %u. No Owner - threat %f", ++count, ref->GetThreat()); + handler->PSendSysMessage(" {}. No Owner - threat {}", ++count, ref->GetThreat()); } ref = ref->next(); @@ -869,7 +869,7 @@ public: return false; //target->SetVehicleId(id); - handler->PSendSysMessage("Vehicle id set to %u", id); + handler->PSendSysMessage("Vehicle id set to {}", id); return true; } @@ -897,7 +897,7 @@ public: passenger->EnterVehicle(target, *seatId); } - handler->PSendSysMessage("Unit %u entered vehicle %hhd", entry, *seatId); + handler->PSendSysMessage("Unit {} entered vehicle %hhd", entry, *seatId); return true; } @@ -963,7 +963,7 @@ public: uint32 value = i->GetUInt32Value(index); - handler->PSendSysMessage("Item %u: value at %u is %u", guid, index, value); + handler->PSendSysMessage("Item {}: value at {} is {}", guid, index, value); return true; } @@ -1002,7 +1002,7 @@ public: if (Unit* unit = handler->getSelectedUnit()) unit->HandleEmoteCommand(emote); - handler->PSendSysMessage("Playing emote %s", EnumUtils::ToConstant(emote)); + handler->PSendSysMessage("Playing emote {}", EnumUtils::ToConstant(emote)); return true; } @@ -1012,10 +1012,10 @@ public: if (Unit* unit = handler->getSelectedUnit()) { Player* player = handler->GetSession()->GetPlayer(); - handler->PSendSysMessage("Checking LoS %s -> %s:", player->GetName().c_str(), unit->GetName().c_str()); - handler->PSendSysMessage(" VMAP LoS: %s", player->IsWithinLOSInMap(unit, VMAP::ModelIgnoreFlags::Nothing, LINEOFSIGHT_CHECK_VMAP) ? "clear" : "obstructed"); - handler->PSendSysMessage(" GObj LoS: %s", player->IsWithinLOSInMap(unit, VMAP::ModelIgnoreFlags::Nothing, LINEOFSIGHT_CHECK_GOBJECT_ALL) ? "clear" : "obstructed"); - handler->PSendSysMessage("%s is %sin line of sight of %s.", unit->GetName().c_str(), (player->IsWithinLOSInMap(unit) ? "" : "not "), player->GetName().c_str()); + handler->PSendSysMessage("Checking LoS {} -> {}:", player->GetName(), unit->GetName()); + handler->PSendSysMessage(" VMAP LoS: {}", player->IsWithinLOSInMap(unit, VMAP::ModelIgnoreFlags::Nothing, LINEOFSIGHT_CHECK_VMAP) ? "clear" : "obstructed"); + handler->PSendSysMessage(" GObj LoS: {}", player->IsWithinLOSInMap(unit, VMAP::ModelIgnoreFlags::Nothing, LINEOFSIGHT_CHECK_GOBJECT_ALL) ? "clear" : "obstructed"); + handler->PSendSysMessage("{} is {}in line of sight of {}.", unit->GetName(), (player->IsWithinLOSInMap(unit) ? "" : "not "), player->GetName()); return true; } @@ -1054,19 +1054,19 @@ public: if (index >= target->GetValuesCount()) { - handler->PSendSysMessage(LANG_TOO_BIG_INDEX, index, target->GetGUID().GetCounter(), target->GetValuesCount()); + handler->PSendSysMessage(LANG_TOO_BIG_INDEX, index, target->GetGUID().ToString(), target->GetValuesCount()); return false; } if (value.holds_alternative()) { target->SetUInt32Value(index, value.get()); - handler->PSendSysMessage(LANG_SET_UINT_FIELD, target->GetGUID().GetCounter(), uint32(index), uint32(value)); + handler->PSendSysMessage(LANG_SET_UINT_FIELD, target->GetGUID().ToString(), uint32(index), uint32(value)); } else if (value.holds_alternative()) { target->SetFloatValue(index, value.get()); - handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, target->GetGUID().GetCounter(), static_cast(index), uint32(value)); + handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, target->GetGUID().ToString(), static_cast(index), uint32(value)); } return true; @@ -1085,19 +1085,19 @@ public: if (index >= target->GetValuesCount()) { - handler->PSendSysMessage(LANG_TOO_BIG_INDEX, index, guid.GetCounter(), target->GetValuesCount()); + handler->PSendSysMessage(LANG_TOO_BIG_INDEX, index, guid.ToString(), target->GetValuesCount()); return false; } if (isInt) { uint32 value = target->GetUInt32Value(index); - handler->PSendSysMessage(LANG_GET_UINT_FIELD, guid.GetCounter(), index, value); + handler->PSendSysMessage(LANG_GET_UINT_FIELD, guid.ToString(), index, value); } else { float value = target->GetFloatValue(index); - handler->PSendSysMessage(LANG_GET_FLOAT_FIELD, guid.GetCounter(), index, value); + handler->PSendSysMessage(LANG_GET_FLOAT_FIELD, guid.ToString(), index, value); } return true; @@ -1107,7 +1107,7 @@ public: { if (index >= handler->GetPlayer()->GetValuesCount()) { - handler->PSendSysMessage(LANG_TOO_BIG_INDEX, index, handler->GetPlayer()->GetGUID().GetCounter(), handler->GetPlayer()->GetValuesCount()); + handler->PSendSysMessage(LANG_TOO_BIG_INDEX, index, handler->GetPlayer()->GetGUID().ToString(), handler->GetPlayer()->GetValuesCount()); return false; } @@ -1146,13 +1146,13 @@ public: { value = unit->GetUInt32Value(index); - handler->PSendSysMessage(LANG_UPDATE, unit->GetGUID().GetCounter(), index, *value); + handler->PSendSysMessage(LANG_UPDATE, unit->GetGUID().ToString(), index, *value); return true; } unit->SetUInt32Value(index, *value); - handler->PSendSysMessage(LANG_UPDATE_CHANGE, unit->GetGUID().GetCounter(), index, *value); + handler->PSendSysMessage(LANG_UPDATE_CHANGE, unit->GetGUID().ToString(), index, *value); return true; } @@ -1325,7 +1325,7 @@ public: static void HandleDebugObjectCountMap(ChatHandler* handler, Map* map) { - handler->PSendSysMessage("Map Id: %u Name: '%s' Instance Id: %u Creatures: %u GameObjects: %u SetActive Objects: %u", + handler->PSendSysMessage("Map Id: {} Name: '{}' Instance Id: {} Creatures: {} GameObjects: {} SetActive Objects: {}", map->GetId(), map->GetMapName(), map->GetInstanceId(), uint64(map->GetObjectsStore().Size()), uint64(map->GetObjectsStore().Size()), @@ -1338,7 +1338,7 @@ public: handler->PSendSysMessage("Top Creatures count:"); for (auto&& p : worker.GetTopCreatureCount(5)) - handler->PSendSysMessage("Entry: %u Count: %u", p.first, p.second); + handler->PSendSysMessage("Entry: {} Count: {}", p.first, p.second); } static bool HandleDebugDummyCommand(ChatHandler* handler) diff --git a/src/server/scripts/Commands/cs_deserter.cpp b/src/server/scripts/Commands/cs_deserter.cpp index b8b0d05f0..0daf4eab1 100644 --- a/src/server/scripts/Commands/cs_deserter.cpp +++ b/src/server/scripts/Commands/cs_deserter.cpp @@ -162,7 +162,7 @@ public: Aura* aura = target->GetAura(deserterSpell); if (aura && aura->GetDuration() >= duration * IN_MILLISECONDS) { - handler->PSendSysMessage("Player %s already has a longer %s Deserter active.", handler->playerLink(*playerName), isInstance ? "Instance" : "Battleground"); + handler->PSendSysMessage("Player {} already has a longer {} Deserter active.", handler->playerLink(*playerName), isInstance ? "Instance" : "Battleground"); return true; } @@ -184,7 +184,7 @@ public: if (remainTime < 0 || remainTime >= duration * IN_MILLISECONDS) { - handler->PSendSysMessage("Player %s already has a longer %s Deserter active.", handler->playerLink(*playerName), isInstance ? "Instance" : "Battleground"); + handler->PSendSysMessage("Player {} already has a longer {} Deserter active.", handler->playerLink(*playerName), isInstance ? "Instance" : "Battleground"); return true; } CharacterDatabase.Query("DELETE FROM character_aura WHERE guid = {} AND spell = {}", guid.GetCounter(), deserterSpell); @@ -211,7 +211,7 @@ public: CharacterDatabase.Execute(stmt); } - handler->PSendSysMessage("%s of %s Deserter has been added to player %s.", secsToTimeString(duration), isInstance ? "Instance" : "Battleground", handler->playerLink(*playerName)); + handler->PSendSysMessage("{} of {} Deserter has been added to player {}.", secsToTimeString(duration), isInstance ? "Instance" : "Battleground", handler->playerLink(*playerName)); return true; } @@ -274,17 +274,17 @@ public: if (duration == 0) { - handler->SendErrorMessage("Player %s does not have %s Deserter.", handler->playerLink(player->GetName()), isInstance ? "Instance" : "Battleground"); + handler->SendErrorMessage("Player {} does not have {} Deserter.", handler->playerLink(player->GetName()), isInstance ? "Instance" : "Battleground"); return true; } if (duration < 0) { - handler->SendErrorMessage("Permanent %s Deserter has been removed from player %s (GUID %u).", isInstance ? "Instance" : "Battleground", handler->playerLink(player->GetName()), player->GetGUID().GetCounter()); + handler->SendErrorMessage("Permanent {} Deserter has been removed from player {} (GUID {}).", isInstance ? "Instance" : "Battleground", handler->playerLink(player->GetName()), player->GetGUID().ToString()); return true; } - handler->PSendSysMessage("%s of %s Deserter has been removed from player %s (GUID %u).", secsToTimeString(duration / IN_MILLISECONDS), isInstance ? "Instance" : "Battleground", handler->playerLink(player->GetName()), player->GetGUID().GetCounter()); + handler->PSendSysMessage("{} of {} Deserter has been removed from player {} (GUID {}).", secsToTimeString(duration / IN_MILLISECONDS), isInstance ? "Instance" : "Battleground", handler->playerLink(player->GetName()), player->GetGUID().ToString()); return true; } @@ -386,11 +386,11 @@ public: if (deserterCount == 0) { - handler->PSendSysMessage("No player on this realm has %s Deserter with a duration of %s or less.", isInstance ? "Instance" : "Battleground", remainTimeStr); + handler->PSendSysMessage("No player on this realm has {} Deserter with a duration of {} or less.", isInstance ? "Instance" : "Battleground", remainTimeStr); return true; } - handler->PSendSysMessage("%s Deserter has been removed from %u player(s) with a duration of %s or less.", isInstance ? "Instance" : "Battleground", deserterCount, remainTimeStr); + handler->PSendSysMessage("{} Deserter has been removed from {} player(s) with a duration of {} or less.", isInstance ? "Instance" : "Battleground", deserterCount, remainTimeStr); return true; } diff --git a/src/server/scripts/Commands/cs_disable.cpp b/src/server/scripts/Commands/cs_disable.cpp index b48ae4fbc..43972cfa4 100644 --- a/src/server/scripts/Commands/cs_disable.cpp +++ b/src/server/scripts/Commands/cs_disable.cpp @@ -147,7 +147,7 @@ public: PreparedQueryResult result = WorldDatabase.Query(stmt); if (result) { - handler->SendErrorMessage("This %s (Id: %u) is already disabled.", disableTypeStr.c_str(), entry); + handler->SendErrorMessage("This {} (Id: {}) is already disabled.", disableTypeStr, entry); return false; } @@ -158,7 +158,7 @@ public: stmt->SetData(3, disableComment); WorldDatabase.Execute(stmt); - handler->PSendSysMessage("Add Disabled %s (Id: %u) for reason %s", disableTypeStr.c_str(), entry, disableComment.c_str()); + handler->PSendSysMessage("Add Disabled {} (Id: {}) for reason {}", disableTypeStr, entry, disableComment); return true; } @@ -234,7 +234,7 @@ public: PreparedQueryResult result = WorldDatabase.Query(stmt); if (!result) { - handler->SendErrorMessage("This %s (Id: %u) is not disabled.", disableTypeStr.c_str(), entry); + handler->SendErrorMessage("This {} (Id: {}) is not disabled.", disableTypeStr, entry); return false; } @@ -243,7 +243,7 @@ public: stmt->SetData(1, disableType); WorldDatabase.Execute(stmt); - handler->PSendSysMessage("Remove Disabled %s (Id: %u)", disableTypeStr.c_str(), entry); + handler->PSendSysMessage("Remove Disabled {} (Id: {})", disableTypeStr, entry); return true; } diff --git a/src/server/scripts/Commands/cs_event.cpp b/src/server/scripts/Commands/cs_event.cpp index bda903f7d..45dffdd7e 100644 --- a/src/server/scripts/Commands/cs_event.cpp +++ b/src/server/scripts/Commands/cs_event.cpp @@ -69,11 +69,11 @@ public: if (handler->GetSession()) { - handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, eventId, eventId, eventData.description.c_str(), active); + handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, eventId, eventId, eventData.description, active); } else { - handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, eventId, eventData.description.c_str(), active); + handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, eventId, eventData.description, active); } ++counter; @@ -120,9 +120,9 @@ public: std::string occurenceStr = secsToTimeString(eventData.occurence * MINUTE, true); std::string lengthStr = secsToTimeString(eventData.length * MINUTE, true); - handler->PSendSysMessage(LANG_EVENT_INFO, uint16(eventId), eventData.description.c_str(), activeStr, - startTimeStr.c_str(), endTimeStr.c_str(), occurenceStr.c_str(), lengthStr.c_str(), - nextStr.c_str()); + handler->PSendSysMessage(LANG_EVENT_INFO, uint16(eventId), eventData.description, activeStr, + startTimeStr, endTimeStr, occurenceStr, lengthStr, + nextStr); return true; } @@ -147,11 +147,11 @@ public: GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList(); if (activeEvents.find(eventId) != activeEvents.end()) { - handler->SendErrorMessage(LANG_EVENT_ALREADY_ACTIVE, uint16(eventId), eventData.description.c_str()); + handler->SendErrorMessage(LANG_EVENT_ALREADY_ACTIVE, uint16(eventId), eventData.description); return false; } - handler->PSendSysMessage(LANG_EVENT_STARTED, uint16(eventId), eventData.description.c_str()); + handler->PSendSysMessage(LANG_EVENT_STARTED, uint16(eventId), eventData.description); sGameEventMgr->StartEvent(eventId, true); return true; } @@ -177,11 +177,11 @@ public: if (activeEvents.find(eventId) == activeEvents.end()) { - handler->SendErrorMessage(LANG_EVENT_NOT_ACTIVE, uint16(eventId), eventData.description.c_str()); + handler->SendErrorMessage(LANG_EVENT_NOT_ACTIVE, uint16(eventId), eventData.description); return false; } - handler->PSendSysMessage(LANG_EVENT_STOPPED, uint16(eventId), eventData.description.c_str()); + handler->PSendSysMessage(LANG_EVENT_STOPPED, uint16(eventId), eventData.description); sGameEventMgr->StopEvent(eventId, true); return true; } diff --git a/src/server/scripts/Commands/cs_gear.cpp b/src/server/scripts/Commands/cs_gear.cpp index 9753997fe..5304ac866 100644 --- a/src/server/scripts/Commands/cs_gear.cpp +++ b/src/server/scripts/Commands/cs_gear.cpp @@ -67,11 +67,11 @@ public: std::string nameLink = handler->playerLink(target->GetName()); - handler->PSendSysMessage(LANG_YOU_REPAIR_ITEMS, nameLink.c_str()); + handler->PSendSysMessage(LANG_YOU_REPAIR_ITEMS, nameLink); if (handler->needReportToTarget(target->GetConnectedPlayer())) { - ChatHandler(target->GetConnectedPlayer()->GetSession()).PSendSysMessage(LANG_YOUR_ITEMS_REPAIRED, nameLink.c_str()); + ChatHandler(target->GetConnectedPlayer()->GetSession()).PSendSysMessage(LANG_YOUR_ITEMS_REPAIRED, nameLink); } return true; @@ -86,8 +86,8 @@ public: return false; } - handler->PSendSysMessage("Character: %s", player->GetPlayerName().c_str()); - handler->PSendSysMessage("Current equipment average item level: |cff00ffff%u|r", (int16)player->GetAverageItemLevel()); + handler->PSendSysMessage("Character: {}", player->GetPlayerName()); + handler->PSendSysMessage("Current equipment average item level: |cff00ffff{}|r", (int16)player->GetAverageItemLevel()); if (sWorld->getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE)) { @@ -109,11 +109,11 @@ public: uint32 SpellPower = fields[8].Get(); uint32 Resilience = fields[9].Get(); - handler->PSendSysMessage("Health: |cff00ffff%u|r - Stamina: |cff00ffff%u|r", MaxHealth, Stamina); - handler->PSendSysMessage("Strength: |cff00ffff%u|r - Agility: |cff00ffff%u|r", Strength, Agility); - handler->PSendSysMessage("Intellect: |cff00ffff%u|r - Spirit: |cff00ffff%u|r", Intellect, Spirit); - handler->PSendSysMessage("AttackPower: |cff00ffff%u|r - SpellPower: |cff00ffff%u|r", AttackPower, SpellPower); - handler->PSendSysMessage("Armor: |cff00ffff%u|r - Resilience: |cff00ffff%u|r", Armor, Resilience); + handler->PSendSysMessage("Health: |cff00ffff{}|r - Stamina: |cff00ffff{}|r", MaxHealth, Stamina); + handler->PSendSysMessage("Strength: |cff00ffff{}|r - Agility: |cff00ffff{}|r", Strength, Agility); + handler->PSendSysMessage("Intellect: |cff00ffff{}|r - Spirit: |cff00ffff{}|r", Intellect, Spirit); + handler->PSendSysMessage("AttackPower: |cff00ffff{}|r - SpellPower: |cff00ffff{}|r", AttackPower, SpellPower); + handler->PSendSysMessage("Armor: |cff00ffff{}|r - Resilience: |cff00ffff{}|r", Armor, Resilience); } } diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp index c49cf4c67..bb64f0114 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -107,7 +107,7 @@ public: data << target->GetPackGUID(); data << uint32(0); // unknown target->SendMessageToSet(&data, true); - handler->PSendSysMessage(LANG_COMMAND_FLYMODE_STATUS, handler->GetNameLink(target).c_str(), enable ? "on" : "off"); + handler->PSendSysMessage(LANG_COMMAND_FLYMODE_STATUS, handler->GetNameLink(target), enable ? "on" : "off"); return true; } @@ -139,9 +139,9 @@ public: if ((max + max2 + size) == 16) max2 = max - 1; if (handler->GetSession()) - handler->PSendSysMessage("| %s GMLevel %u", name.c_str(), security); + handler->PSendSysMessage("| {} GMLevel {}", name, security); else - handler->PSendSysMessage("|%*s%s%*s| %u |", max, " ", name.c_str(), max2, " ", security); + handler->PSendSysMessage("|{}{}{}| {} |", max, " ", name, max2, " ", security); } } if (footer) @@ -175,9 +175,9 @@ public: if ((max + max2 + name.length()) == 16) max2 = max - 1; if (handler->GetSession()) - handler->PSendSysMessage("| %s GMLevel %u", name.c_str(), security); + handler->PSendSysMessage("| {} GMLevel {}", name, security); else - handler->PSendSysMessage("|%*s%s%*s| %u |", max, " ", name.c_str(), max2, " ", security); + handler->PSendSysMessage("|{}{}{}| {} |", max, " ", name, max2, " ", security); } while (result->NextRow()); handler->SendSysMessage("========================"); } diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 3eab21a35..b3f9fa959 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -140,7 +140,7 @@ public: /// @todo is it really necessary to add both the real and DB table guid here ? sObjectMgr->AddGameobjectToGrid(guidLow, sObjectMgr->GetGameObjectData(guidLow)); - handler->PSendSysMessage(LANG_GAMEOBJECT_ADD, uint32(objectId), objectInfo->name.c_str(), guidLow, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); + handler->PSendSysMessage(LANG_GAMEOBJECT_ADD, uint32(objectId), objectInfo->name, guidLow, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); return true; } @@ -266,7 +266,7 @@ public: GameObject* target = handler->GetObjectFromPlayerMapByDbGuid(guidLow); - handler->PSendSysMessage(LANG_GAMEOBJECT_DETAIL, guidLow, objectInfo->name.c_str(), guidLow, id, x, y, z, mapId, o, phase); + handler->PSendSysMessage(LANG_GAMEOBJECT_DETAIL, guidLow, objectInfo->name, guidLow, id, x, y, z, mapId, o, phase); if (target) { @@ -277,7 +277,7 @@ public: std::string curRespawnDelayStr = secsToTimeString(curRespawnDelay, true); std::string defRespawnDelayStr = secsToTimeString(target->GetRespawnDelay(), true); - handler->PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(), curRespawnDelayStr.c_str()); + handler->PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr, curRespawnDelayStr); } return true; } @@ -298,7 +298,7 @@ public: Unit* owner = ObjectAccessor::GetUnit(*handler->GetSession()->GetPlayer(), ownerGuid); if (!owner || !ownerGuid.IsPlayer()) { - handler->SendErrorMessage(LANG_COMMAND_DELOBJREFERCREATURE, ownerGuid.GetCounter(), object->GetSpawnId()); + handler->SendErrorMessage(LANG_COMMAND_DELOBJREFERCREATURE, ownerGuid.ToString(), object->GetSpawnId()); return false; } @@ -348,7 +348,7 @@ public: return false; } - handler->PSendSysMessage(LANG_COMMAND_TURNOBJMESSAGE, object->GetSpawnId(), object->GetGOInfo()->name.c_str(), object->GetSpawnId()); + handler->PSendSysMessage(LANG_COMMAND_TURNOBJMESSAGE, object->GetSpawnId(), object->GetGOInfo()->name, object->GetSpawnId()); return true; } @@ -403,7 +403,7 @@ public: return false; } - handler->PSendSysMessage(LANG_COMMAND_MOVEOBJMESSAGE, object->GetSpawnId(), object->GetGOInfo()->name.c_str(), object->GetSpawnId()); + handler->PSendSysMessage(LANG_COMMAND_MOVEOBJMESSAGE, object->GetSpawnId(), object->GetGOInfo()->name, object->GetSpawnId()); return true; } @@ -467,7 +467,7 @@ public: if (!gameObjectInfo) continue; - handler->PSendSysMessage(LANG_GO_LIST_CHAT, guid, entry, guid, gameObjectInfo->name.c_str(), x, y, z, mapId, "", ""); + handler->PSendSysMessage(LANG_GO_LIST_CHAT, guid, entry, guid, gameObjectInfo->name, x, y, z, mapId, "", ""); ++count; } while (result->NextRow()); @@ -522,21 +522,21 @@ public: handler->PSendSysMessage(LANG_GOINFO_ENTRY, entry); if (gameObject) - handler->PSendSysMessage("GUID: %u", gameObject->GetGUID().GetCounter()); + handler->PSendSysMessage("GUID: {}", gameObject->GetGUID().ToString()); handler->PSendSysMessage(LANG_GOINFO_TYPE, type); handler->PSendSysMessage(LANG_GOINFO_LOOTID, lootId); handler->PSendSysMessage(LANG_GOINFO_DISPLAYID, displayId); if (gameObject) { - handler->PSendSysMessage("LootMode: %u", gameObject->GetLootMode()); - handler->PSendSysMessage("LootState: %u", gameObject->getLootState()); - handler->PSendSysMessage("GOState: %u", gameObject->GetGoState()); - handler->PSendSysMessage("PhaseMask: %u", gameObject->GetPhaseMask()); - handler->PSendSysMessage("IsLootEmpty: %u", gameObject->loot.empty()); - handler->PSendSysMessage("IsLootLooted: %u", gameObject->loot.isLooted()); + handler->PSendSysMessage("LootMode: {}", gameObject->GetLootMode()); + handler->PSendSysMessage("LootState: {}", gameObject->getLootState()); + handler->PSendSysMessage("GOState: {}", gameObject->GetGoState()); + handler->PSendSysMessage("PhaseMask: {}", gameObject->GetPhaseMask()); + handler->PSendSysMessage("IsLootEmpty: {}", gameObject->loot.empty()); + handler->PSendSysMessage("IsLootLooted: {}", gameObject->loot.isLooted()); } - handler->PSendSysMessage(LANG_GOINFO_NAME, name.c_str()); + handler->PSendSysMessage(LANG_GOINFO_NAME, name); return true; } @@ -571,7 +571,7 @@ public: { object->SendCustomAnim(*objectState); } - handler->PSendSysMessage("Set gobject type %d state %u", objectType, *objectState); + handler->PSendSysMessage("Set gobject type {} state {}", objectType, *objectState); return true; } diff --git a/src/server/scripts/Commands/cs_group.cpp b/src/server/scripts/Commands/cs_group.cpp index 62abe21ae..ed32701f2 100644 --- a/src/server/scripts/Commands/cs_group.cpp +++ b/src/server/scripts/Commands/cs_group.cpp @@ -156,7 +156,7 @@ public: { groupSource->AddMember(playerTarget); groupSource->BroadcastGroupUpdate(); - handler->PSendSysMessage(LANG_GROUP_PLAYER_JOINED, playerTarget->GetName().c_str(), playerSource->GetName().c_str()); + handler->PSendSysMessage(LANG_GROUP_PLAYER_JOINED, playerTarget->GetName(), playerSource->GetName()); return true; } else @@ -169,7 +169,7 @@ public: else { // group is full or target player already in a group - handler->PSendSysMessage(LANG_GROUP_ALREADY_IN_GROUP, playerTarget->GetName().c_str()); + handler->PSendSysMessage(LANG_GROUP_ALREADY_IN_GROUP, playerTarget->GetName()); return true; } } @@ -177,7 +177,7 @@ public: else { // specified source player is not in a group - handler->PSendSysMessage(LANG_GROUP_NOT_IN_GROUP, playerSource->GetName().c_str()); + handler->PSendSysMessage(LANG_GROUP_NOT_IN_GROUP, playerSource->GetName()); return true; } } @@ -214,7 +214,7 @@ public: if (!groupTarget) { - handler->PSendSysMessage(LANG_GROUP_NOT_IN_GROUP, target->GetName().c_str()); + handler->PSendSysMessage(LANG_GROUP_NOT_IN_GROUP, target->GetName()); return true; } diff --git a/src/server/scripts/Commands/cs_guild.cpp b/src/server/scripts/Commands/cs_guild.cpp index 8b1e6182c..4b1e106bf 100644 --- a/src/server/scripts/Commands/cs_guild.cpp +++ b/src/server/scripts/Commands/cs_guild.cpp @@ -239,11 +239,11 @@ public: return false; // Display Guild Information - handler->PSendSysMessage(LANG_GUILD_INFO_NAME, guild->GetName().c_str(), guild->GetId()); // Guild Id + Name + handler->PSendSysMessage(LANG_GUILD_INFO_NAME, guild->GetName(), guild->GetId()); // Guild Id + Name std::string guildMasterName; if (sCharacterCache->GetCharacterNameByGuid(guild->GetLeaderGUID(), guildMasterName)) - handler->PSendSysMessage(LANG_GUILD_INFO_GUILD_MASTER, guildMasterName.c_str(), guild->GetLeaderGUID().GetCounter()); // Guild Master + handler->PSendSysMessage(LANG_GUILD_INFO_GUILD_MASTER, guildMasterName, guild->GetLeaderGUID().ToString()); // Guild Master // Format creation date char createdDateStr[20]; @@ -254,8 +254,8 @@ public: handler->PSendSysMessage(LANG_GUILD_INFO_CREATION_DATE, createdDateStr); // Creation Date handler->PSendSysMessage(LANG_GUILD_INFO_MEMBER_COUNT, guild->GetMemberCount()); // Number of Members handler->PSendSysMessage(LANG_GUILD_INFO_BANK_GOLD, guild->GetTotalBankMoney() / 100 / 100); // Bank Gold (in gold coins) - handler->PSendSysMessage(LANG_GUILD_INFO_MOTD, guild->GetMOTD().c_str()); // Message of the Day - handler->PSendSysMessage(LANG_GUILD_INFO_EXTRA_INFO, guild->GetInfo().c_str()); // Extra Information + handler->PSendSysMessage(LANG_GUILD_INFO_MOTD, guild->GetMOTD()); // Message of the Day + handler->PSendSysMessage(LANG_GUILD_INFO_EXTRA_INFO, guild->GetInfo()); // Extra Information return true; } }; diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp index 37d1d66e7..cd6836372 100644 --- a/src/server/scripts/Commands/cs_instance.cpp +++ b/src/server/scripts/Commands/cs_instance.cpp @@ -74,13 +74,13 @@ public: uint32 resetTime = bind.extended ? save->GetExtendedResetTime() : save->GetResetTime(); uint32 ttr = (resetTime >= GameTime::GetGameTime().count() ? resetTime - GameTime::GetGameTime().count() : 0); std::string timeleft = secsToTimeString(ttr); - handler->PSendSysMessage("map: %d, inst: %d, perm: %s, diff: %d, canReset: %s, TTR: %s%s", - mapId, save->GetInstanceId(), bind.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str(), (bind.extended ? " (extended)" : "")); + handler->PSendSysMessage("map: {}, inst: {}, perm: {}, diff: {}, canReset: {}, TTR: {}{}", + mapId, save->GetInstanceId(), bind.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft, (bind.extended ? " (extended)" : "")); counter++; } } - handler->PSendSysMessage("player binds: %d", counter); + handler->PSendSysMessage("player binds: {}", counter); return true; } @@ -112,7 +112,7 @@ public: uint32 resetTime = itr->second.extended ? save->GetExtendedResetTime() : save->GetResetTime(); uint32 ttr = (resetTime >= GameTime::GetGameTime().count() ? resetTime - GameTime::GetGameTime().count() : 0); std::string timeleft = secsToTimeString(ttr); - handler->PSendSysMessage("unbinding map: %d, inst: %d, perm: %s, diff: %d, canReset: %s, TTR: %s%s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str(), (itr->second.extended ? " (extended)" : "")); + handler->PSendSysMessage("unbinding map: {}, inst: {}, perm: {}, diff: {}, canReset: {}, TTR: {}{}", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft, (itr->second.extended ? " (extended)" : "")); sInstanceSaveMgr->PlayerUnbindInstance(player->GetGUID(), itr->first, Difficulty(i), true, player); itr = m_boundInstances.begin(); counter++; @@ -122,7 +122,7 @@ public: } } - handler->PSendSysMessage("instances unbound: %d", counter); + handler->PSendSysMessage("instances unbound: {}", counter); return true; } @@ -131,13 +131,13 @@ public: { uint32 dungeon = 0, battleground = 0, arena = 0, spectators = 0; sMapMgr->GetNumInstances(dungeon, battleground, arena); - handler->PSendSysMessage("instances loaded: dungeons (%d), battlegrounds (%d), arenas (%d)", dungeon, battleground, arena); + handler->PSendSysMessage("instances loaded: dungeons ({}), battlegrounds ({}), arenas ({})", dungeon, battleground, arena); dungeon = 0; battleground = 0; arena = 0; spectators = 0; sMapMgr->GetNumPlayersInInstances(dungeon, battleground, arena, spectators); - handler->SendErrorMessage("players in instances: dungeons (%d), battlegrounds (%d), arenas (%d + %d spect)", dungeon, battleground, arena, spectators); + handler->SendErrorMessage("players in instances: dungeons ({}), battlegrounds ({}), arenas ({} + {} spect)", dungeon, battleground, arena, spectators); return false; } @@ -202,7 +202,7 @@ public: map->GetInstanceScript()->SetBossState(encounterId, EncounterState(state)); std::string stateName = InstanceScript::GetBossStateName(state); - handler->PSendSysMessage(LANG_COMMAND_INST_SET_BOSS_STATE, encounterId, state, stateName.c_str()); + handler->PSendSysMessage(LANG_COMMAND_INST_SET_BOSS_STATE, encounterId, state, stateName); return true; } @@ -245,7 +245,7 @@ public: uint32 state = map->GetInstanceScript()->GetBossState(encounterId); std::string stateName = InstanceScript::GetBossStateName(state); - handler->PSendSysMessage(LANG_COMMAND_INST_GET_BOSS_STATE, encounterId, state, stateName.c_str()); + handler->PSendSysMessage(LANG_COMMAND_INST_GET_BOSS_STATE, encounterId, state, stateName); return true; } }; diff --git a/src/server/scripts/Commands/cs_item.cpp b/src/server/scripts/Commands/cs_item.cpp index 1557398ad..eb59f7675 100644 --- a/src/server/scripts/Commands/cs_item.cpp +++ b/src/server/scripts/Commands/cs_item.cpp @@ -114,7 +114,7 @@ public: CharacterDatabase.Execute(delStmt); std::string nameLink = handler->playerLink(player.GetName()); - handler->PSendSysMessage(LANG_MAIL_SENT, nameLink.c_str()); + handler->PSendSysMessage(LANG_MAIL_SENT, nameLink); return true; } diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index 08c29492d..dd759a7f9 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -303,7 +303,7 @@ public: target->LearnCustomSpells(); target->learnQuestRewardedSpells(); - handler->PSendSysMessage(LANG_COMMAND_LEARN_ALL_DEFAULT_AND_QUEST, handler->GetNameLink(target).c_str()); + handler->PSendSysMessage(LANG_COMMAND_LEARN_ALL_DEFAULT_AND_QUEST, handler->GetNameLink(target)); return true; } diff --git a/src/server/scripts/Commands/cs_lfg.cpp b/src/server/scripts/Commands/cs_lfg.cpp index 5e809cafa..e984dbb65 100644 --- a/src/server/scripts/Commands/cs_lfg.cpp +++ b/src/server/scripts/Commands/cs_lfg.cpp @@ -31,9 +31,9 @@ void GetPlayerInfo(ChatHandler* handler, Player* player) lfg::LfgDungeonSet dungeons = sLFGMgr->GetSelectedDungeons(guid); std::string const& state = lfg::GetStateString(sLFGMgr->GetState(guid)); - handler->PSendSysMessage(LANG_LFG_PLAYER_INFO, player->GetName().c_str(), - state.c_str(), uint8(dungeons.size()), lfg::ConcatenateDungeons(dungeons).c_str(), - lfg::GetRolesString(sLFGMgr->GetRoles(guid)).c_str(), sLFGMgr->GetComment(guid).c_str()); + handler->PSendSysMessage(LANG_LFG_PLAYER_INFO, player->GetName(), + state, uint8(dungeons.size()), lfg::ConcatenateDungeons(dungeons), + lfg::GetRolesString(sLFGMgr->GetRoles(guid)), sLFGMgr->GetComment(guid)); } using namespace Acore::ChatCommands; @@ -89,14 +89,14 @@ public: groupTarget = target->GetGroup(); if (!groupTarget) { - handler->PSendSysMessage(LANG_LFG_NOT_IN_GROUP, player->GetName().c_str()); + handler->PSendSysMessage(LANG_LFG_NOT_IN_GROUP, player->GetName()); return true; } ObjectGuid guid = groupTarget->GetGUID(); std::string const& state = lfg::GetStateString(sLFGMgr->GetState(guid)); handler->PSendSysMessage(LANG_LFG_GROUP_INFO, groupTarget->isLFGGroup(), - state.c_str(), sLFGMgr->GetDungeon(guid)); + state, sLFGMgr->GetDungeon(guid)); for (GroupReference* itr = groupTarget->GetFirstMember(); itr != nullptr; itr = itr->next()) GetPlayerInfo(handler, itr->GetSource()); diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index caeb7c2e1..9702616f2 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -124,9 +124,9 @@ public: for (std::unordered_multimap::const_iterator itr = creBounds.first; itr != creBounds.second;) { if (handler->GetSession()) - handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, cInfo->Entry, guid, cInfo->Name.c_str(), x, y, z, mapId, itr->second->GetGUID().ToString().c_str(), itr->second->IsAlive() ? "*" : " "); + handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, cInfo->Entry, guid, cInfo->Name, x, y, z, mapId, itr->second->GetGUID().ToString(), itr->second->IsAlive() ? "*" : " "); else - handler->PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, cInfo->Name.c_str(), x, y, z, mapId, itr->second->GetGUID().ToString().c_str(), itr->second->IsAlive() ? "*" : " "); + handler->PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, cInfo->Name, x, y, z, mapId, itr->second->GetGUID().ToString(), itr->second->IsAlive() ? "*" : " "); ++itr; } liveFound = true; @@ -136,9 +136,9 @@ public: if (!liveFound) { if (handler->GetSession()) - handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, cInfo->Entry, guid, cInfo->Name.c_str(), x, y, z, mapId, "", ""); + handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, cInfo->Entry, guid, cInfo->Name, x, y, z, mapId, "", ""); else - handler->PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, cInfo->Name.c_str(), x, y, z, mapId, "", ""); + handler->PSendSysMessage(LANG_CREATURE_LIST_CONSOLE, guid, cInfo->Name, x, y, z, mapId, "", ""); } } while (result->NextRow()); @@ -205,7 +205,7 @@ public: else itemPos = ""; - handler->PSendSysMessage(LANG_ITEMLIST_SLOT, itemGuid, ownerName.c_str(), ownerGuid, ownerAccountId, itemPos); + handler->PSendSysMessage(LANG_ITEMLIST_SLOT, itemGuid, ownerName, ownerGuid, ownerAccountId, itemPos); } while (result->NextRow()); @@ -252,7 +252,7 @@ public: char const* itemPos = "[in mail]"; - handler->PSendSysMessage(LANG_ITEMLIST_MAIL, itemGuid, itemSenderName.c_str(), itemSender, itemSenderAccountId, itemReceiverName.c_str(), itemReceiver, itemReceiverAccount, itemPos); + handler->PSendSysMessage(LANG_ITEMLIST_MAIL, itemGuid, itemSenderName, itemSender, itemSenderAccountId, itemReceiverName, itemReceiver, itemReceiverAccount, itemPos); } while (result->NextRow()); @@ -296,7 +296,7 @@ public: char const* itemPos = "[in auction]"; - handler->PSendSysMessage(LANG_ITEMLIST_AUCTION, itemGuid, ownerName.c_str(), owner, ownerAccountId, itemPos); + handler->PSendSysMessage(LANG_ITEMLIST_AUCTION, itemGuid, ownerName, owner, ownerAccountId, itemPos); } while (result->NextRow()); } @@ -327,7 +327,7 @@ public: char const* itemPos = "[in guild bank]"; - handler->PSendSysMessage(LANG_ITEMLIST_GUILD, itemGuid, guildName.c_str(), guildGuid, itemPos); + handler->PSendSysMessage(LANG_ITEMLIST_GUILD, itemGuid, guildName, guildGuid, itemPos); } while (result->NextRow()); @@ -410,9 +410,9 @@ public: for (std::unordered_multimap::const_iterator itr = goBounds.first; itr != goBounds.second;) { if (handler->GetSession()) - handler->PSendSysMessage(LANG_GO_LIST_CHAT, guid, entry, guid, gInfo->name.c_str(), x, y, z, mapId, itr->second->GetGUID().ToString().c_str(), itr->second->isSpawned() ? "*" : " "); + handler->PSendSysMessage(LANG_GO_LIST_CHAT, guid, entry, guid, gInfo->name, x, y, z, mapId, itr->second->GetGUID().ToString(), itr->second->isSpawned() ? "*" : " "); else - handler->PSendSysMessage(LANG_GO_LIST_CONSOLE, guid, gInfo->name.c_str(), x, y, z, mapId, itr->second->GetGUID().ToString().c_str(), itr->second->isSpawned() ? "*" : " "); + handler->PSendSysMessage(LANG_GO_LIST_CONSOLE, guid, gInfo->name, x, y, z, mapId, itr->second->GetGUID().ToString(), itr->second->isSpawned() ? "*" : " "); ++itr; } liveFound = true; @@ -422,9 +422,9 @@ public: if (!liveFound) { if (handler->GetSession()) - handler->PSendSysMessage(LANG_GO_LIST_CHAT, guid, entry, guid, gInfo->name.c_str(), x, y, z, mapId, "", ""); + handler->PSendSysMessage(LANG_GO_LIST_CHAT, guid, entry, guid, gInfo->name, x, y, z, mapId, "", ""); else - handler->PSendSysMessage(LANG_GO_LIST_CONSOLE, guid, gInfo->name.c_str(), x, y, z, mapId, "", ""); + handler->PSendSysMessage(LANG_GO_LIST_CONSOLE, guid, gInfo->name, x, y, z, mapId, "", ""); } } while (result->NextRow()); @@ -479,11 +479,11 @@ public: std::ostringstream ss_name; ss_name << "|cffffffff|Hspell:" << aura->GetId() << "|h[" << name << "]|h|r"; - handler->PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, aura->GetId(), (handler->GetSession() ? ss_name.str().c_str() : name), + handler->PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, aura->GetId(), (handler->GetSession() ? ss_name.str() : name), aurApp->GetEffectMask(), aura->GetCharges(), aura->GetStackAmount(), aurApp->GetSlot(), aura->GetDuration(), aura->GetMaxDuration(), (aura->IsPassive() ? passiveStr : ""), (talent ? talentStr : ""), aura->GetCasterGUID().IsPlayer() ? "player" : "creature", - aura->GetCasterGUID().GetCounter()); + aura->GetCasterGUID().ToString()); } for (uint16 i = 0; i < TOTAL_AURAS; ++i) diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 20cf780e7..d64065bcc 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -211,11 +211,11 @@ public: if (handler->GetSession()) { - handler->PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str()); + handler->PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name); } else { - handler->PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str()); + handler->PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name); } if (!found) @@ -244,11 +244,11 @@ public: if (handler->GetSession()) { - handler->PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name.c_str()); + handler->PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CHAT, id, id, name); } else { - handler->PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name.c_str()); + handler->PSendSysMessage(LANG_CREATURE_ENTRY_LIST_CONSOLE, id, name); } if (!found) @@ -312,11 +312,11 @@ public: if (handler->GetSession()) { - handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, id, id, eventData.description.c_str(), active); + handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, id, id, eventData.description, active); } else { - handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, id, eventData.description.c_str(), active); + handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, id, eventData.description, active); } if (!found) @@ -516,11 +516,13 @@ public: if (handler->GetSession()) { - handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itemTemplate.ItemId, ItemQualityColors[itemTemplate.Quality], itemTemplate.ItemId, name.c_str()); + std::ostringstream color; + color << std::hex << ItemQualityColors[itemTemplate.Quality]; + handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itemTemplate.ItemId, color.str(), itemTemplate.ItemId, name); } else { - handler->PSendSysMessage(LANG_ITEM_LIST_CONSOLE, itemTemplate.ItemId, name.c_str()); + handler->PSendSysMessage(LANG_ITEM_LIST_CONSOLE, itemTemplate.ItemId, name); } if (!found) @@ -550,11 +552,13 @@ public: if (handler->GetSession()) { - handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itemTemplate.ItemId, ItemQualityColors[itemTemplate.Quality], itemTemplate.ItemId, name.c_str()); + std::ostringstream color; + color << std::hex << ItemQualityColors[itemTemplate.Quality]; + handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itemTemplate.ItemId, color.str(), itemTemplate.ItemId, name); } else { - handler->PSendSysMessage(LANG_ITEM_LIST_CONSOLE, itemTemplate.ItemId, name.c_str()); + handler->PSendSysMessage(LANG_ITEM_LIST_CONSOLE, itemTemplate.ItemId, name); } if (!found) @@ -640,11 +644,11 @@ public: // send item set in "id - [namedlink locale]" format if (handler->GetSession()) { - handler->PSendSysMessage(LANG_ITEMSET_LIST_CHAT, id, id, name.c_str(), localeNames[locale]); + handler->PSendSysMessage(LANG_ITEMSET_LIST_CHAT, id, id, name, localeNames[locale]); } else { - handler->PSendSysMessage(LANG_ITEMSET_LIST_CONSOLE, id, name.c_str(), localeNames[locale]); + handler->PSendSysMessage(LANG_ITEMSET_LIST_CONSOLE, id, name, localeNames[locale]); } if (!found) @@ -703,11 +707,11 @@ public: if (handler->GetSession()) { - handler->PSendSysMessage(LANG_GO_ENTRY_LIST_CHAT, gameObjectTemplate.entry, gameObjectTemplate.entry, name.c_str()); + handler->PSendSysMessage(LANG_GO_ENTRY_LIST_CHAT, gameObjectTemplate.entry, gameObjectTemplate.entry, name); } else { - handler->PSendSysMessage(LANG_GO_ENTRY_LIST_CONSOLE, gameObjectTemplate.entry, name.c_str()); + handler->PSendSysMessage(LANG_GO_ENTRY_LIST_CONSOLE, gameObjectTemplate.entry, name); } if (!found) @@ -736,11 +740,11 @@ public: if (handler->GetSession()) { - handler->PSendSysMessage(LANG_GO_ENTRY_LIST_CHAT, gameObjectTemplate.entry, gameObjectTemplate.entry, name.c_str()); + handler->PSendSysMessage(LANG_GO_ENTRY_LIST_CHAT, gameObjectTemplate.entry, gameObjectTemplate.entry, name); } else { - handler->PSendSysMessage(LANG_GO_ENTRY_LIST_CONSOLE, gameObjectTemplate.entry, name.c_str()); + handler->PSendSysMessage(LANG_GO_ENTRY_LIST_CONSOLE, gameObjectTemplate.entry, name); } if (!found) @@ -826,11 +830,11 @@ public: if (handler->GetSession()) { - handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(), qInfo->GetQuestLevel(), title.c_str(), statusStr); + handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(), qInfo->GetQuestLevel(), title, statusStr); } else { - handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qInfo->GetQuestId(), title.c_str(), statusStr); + handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qInfo->GetQuestId(), title, statusStr); } if (!found) @@ -882,11 +886,11 @@ public: if (handler->GetSession()) { - handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(), qInfo->GetQuestLevel(), title.c_str(), statusStr); + handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(), qInfo->GetQuestLevel(), title, statusStr); } else { - handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qInfo->GetQuestId(), title.c_str(), statusStr); + handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qInfo->GetQuestId(), title, statusStr); } if (!found) @@ -987,11 +991,11 @@ public: // send skill in "id - [namedlink locale]" format if (handler->GetSession()) { - handler->PSendSysMessage(LANG_SKILL_LIST_CHAT, skillInfo->id, skillInfo->id, name.c_str(), localeNames[locale], knownStr.c_str(), valStr.c_str()); + handler->PSendSysMessage(LANG_SKILL_LIST_CHAT, skillInfo->id, skillInfo->id, name, localeNames[locale], knownStr, valStr); } else { - handler->PSendSysMessage(LANG_SKILL_LIST_CONSOLE, skillInfo->id, name.c_str(), localeNames[locale], knownStr.c_str(), valStr.c_str()); + handler->PSendSysMessage(LANG_SKILL_LIST_CONSOLE, skillInfo->id, name, localeNames[locale], knownStr, valStr); } if (!found) @@ -1341,12 +1345,12 @@ public: // send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format if (handler->GetSession()) { - handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, nodeEntry->ID, nodeEntry->ID, name.c_str(), localeNames[locale], + handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CHAT, nodeEntry->ID, nodeEntry->ID, name, localeNames[locale], nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z); } else { - handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, nodeEntry->ID, name.c_str(), localeNames[locale], + handler->PSendSysMessage(LANG_TAXINODE_ENTRY_LIST_CONSOLE, nodeEntry->ID, name, localeNames[locale], nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z); } @@ -1416,7 +1420,7 @@ public: } else { - handler->PSendSysMessage(LANG_COMMAND_TELE_LOCATION, reply.str().c_str()); + handler->PSendSysMessage(LANG_COMMAND_TELE_LOCATION, reply.str()); } if (limitReached) @@ -1675,7 +1679,7 @@ public: if (result2) { - handler->PSendSysMessage(LANG_LOOKUP_PLAYER_ACCOUNT, accountName.c_str(), accountId); + handler->PSendSysMessage(LANG_LOOKUP_PLAYER_ACCOUNT, accountName, accountId); do { @@ -1694,11 +1698,11 @@ public: if (plevel > 0 && prace > 0 && prace <= RACE_DRAENEI && pclass > 0 && pclass <= CLASS_DRUID) { - handler->PSendSysMessage(" %s (GUID %u) - %s - %s - %u%s", name.c_str(), guid, EnumUtils::ToTitle(Races(prace)), EnumUtils::ToTitle(Classes(pclass)), plevel, (online ? " - [ONLINE]" : "")); + handler->PSendSysMessage(" {} (GUID {}) - {} - {} - {}{}", name, guid, EnumUtils::ToTitle(Races(prace)), EnumUtils::ToTitle(Classes(pclass)), plevel, (online ? " - [ONLINE]" : "")); } else { - handler->PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER, name.c_str(), guid); + handler->PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER, name, guid); } ++counter; diff --git a/src/server/scripts/Commands/cs_message.cpp b/src/server/scripts/Commands/cs_message.cpp index 3c4cd5b4c..104c16277 100644 --- a/src/server/scripts/Commands/cs_message.cpp +++ b/src/server/scripts/Commands/cs_message.cpp @@ -87,7 +87,7 @@ public: if (message.empty()) return false; - sWorld->SendServerMessage(SERVER_MSG_STRING, Acore::StringFormat(handler->GetAcoreString(LANG_SYSTEMMESSAGE), message.data()).c_str()); + sWorld->SendServerMessage(SERVER_MSG_STRING, Acore::StringFormatFmt(handler->GetAcoreString(LANG_SYSTEMMESSAGE), message.data())); return true; } diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 17820f31b..41e1168fa 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -357,43 +357,43 @@ public: switch (error) { case 1: - handler->PSendSysMessage("Player %s not found.", last_name.c_str()); + handler->PSendSysMessage("Player {} not found.", last_name); break; case 2: - handler->PSendSysMessage("Player %s is being teleported.", last_name.c_str()); + handler->PSendSysMessage("Player {} is being teleported.", last_name); break; case 3: - handler->PSendSysMessage("Player %s is in instance/battleground/arena.", last_name.c_str()); + handler->PSendSysMessage("Player {} is in instance/battleground/arena.", last_name); break; case 4: - handler->PSendSysMessage("Player %s is in LFG system.", last_name.c_str()); + handler->PSendSysMessage("Player {} is in LFG system.", last_name); break; case 5: - handler->PSendSysMessage("Player %s is queued for battleground/arena.", last_name.c_str()); + handler->PSendSysMessage("Player {} is queued for battleground/arena.", last_name); break; case 6: - handler->PSendSysMessage("Player %s is not in group.", last_name.c_str()); + handler->PSendSysMessage("Player {} is not in group.", last_name); break; case 7: - handler->PSendSysMessage("Player %s is not in normal group.", last_name.c_str()); + handler->PSendSysMessage("Player {} is not in normal group.", last_name); break; case 8: - handler->PSendSysMessage("Group of player %s has invalid member count.", last_name.c_str()); + handler->PSendSysMessage("Group of player {} has invalid member count.", last_name); break; case 9: - handler->PSendSysMessage("Players %s are not in the same group.", last_name.c_str()); + handler->PSendSysMessage("Players {} are not in the same group.", last_name); break; case 10: - handler->PSendSysMessage("Player %s is in flight.", last_name.c_str()); + handler->PSendSysMessage("Player {} is in flight.", last_name); break; case 11: - handler->PSendSysMessage("Player %s is dead.", last_name.c_str()); + handler->PSendSysMessage("Player {} is dead.", last_name); break; case 12: - handler->PSendSysMessage("Player %s is in a group.", last_name.c_str()); + handler->PSendSysMessage("Player {} is in a group.", last_name); break; case 13: - handler->PSendSysMessage("Player %s occurs more than once.", last_name.c_str()); + handler->PSendSysMessage("Player {} occurs more than once.", last_name); break; } @@ -724,7 +724,7 @@ public: // only allow if gm mode is on if (!_player->IsGameMaster()) { - handler->SendErrorMessage(LANG_CANNOT_GO_TO_BG_GM, nameLink.c_str()); + handler->SendErrorMessage(LANG_CANNOT_GO_TO_BG_GM, nameLink); return false; } @@ -745,7 +745,7 @@ public: // we are in group, we can go only if we are in the player group if (_player->GetGroup() != targetPlayer->GetGroup()) { - handler->SendErrorMessage(LANG_CANNOT_GO_TO_INST_PARTY, nameLink.c_str()); + handler->SendErrorMessage(LANG_CANNOT_GO_TO_INST_PARTY, nameLink); return false; } } @@ -754,7 +754,7 @@ public: // we are not in group, let's verify our GM mode if (!_player->IsGameMaster()) { - handler->SendErrorMessage(LANG_CANNOT_GO_TO_INST_GM, nameLink.c_str()); + handler->SendErrorMessage(LANG_CANNOT_GO_TO_INST_GM, nameLink); return false; } } @@ -779,7 +779,7 @@ public: } } - handler->PSendSysMessage(LANG_APPEARING_AT, nameLink.c_str()); + handler->PSendSysMessage(LANG_APPEARING_AT, nameLink); // stop flight if need if (_player->IsInFlight()) @@ -805,7 +805,7 @@ public: return false; } - handler->PSendSysMessage(LANG_APPEARING_AT, nameLink.c_str()); + handler->PSendSysMessage(LANG_APPEARING_AT, nameLink); // to point where player stay (if loaded) float x, y, z, o; @@ -869,7 +869,7 @@ public: if (targetPlayer->IsBeingTeleported()) { - handler->SendErrorMessage(LANG_IS_TELEPORTED, nameLink.c_str()); + handler->SendErrorMessage(LANG_IS_TELEPORTED, nameLink); return false; } @@ -906,15 +906,15 @@ public: (handler->GetSession()->GetPlayer()->GetGroup()->GetLeaderGUID() != handler->GetSession()->GetPlayer()->GetGUID())) // the last check is a bit excessive, but let it be, just in case { - handler->SendErrorMessage(LANG_CANNOT_SUMMON_TO_INST, nameLink.c_str()); + handler->SendErrorMessage(LANG_CANNOT_SUMMON_TO_INST, nameLink); return false; } } - handler->PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), ""); + handler->PSendSysMessage(LANG_SUMMONING, nameLink, ""); if (handler->needReportToTarget(targetPlayer)) { - ChatHandler(targetPlayer->GetSession()).PSendSysMessage(LANG_SUMMONED_BY, handler->playerLink(_player->GetName()).c_str()); + ChatHandler(targetPlayer->GetSession()).PSendSysMessage(LANG_SUMMONED_BY, handler->playerLink(_player->GetName())); } // stop flight if need @@ -942,7 +942,7 @@ public: return false; } - handler->PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), handler->GetAcoreString(LANG_OFFLINE)); + handler->PSendSysMessage(LANG_SUMMONING, nameLink, handler->GetAcoreString(LANG_OFFLINE)); // in point where GM stay Player::SavePositionInDB(handler->GetSession()->GetPlayer()->GetMapId(), @@ -984,7 +984,7 @@ public: if (!group) { - handler->SendErrorMessage(LANG_NOT_IN_GROUP, nameLink.c_str()); + handler->SendErrorMessage(LANG_NOT_IN_GROUP, nameLink); return false; } @@ -1020,7 +1020,7 @@ public: if (player->IsBeingTeleported()) { - handler->SendErrorMessage(LANG_IS_TELEPORTED, plNameLink.c_str()); + handler->SendErrorMessage(LANG_IS_TELEPORTED, plNameLink); return false; } @@ -1031,15 +1031,15 @@ public: if (playerMap->Instanceable() && playerMap->GetInstanceId() != gmMap->GetInstanceId()) { // cannot summon from instance to instance - handler->SendErrorMessage(LANG_CANNOT_SUMMON_TO_INST, plNameLink.c_str()); + handler->SendErrorMessage(LANG_CANNOT_SUMMON_TO_INST, plNameLink); return false; } } - handler->PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(), ""); + handler->PSendSysMessage(LANG_SUMMONING, plNameLink, ""); if (handler->needReportToTarget(player)) { - ChatHandler(player->GetSession()).PSendSysMessage(LANG_SUMMONED_BY, handler->GetNameLink().c_str()); + ChatHandler(player->GetSession()).PSendSysMessage(LANG_SUMMONED_BY, handler->GetNameLink()); } // stop flight if need @@ -1169,7 +1169,7 @@ public: return false; } - handler->PSendSysMessage(LANG_OBJECT_GUID, guid.ToString().c_str()); + handler->PSendSysMessage(LANG_OBJECT_GUID, guid.ToString()); return true; } @@ -1199,7 +1199,7 @@ public: if (!spell) { target->RemoveAllSpellCooldown(); - handler->PSendSysMessage(LANG_REMOVEALL_COOLDOWN, nameLink.c_str()); + handler->PSendSysMessage(LANG_REMOVEALL_COOLDOWN, nameLink); } else { @@ -1210,7 +1210,7 @@ public: } target->RemoveSpellCooldown(spell.value()->Id, true); - handler->PSendSysMessage(LANG_REMOVE_COOLDOWN, spell.value()->Id, target == handler->GetSession()->GetPlayer() ? handler->GetAcoreString(LANG_YOU) : nameLink.c_str()); + handler->PSendSysMessage(LANG_REMOVE_COOLDOWN, spell.value()->Id, target == handler->GetSession()->GetPlayer() ? handler->GetAcoreString(LANG_YOU) : nameLink); } return true; } @@ -1265,7 +1265,7 @@ public: if (targetPlayer->IsBeingTeleported()) { - handler->SendErrorMessage(LANG_IS_TELEPORTED, handler->playerLink(target->GetName()).c_str()); + handler->SendErrorMessage(LANG_IS_TELEPORTED, handler->playerLink(target->GetName())); return false; } @@ -1357,7 +1357,7 @@ public: } else { - handler->PSendSysMessage(LANG_COMMAND_KICKMESSAGE, target->GetName().c_str()); + handler->PSendSysMessage(LANG_COMMAND_KICKMESSAGE, target->GetName()); } targetPlayer->GetSession()->KickPlayer("HandleKickPlayerCommand"); @@ -1550,7 +1550,7 @@ public: team_name = handler->GetAcoreString(LANG_COMMAND_GRAVEYARD_ALLIANCE); } - handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDNEAREST, graveyardId, team_name.c_str(), zone_id); + handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDNEAREST, graveyardId, team_name, zone_id); } else { @@ -1569,7 +1569,7 @@ public: team_name = handler->GetAcoreString(LANG_COMMAND_GRAVEYARD_ALLIANCE); } - handler->PSendSysMessage(LANG_COMMAND_ZONENOGRAFACTION, zone_id, team_name.c_str()); + handler->PSendSysMessage(LANG_COMMAND_ZONENOGRAFACTION, zone_id, team_name); } return true; @@ -1674,21 +1674,21 @@ public: if (!playerTarget->HasItemCount(itemId, 0)) { // output that player don't have any items to destroy - handler->SendErrorMessage(LANG_REMOVEITEM_FAILURE, handler->GetNameLink(playerTarget).c_str(), itemId); + handler->SendErrorMessage(LANG_REMOVEITEM_FAILURE, handler->GetNameLink(playerTarget), itemId); return false; } if (!playerTarget->HasItemCount(itemId, -count)) { // output that player don't have as many items that you want to destroy - handler->SendErrorMessage(LANG_REMOVEITEM_ERROR, handler->GetNameLink(playerTarget).c_str(), itemId); + handler->SendErrorMessage(LANG_REMOVEITEM_ERROR, handler->GetNameLink(playerTarget), itemId); return false; } } // output successful amount of destroyed items playerTarget->DestroyItemCount(itemId, -count, true, false); - handler->PSendSysMessage(LANG_REMOVEITEM, itemId, -count, handler->GetNameLink(playerTarget).c_str()); + handler->PSendSysMessage(LANG_REMOVEITEM, itemId, -count, handler->GetNameLink(playerTarget)); return true; } @@ -1883,7 +1883,7 @@ public: // add the skill to the player's book with step 1 (which is the first rank, in most cases something // like 'Apprentice '. target->SetSkill(skillID, targetHasSkill ? target->GetSkillStep(skillID) : 1, level, max); - handler->PSendSysMessage(LANG_SET_SKILL, skillID, skillLine->name[handler->GetSessionDbcLocale()], handler->GetNameLink(target).c_str(), level, max); + handler->PSendSysMessage(LANG_SET_SKILL, skillID, skillLine->name[handler->GetSessionDbcLocale()], handler->GetNameLink(target), level, max); return true; } @@ -2131,7 +2131,7 @@ public: // Initiate output // Output I. LANG_PINFO_PLAYER - handler->PSendSysMessage(LANG_PINFO_PLAYER, playerTarget ? "" : handler->GetAcoreString(LANG_OFFLINE), nameLink.c_str(), target->GetGUID().GetCounter()); + handler->PSendSysMessage(LANG_PINFO_PLAYER, playerTarget ? "" : handler->GetAcoreString(LANG_OFFLINE), nameLink, target->GetGUID().ToString()); // Output II. LANG_PINFO_GM_ACTIVE if character is gamemaster if (playerTarget && playerTarget->IsGameMaster()) @@ -2142,29 +2142,29 @@ public: // Output III. LANG_PINFO_BANNED if ban exists and is applied if (banTime >= 0) { - handler->PSendSysMessage(LANG_PINFO_BANNED, banType.c_str(), banReason.c_str(), banTime > 0 ? secsToTimeString(banTime - GameTime::GetGameTime().count(), true).c_str() : handler->GetAcoreString(LANG_PERMANENTLY), bannedBy.c_str()); + handler->PSendSysMessage(LANG_PINFO_BANNED, banType, banReason, banTime > 0 ? secsToTimeString(banTime - GameTime::GetGameTime().count(), true) : handler->GetAcoreString(LANG_PERMANENTLY), bannedBy); } // Output IV. LANG_PINFO_MUTED if mute is applied if (muteTime > 0) { - handler->PSendSysMessage(LANG_PINFO_MUTED, muteReason.c_str(), secsToTimeString(muteTime - GameTime::GetGameTime().count(), true).c_str(), muteBy.c_str()); + handler->PSendSysMessage(LANG_PINFO_MUTED, muteReason, secsToTimeString(muteTime - GameTime::GetGameTime().count(), true), muteBy); } // Output V. LANG_PINFO_ACC_ACCOUNT - handler->PSendSysMessage(LANG_PINFO_ACC_ACCOUNT, userName.c_str(), accId, security); + handler->PSendSysMessage(LANG_PINFO_ACC_ACCOUNT, userName, accId, security); // Output VI. LANG_PINFO_ACC_LASTLOGIN - handler->PSendSysMessage(LANG_PINFO_ACC_LASTLOGIN, lastLogin.c_str(), failedLogins); + handler->PSendSysMessage(LANG_PINFO_ACC_LASTLOGIN, lastLogin, failedLogins); // Output VII. LANG_PINFO_ACC_OS - handler->PSendSysMessage(LANG_PINFO_ACC_OS, OS.c_str(), latency); + handler->PSendSysMessage(LANG_PINFO_ACC_OS, OS, latency); // Output VIII. LANG_PINFO_ACC_REGMAILS - handler->PSendSysMessage(LANG_PINFO_ACC_REGMAILS, regMail.c_str(), eMail.c_str()); + handler->PSendSysMessage(LANG_PINFO_ACC_REGMAILS, regMail, eMail); // Output IX. LANG_PINFO_ACC_IP - handler->PSendSysMessage(LANG_PINFO_ACC_IP, lastIp.c_str(), locked ? handler->GetAcoreString(LANG_YES) : handler->GetAcoreString(LANG_NO)); + handler->PSendSysMessage(LANG_PINFO_ACC_IP, lastIp, locked ? handler->GetAcoreString(LANG_YES) : handler->GetAcoreString(LANG_NO)); // Output X. LANG_PINFO_CHR_LEVEL if (level != sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) @@ -2245,10 +2245,10 @@ public: break; } - handler->PSendSysMessage(LANG_PINFO_CHR_RACE, (gender == 0 ? handler->GetAcoreString(LANG_CHARACTER_GENDER_MALE) : handler->GetAcoreString(LANG_CHARACTER_GENDER_FEMALE)), raceStr.c_str(), classStr.c_str()); + handler->PSendSysMessage(LANG_PINFO_CHR_RACE, (gender == 0 ? handler->GetAcoreString(LANG_CHARACTER_GENDER_MALE) : handler->GetAcoreString(LANG_CHARACTER_GENDER_FEMALE)), raceStr, classStr); // Output XII. LANG_PINFO_CHR_ALIVE - handler->PSendSysMessage(LANG_PINFO_CHR_ALIVE, alive.c_str()); + handler->PSendSysMessage(LANG_PINFO_CHR_ALIVE, alive); // Output XIII. LANG_PINFO_CHR_PHASE if player is not in GM mode (GM is in every phase) if (playerTarget && !playerTarget->IsGameMaster()) // IsInWorld() returns false on loadingscreen, so it's more @@ -2296,22 +2296,22 @@ public: // Output XVII. - XVIX. if they are not empty if (!guildName.empty()) { - handler->PSendSysMessage(LANG_PINFO_CHR_GUILD, guildName.c_str(), guildId); - handler->PSendSysMessage(LANG_PINFO_CHR_GUILD_RANK, guildRank.c_str(), uint32(guildRankId)); + handler->PSendSysMessage(LANG_PINFO_CHR_GUILD, guildName, guildId); + handler->PSendSysMessage(LANG_PINFO_CHR_GUILD_RANK, guildRank, uint32(guildRankId)); if (!note.empty()) { - handler->PSendSysMessage(LANG_PINFO_CHR_GUILD_NOTE, note.c_str()); + handler->PSendSysMessage(LANG_PINFO_CHR_GUILD_NOTE, note); } if (!officeNote.empty()) { - handler->PSendSysMessage(LANG_PINFO_CHR_GUILD_ONOTE, officeNote.c_str()); + handler->PSendSysMessage(LANG_PINFO_CHR_GUILD_ONOTE, officeNote); } } // Output XX. LANG_PINFO_CHR_PLAYEDTIME - handler->PSendSysMessage(LANG_PINFO_CHR_PLAYEDTIME, (secsToTimeString(totalPlayerTime, true)).c_str()); + handler->PSendSysMessage(LANG_PINFO_CHR_PLAYEDTIME, (secsToTimeString(totalPlayerTime, true))); // Mail Data - an own query, because it may or may not be useful. // SQL: "SELECT SUM(CASE WHEN (checked & 1) THEN 1 ELSE 0 END) AS 'readmail', COUNT(*) AS 'totalmail' FROM mail WHERE `receiver` = ?" @@ -2458,7 +2458,7 @@ public: sWorld->SendWorldText(LANG_COMMAND_MUTEMESSAGE_WORLD, muteBy.c_str(), nameLink.c_str(), secsToTimeString(muteDuration, true).c_str(), muteReasonStr.c_str()); } - ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, secsToTimeString(muteDuration, true).c_str(), muteBy.c_str(), muteReasonStr.c_str()); + ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, secsToTimeString(muteDuration, true), muteBy, muteReasonStr); } else { @@ -2492,7 +2492,7 @@ public: for (HashMapHolder::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) if (itr->second->GetSession()->GetSecurity()) ChatHandler(itr->second->GetSession()).PSendSysMessage(target ? LANG_YOU_DISABLE_CHAT : LANG_COMMAND_DISABLE_CHAT_DELAYED, - (handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : handler->GetAcoreString(LANG_CONSOLE)), nameLink.c_str(), secsToTimeString(muteDuration, true).c_str(), muteReasonStr.c_str()); + (handler->GetSession() ? handler->GetSession()->GetPlayerName() : handler->GetAcoreString(LANG_CONSOLE)), nameLink, secsToTimeString(muteDuration, true), muteReasonStr); } return true; @@ -2552,7 +2552,7 @@ public: ChatHandler(playerTarget->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_ENABLED); } - handler->PSendSysMessage(LANG_YOU_ENABLE_CHAT, handler->playerLink(target->GetName().c_str())); + handler->PSendSysMessage(LANG_YOU_ENABLE_CHAT, handler->playerLink(target->GetName())); return true; } @@ -2562,14 +2562,14 @@ public: { 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->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str()); + handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName); return false; } @@ -2593,7 +2593,7 @@ public: do { Field* fields = result->Fetch(); - handler->PSendSysMessage(LANG_COMMAND_MUTEHISTORY_OUTPUT, Acore::Time::TimeToHumanReadable(Seconds(fields[0].Get())).c_str(), fields[1].Get(), fields[2].Get().c_str(), fields[3].Get().c_str()); + handler->PSendSysMessage(LANG_COMMAND_MUTEHISTORY_OUTPUT, Acore::Time::TimeToHumanReadable(Seconds(fields[0].Get())), fields[1].Get(), fields[2].Get(), fields[3].Get()); } while (result->NextRow()); return true; @@ -2608,7 +2608,7 @@ public: return false; } - handler->PSendSysMessage(LANG_MOVEGENS_LIST, (unit->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), unit->GetGUID().GetCounter()); + handler->PSendSysMessage(LANG_MOVEGENS_LIST, (unit->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), unit->GetGUID().ToString()); MotionMaster* motionMaster = unit->GetMotionMaster(); float x, y, z; @@ -2658,11 +2658,11 @@ public: } else if (target->GetTypeId() == TYPEID_PLAYER) { - handler->PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, target->GetName().c_str(), target->GetGUID().GetCounter()); + handler->PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, target->GetName(), target->GetGUID().ToString()); } else { - handler->PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, target->GetName().c_str(), target->GetGUID().GetCounter()); + handler->PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, target->GetName(), target->GetGUID().ToString()); } break; } @@ -2684,11 +2684,11 @@ public: } else if (target->GetTypeId() == TYPEID_PLAYER) { - handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, target->GetName().c_str(), target->GetGUID().GetCounter()); + handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, target->GetName(), target->GetGUID().ToString()); } else { - handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, target->GetName().c_str(), target->GetGUID().GetCounter()); + handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, target->GetName(), target->GetGUID().ToString()); } break; } @@ -2841,7 +2841,7 @@ public: Player* playerTarget = target->GetConnectedPlayer(); if (playerTarget && !creatureTarget) { - handler->PSendSysMessage(LANG_COMMAND_FREEZE, target->GetName().c_str()); + handler->PSendSysMessage(LANG_COMMAND_FREEZE, target->GetName()); if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_FREEZE)) { @@ -2852,7 +2852,7 @@ public: } else if (creatureTarget && creatureTarget->IsAlive()) { - handler->PSendSysMessage(LANG_COMMAND_FREEZE, GetLocalizeCreatureName(creatureTarget, handler->GetSessionDbcLocale()).c_str()); + handler->PSendSysMessage(LANG_COMMAND_FREEZE, GetLocalizeCreatureName(creatureTarget, handler->GetSessionDbcLocale())); if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_FREEZE)) { @@ -2885,13 +2885,13 @@ public: if (!creatureTarget && playerTarget && playerTarget->HasAura(SPELL_FREEZE)) { - handler->PSendSysMessage(LANG_COMMAND_UNFREEZE, target->GetName().c_str()); + handler->PSendSysMessage(LANG_COMMAND_UNFREEZE, target->GetName()); playerTarget->RemoveAurasDueToSpell(SPELL_FREEZE); return true; } else if (creatureTarget && creatureTarget->HasAura(SPELL_FREEZE)) { - handler->PSendSysMessage(LANG_COMMAND_UNFREEZE, GetLocalizeCreatureName(creatureTarget, handler->GetSessionDbcLocale()).c_str()); + handler->PSendSysMessage(LANG_COMMAND_UNFREEZE, GetLocalizeCreatureName(creatureTarget, handler->GetSessionDbcLocale())); creatureTarget->RemoveAurasDueToSpell(SPELL_FREEZE); return true; } @@ -2900,7 +2900,7 @@ public: CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN); stmt->SetData(0, target->GetGUID().GetCounter()); CharacterDatabase.Execute(stmt); - handler->PSendSysMessage(LANG_COMMAND_UNFREEZE, target->GetName().c_str()); + handler->PSendSysMessage(LANG_COMMAND_UNFREEZE, target->GetName()); return true; } diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp index 9e72cfc70..dba16fab4 100644 --- a/src/server/scripts/Commands/cs_mmaps.cpp +++ b/src/server/scripts/Commands/cs_mmaps.cpp @@ -105,17 +105,17 @@ public: bool result = path.CalculatePath(x, y, z, false); Movement::PointsArray const& pointPath = path.GetPath(); - handler->PSendSysMessage("%s's path to %s:", target->GetName().c_str(), player->GetName().c_str()); - handler->PSendSysMessage("Building: %s", useStraightPath ? "StraightPath" : useRaycast ? "Raycast" : "SmoothPath"); - handler->PSendSysMessage(Acore::StringFormatFmt("Result: {} - Length: {} - Type: {}", (result ? "true" : "false"), pointPath.size(), path.GetPathType()).c_str()); + handler->PSendSysMessage("{}'s path to {}:", target->GetName(), player->GetName()); + handler->PSendSysMessage("Building: {}", useStraightPath ? "StraightPath" : useRaycast ? "Raycast" : "SmoothPath"); + handler->PSendSysMessage("Result: {} - Length: {} - Type: {}", (result ? "true" : "false"), pointPath.size(), path.GetPathType()); G3D::Vector3 const& start = path.GetStartPosition(); G3D::Vector3 const& end = path.GetEndPosition(); G3D::Vector3 const& actualEnd = path.GetActualEndPosition(); - handler->PSendSysMessage("StartPosition (%.3f, %.3f, %.3f)", start.x, start.y, start.z); - handler->PSendSysMessage("EndPosition (%.3f, %.3f, %.3f)", end.x, end.y, end.z); - handler->PSendSysMessage("ActualEndPosition (%.3f, %.3f, %.3f)", actualEnd.x, actualEnd.y, actualEnd.z); + handler->PSendSysMessage("StartPosition ({}, {}, {})", start.x, start.y, start.z); + handler->PSendSysMessage("EndPosition ({}, {}, {})", end.x, end.y, end.z); + handler->PSendSysMessage("ActualEndPosition ({}, {}, {})", actualEnd.x, actualEnd.y, actualEnd.z); if (!player->IsGameMaster()) handler->PSendSysMessage("Enable GM mode to see the path points."); @@ -136,8 +136,8 @@ public: int32 gx = 32 - player->GetPositionX() / SIZE_OF_GRIDS; int32 gy = 32 - player->GetPositionY() / SIZE_OF_GRIDS; - handler->PSendSysMessage("%03u%02i%02i.mmtile", player->GetMapId(), gx, gy); - handler->PSendSysMessage("gridloc [%i, %i]", gy, gx); + handler->PSendSysMessage("{}{}{}.mmtile", player->GetMapId(), gx, gy); + handler->PSendSysMessage("gridloc [{}, {}]", gy, gx); // calculate navmesh tile location dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapMgr()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId()); @@ -157,7 +157,7 @@ public: int32 tilex = int32((y - min[0]) / SIZE_OF_GRIDS); int32 tiley = int32((x - min[2]) / SIZE_OF_GRIDS); - handler->PSendSysMessage("Calc [%02i, %02i]", tilex, tiley); + handler->PSendSysMessage("Calc [{}, {}]", tilex, tiley); // navmesh poly -> navmesh tile location dtQueryFilterExt filter = dtQueryFilterExt(); @@ -178,7 +178,7 @@ public: { if (tile) { - handler->PSendSysMessage("Dt [%02i,%02i]", tile->header->x, tile->header->y); + handler->PSendSysMessage("Dt [{},{}]", tile->header->x, tile->header->y); return false; } } @@ -208,7 +208,7 @@ public: if (!tile || !tile->header) continue; - handler->PSendSysMessage("[%02i, %02i]", tile->header->x, tile->header->y); + handler->PSendSysMessage("[{}, {}]", tile->header->x, tile->header->y); } return true; @@ -220,7 +220,7 @@ public: //handler->PSendSysMessage(" global mmap pathfinding is %sabled", DisableMgr::IsPathfindingEnabled(mapId) ? "en" : "dis"); MMAP::MMapMgr* manager = MMAP::MMapFactory::createOrGetMMapMgr(); - handler->PSendSysMessage(" %u maps loaded with %u tiles overall", manager->getLoadedMapsCount(), manager->getLoadedTilesCount()); + handler->PSendSysMessage(" {} maps loaded with {} tiles overall", manager->getLoadedMapsCount(), manager->getLoadedTilesCount()); dtNavMesh const* navmesh = manager->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId()); if (!navmesh) @@ -252,11 +252,11 @@ public: } handler->PSendSysMessage("Navmesh stats:"); - handler->PSendSysMessage(" %u tiles loaded", tileCount); - handler->PSendSysMessage(" %u BVTree nodes", nodeCount); - handler->PSendSysMessage(" %u polygons (%u vertices)", polyCount, vertCount); - handler->PSendSysMessage(" %u triangles (%u vertices)", triCount, triVertCount); - handler->PSendSysMessage(" %.2f MB of data (not including pointers)", ((float)dataSize / sizeof(unsigned char)) / 1048576); + handler->PSendSysMessage(" {} tiles loaded", tileCount); + handler->PSendSysMessage(" {} BVTree nodes", nodeCount); + handler->PSendSysMessage(" {} polygons ({} vertices)", polyCount, vertCount); + handler->PSendSysMessage(" {} triangles ({} vertices)", triCount, triVertCount); + handler->PSendSysMessage(" {} MB of data (not including pointers)", ((float)dataSize / sizeof(unsigned char)) / 1048576); return true; } @@ -274,7 +274,7 @@ public: if (!creatureList.empty()) { - handler->PSendSysMessage(Acore::StringFormatFmt("Found {} Creatures.", creatureList.size()).c_str()); + handler->PSendSysMessage("Found {} Creatures.", creatureList.size()); uint32 paths = 0; uint32 uStartTime = getMSTime(); @@ -289,10 +289,10 @@ public: } uint32 uPathLoadTime = getMSTimeDiff(uStartTime, getMSTime()); - handler->PSendSysMessage("Generated %i paths in %i ms", paths, uPathLoadTime); + handler->PSendSysMessage("Generated {} paths in {} ms", paths, uPathLoadTime); } else - handler->PSendSysMessage("No creatures in %f yard range.", radius); + handler->PSendSysMessage("No creatures in {} yard range.", radius); return true; } diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index 302c09a96..a34e82fe5 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -94,11 +94,11 @@ public: { if (Player* player = target->ToPlayer()) { - handler->PSendSysMessage(resourceMessage, std::forward(args)..., handler->GetNameLink(player).c_str()); + handler->PSendSysMessage(resourceMessage, std::forward(args)..., handler->GetNameLink(player)); if (handler->needReportToTarget(player)) { - ChatHandler(player->GetSession()).PSendSysMessage(resourceReportMessage, handler->GetNameLink().c_str(), std::forward(args)...); + ChatHandler(player->GetSession()).PSendSysMessage(resourceReportMessage, handler->GetNameLink(), std::forward(args)...); } } } @@ -135,11 +135,11 @@ public: return false; } - handler->PSendSysMessage(LANG_YOU_CHANGE_HP, handler->GetNameLink(target).c_str(), healthPoints, healthPoints); + handler->PSendSysMessage(LANG_YOU_CHANGE_HP, handler->GetNameLink(target), healthPoints, healthPoints); if (handler->needReportToTarget(target)) { - ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_HP_CHANGED, handler->GetNameLink().c_str(), healthPoints, healthPoints); + ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_HP_CHANGED, handler->GetNameLink(), healthPoints, healthPoints); } target->SetMaxHealth(healthPoints); @@ -158,11 +158,11 @@ public: return false; } - handler->PSendSysMessage(LANG_YOU_CHANGE_MANA, handler->GetNameLink(target).c_str(), manaPoints, manaPoints); + handler->PSendSysMessage(LANG_YOU_CHANGE_MANA, handler->GetNameLink(target), manaPoints, manaPoints); if (handler->needReportToTarget(target)) { - ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_MANA_CHANGED, handler->GetNameLink().c_str(), manaPoints, manaPoints); + ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_MANA_CHANGED, handler->GetNameLink(), manaPoints, manaPoints); } target->SetMaxPower(POWER_MANA, manaPoints); @@ -183,11 +183,11 @@ public: energyPoints *= 10; - handler->PSendSysMessage(LANG_YOU_CHANGE_ENERGY, handler->GetNameLink(target).c_str(), energyPoints / 10, energyPoints / 10); + handler->PSendSysMessage(LANG_YOU_CHANGE_ENERGY, handler->GetNameLink(target), energyPoints / 10, energyPoints / 10); if (handler->needReportToTarget(target)) { - ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, handler->GetNameLink().c_str(), energyPoints / 10, energyPoints / 10); + ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_ENERGY_CHANGED, handler->GetNameLink(), energyPoints / 10, energyPoints / 10); } target->SetMaxPower(POWER_ENERGY, energyPoints); @@ -210,11 +210,11 @@ public: ragePoints *= 10; - handler->PSendSysMessage(LANG_YOU_CHANGE_RAGE, handler->GetNameLink(target).c_str(), ragePoints / 10, ragePoints / 10); + handler->PSendSysMessage(LANG_YOU_CHANGE_RAGE, handler->GetNameLink(target), ragePoints / 10, ragePoints / 10); if (handler->needReportToTarget(target)) { - ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, handler->GetNameLink().c_str(), ragePoints / 10, ragePoints / 10); + ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_RAGE_CHANGED, handler->GetNameLink(), ragePoints / 10, ragePoints / 10); } target->SetMaxPower(POWER_RAGE, ragePoints); @@ -235,11 +235,11 @@ public: runePoints *= 10; - handler->PSendSysMessage(LANG_YOU_CHANGE_RUNIC_POWER, handler->GetNameLink(target).c_str(), runePoints / 10, runePoints / 10); + handler->PSendSysMessage(LANG_YOU_CHANGE_RUNIC_POWER, handler->GetNameLink(target), runePoints / 10, runePoints / 10); if (handler->needReportToTarget(target)) { - ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_RUNIC_POWER_CHANGED, handler->GetNameLink().c_str(), runePoints / 10, runePoints / 10); + ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_RUNIC_POWER_CHANGED, handler->GetNameLink(), runePoints / 10, runePoints / 10); } target->SetMaxPower(POWER_RUNIC_POWER, runePoints); @@ -264,7 +264,7 @@ public: uint32 flag = target->GetUnitFlags(); uint32 npcflag = target->GetNpcFlags(); uint32 dyflag = target->GetDynamicFlags(); - handler->PSendSysMessage(LANG_CURRENT_FACTION, target->GetGUID().GetCounter(), factionid, flag, npcflag, dyflag); + handler->PSendSysMessage(LANG_CURRENT_FACTION, target->GetGUID().ToString(), factionid, flag, npcflag, dyflag); return true; } @@ -297,7 +297,7 @@ public: return false; } - handler->PSendSysMessage(LANG_YOU_CHANGE_FACTION, target->GetGUID().GetCounter(), factionid, flag, npcflag, dyflag); + handler->PSendSysMessage(LANG_YOU_CHANGE_FACTION, target->GetGUID().ToString(), factionid, flag, npcflag, dyflag); target->SetFaction(factionid); target->ReplaceAllUnitFlags(flag); @@ -323,10 +323,10 @@ public: return false; } - handler->PSendSysMessage(LANG_YOU_CHANGE_SPELLFLATID, spellFlatID, val, mark ? *mark : 65535, handler->GetNameLink(target).c_str()); + handler->PSendSysMessage(LANG_YOU_CHANGE_SPELLFLATID, spellFlatID, val, mark ? *mark : 65535, handler->GetNameLink(target)); if (handler->needReportToTarget(target)) { - ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, handler->GetNameLink().c_str(), spellFlatID, val, mark ? *mark : 65535); + ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_SPELLFLATID_CHANGED, handler->GetNameLink(), spellFlatID, val, mark ? *mark : 65535); } WorldPacket data(SMSG_SET_FLAT_SPELL_MODIFIER, (1 + 1 + 2 + 2)); @@ -511,9 +511,9 @@ public: if (handler->HasLowerSecurity(player)) return false; - handler->PSendSysMessage(LANG_YOU_CHANGE_SIZE, scale, handler->GetNameLink(player).c_str()); + handler->PSendSysMessage(LANG_YOU_CHANGE_SIZE, scale, handler->GetNameLink(player)); if (handler->needReportToTarget(player)) - ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, handler->GetNameLink().c_str(), scale); + ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOURS_SIZE_CHANGED, handler->GetNameLink(), scale); } target->SetObjectScale(scale); @@ -617,9 +617,9 @@ public: LOG_DEBUG("chat.system", handler->GetAcoreString(LANG_CURRENT_MONEY), targetMoney, moneyToAdd, newmoney); if (newmoney <= 0) { - handler->PSendSysMessage(LANG_YOU_TAKE_ALL_MONEY, handler->GetNameLink(target).c_str()); + handler->PSendSysMessage(LANG_YOU_TAKE_ALL_MONEY, handler->GetNameLink(target)); if (handler->needReportToTarget(target)) - ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_ALL_MONEY_GONE, handler->GetNameLink().c_str()); + ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_ALL_MONEY_GONE, handler->GetNameLink()); target->SetMoney(0); } @@ -628,17 +628,17 @@ public: if (newmoney > MAX_MONEY_AMOUNT) newmoney = MAX_MONEY_AMOUNT; - handler->PSendSysMessage(LANG_YOU_TAKE_MONEY, std::abs(moneyToAdd), handler->GetNameLink(target).c_str()); + handler->PSendSysMessage(LANG_YOU_TAKE_MONEY, std::abs(moneyToAdd), handler->GetNameLink(target)); if (handler->needReportToTarget(target)) - ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, handler->GetNameLink().c_str(), std::abs(moneyToAdd)); + ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_MONEY_TAKEN, handler->GetNameLink(), std::abs(moneyToAdd)); target->SetMoney(newmoney); } } else { - handler->PSendSysMessage(LANG_YOU_GIVE_MONEY, moneyToAdd, handler->GetNameLink(target).c_str()); + handler->PSendSysMessage(LANG_YOU_GIVE_MONEY, moneyToAdd, handler->GetNameLink(target)); if (handler->needReportToTarget(target)) - ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, handler->GetNameLink().c_str(), moneyToAdd); + ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_MONEY_GIVEN, handler->GetNameLink(), moneyToAdd); if (moneyToAdd >= MAX_MONEY_AMOUNT) moneyToAdd = MAX_MONEY_AMOUNT; @@ -713,7 +713,7 @@ public: target->ModifyHonorPoints(amount); - handler->PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, handler->GetNameLink(target).c_str(), target->GetHonorPoints()); + handler->PSendSysMessage(LANG_COMMAND_MODIFY_HONOR, handler->GetNameLink(target), target->GetHonorPoints()); return true; } @@ -830,7 +830,7 @@ public: target->GetReputationMgr().SendState(target->GetReputationMgr().GetState(factionEntry)); handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name[handler->GetSessionDbcLocale()], factionId, - handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry)); + handler->GetNameLink(target), target->GetReputationMgr().GetReputation(factionEntry)); return true; } @@ -903,7 +903,7 @@ public: target->ModifyArenaPoints(amount); - handler->PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, handler->GetNameLink(target).c_str(), target->GetArenaPoints()); + handler->PSendSysMessage(LANG_COMMAND_MODIFY_ARENA, handler->GetNameLink(target), target->GetArenaPoints()); return true; } @@ -959,11 +959,11 @@ public: char const* gender_full = gender ? "female" : "male"; - handler->PSendSysMessage(LANG_YOU_CHANGE_GENDER, handler->GetNameLink(target).c_str(), gender_full); + handler->PSendSysMessage(LANG_YOU_CHANGE_GENDER, handler->GetNameLink(target), gender_full); if (handler->needReportToTarget(target)) { - ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_GENDER_CHANGED, gender_full, handler->GetNameLink().c_str()); + ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_GENDER_CHANGED, gender_full, handler->GetNameLink()); } return true; diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index c0dff09ec..c06d9a3d9 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -289,7 +289,7 @@ public: sObjectMgr->AddVendorItem(vendor_entry, itemId, maxcount, incrtime, extendedcost); - handler->PSendSysMessage(LANG_ITEM_ADDED_TO_LIST, itemId, item->Name1.c_str(), maxcount, incrtime, extendedcost); + handler->PSendSysMessage(LANG_ITEM_ADDED_TO_LIST, itemId, item->Name1, maxcount, incrtime, extendedcost); return true; } @@ -416,7 +416,7 @@ public: return false; } - handler->PSendSysMessage(LANG_ITEM_DELETED_FROM_LIST, itemId, item->Name1.c_str()); + handler->PSendSysMessage(LANG_ITEM_DELETED_FROM_LIST, itemId, item->Name1); return true; } @@ -531,7 +531,7 @@ public: creature->AI()->SetData(data_1, data_2); std::string AIorScript = !creature->GetAIName().empty() ? "AI type: " + creature->GetAIName() : (!creature->GetScriptName().empty() ? "Script Name: " + creature->GetScriptName() : "No AI or Script Name Set"); - handler->PSendSysMessage(LANG_NPC_SETDATA, creature->GetGUID().GetCounter(), creature->GetEntry(), creature->GetName().c_str(), data_1, data_2, AIorScript.c_str()); + handler->PSendSysMessage(LANG_NPC_SETDATA, creature->GetGUID().ToString(), creature->GetEntry(), creature->GetName(), data_1, data_2, AIorScript); return true; } @@ -550,7 +550,7 @@ public: // Follow player - Using pet's default dist and angle creature->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, creature->GetFollowAngle()); - handler->PSendSysMessage(LANG_CREATURE_FOLLOW_YOU_NOW, creature->GetName().c_str()); + handler->PSendSysMessage(LANG_CREATURE_FOLLOW_YOU_NOW, creature->GetName()); return true; } @@ -588,18 +588,18 @@ public: std::string curRespawnDelayStr = secsToTimeString(uint64(curRespawnDelay), true); std::string defRespawnDelayStr = secsToTimeString(target->GetRespawnDelay(), true); - handler->PSendSysMessage(LANG_NPCINFO_CHAR, target->GetSpawnId(), target->GetGUID().GetCounter(), entry, id1, id2, id3, displayid, nativeid, faction, npcflags); + handler->PSendSysMessage(LANG_NPCINFO_CHAR, target->GetSpawnId(), target->GetGUID().ToString(), entry, id1, id2, id3, displayid, nativeid, faction, npcflags); handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->GetLevel()); handler->PSendSysMessage(LANG_NPCINFO_EQUIPMENT, target->GetCurrentEquipmentId(), target->GetOriginalEquipmentId()); handler->PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth()); handler->PSendSysMessage(LANG_NPCINFO_FLAGS, target->GetUnitFlags(), target->GetUnitFlags2(), target->GetDynamicFlags(), target->GetFaction()); - handler->PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(), curRespawnDelayStr.c_str()); + handler->PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr, curRespawnDelayStr); handler->PSendSysMessage(LANG_NPCINFO_LOOT, cInfo->lootid, cInfo->pickpocketLootId, cInfo->SkinLootId); handler->PSendSysMessage(LANG_NPCINFO_DUNGEON_ID, target->GetInstanceId()); handler->PSendSysMessage(LANG_NPCINFO_PHASEMASK, target->GetPhaseMask()); handler->PSendSysMessage(LANG_NPCINFO_ARMOR, target->GetArmor()); handler->PSendSysMessage(LANG_NPCINFO_POSITION, float(target->GetPositionX()), float(target->GetPositionY()), float(target->GetPositionZ())); - handler->PSendSysMessage(LANG_NPCINFO_AIINFO, target->GetAIName().c_str(), target->GetScriptName().c_str()); + handler->PSendSysMessage(LANG_NPCINFO_AIINFO, target->GetAIName(), target->GetScriptName()); for (uint8 i = 0; i < NPCFLAG_COUNT; i++) { @@ -654,7 +654,7 @@ public: id3 = cData->id3; } - handler->PSendSysMessage(LANG_NPCINFO_CHAR, target->GetSpawnId(), target->GetGUID().GetCounter(), entry, id1, id2, id3, displayid, nativeid, faction, npcflags); + handler->PSendSysMessage(LANG_NPCINFO_CHAR, target->GetSpawnId(), target->GetGUID().ToString(), entry, id1, id2, id3, displayid, nativeid, faction, npcflags); return true; } @@ -696,7 +696,7 @@ public: if (!creatureTemplate) continue; - handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, entry, guid, creatureTemplate->Name.c_str(), x, y, z, mapId, "", ""); + handler->PSendSysMessage(LANG_CREATURE_LIST_CHAT, guid, entry, guid, creatureTemplate->Name, x, y, z, mapId, "", ""); ++count; } while (result->NextRow()); @@ -1022,7 +1022,7 @@ public: WorldDatabase.Execute(stmt); creature->SetRespawnDelay(spawnTime); - handler->PSendSysMessage(LANG_COMMAND_SPAWNTIME, secsToTimeString(spawnTime, true).c_str()); + handler->PSendSysMessage(LANG_COMMAND_SPAWNTIME, secsToTimeString(spawnTime, true)); return true; } @@ -1101,7 +1101,7 @@ public: // reset movement creature->GetMotionMaster()->MovementExpired(true); - handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU_NOW, creature->GetName().c_str()); + handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU_NOW, creature->GetName()); return true; } @@ -1166,8 +1166,8 @@ public: Creature* creatureTarget = handler->getSelectedCreature(); if (!creatureTarget || creatureTarget->IsPet()) { - handler->PSendSysMessage (LANG_SELECT_CREATURE); - handler->SetSentErrorMessage (true); + handler->PSendSysMessage(LANG_SELECT_CREATURE); + handler->SetSentErrorMessage(true); return false; } @@ -1210,7 +1210,7 @@ public: ObjectGuid::LowType lowguid = creature->GetSpawnId(); if (creature->GetFormation()) { - handler->PSendSysMessage("Selected creature is already member of group %u", creature->GetFormation()->GetId()); + handler->PSendSysMessage("Selected creature is already member of group {}", creature->GetFormation()->GetId()); return false; } @@ -1236,7 +1236,7 @@ public: WorldDatabase.Execute(stmt); - handler->PSendSysMessage("Creature %u added to formation with leader %u", lowguid, leaderGUID); + handler->PSendSysMessage("Creature {} added to formation with leader {}", lowguid, leaderGUID); return true; } @@ -1253,7 +1253,7 @@ public: if (!creature->GetSpawnId()) { - handler->SendErrorMessage("Selected creature %u isn't in creature table", creature->GetGUID().GetCounter()); + handler->SendErrorMessage("Selected creature {} isn't in creature table", creature->GetGUID().ToString()); return false; } @@ -1263,7 +1263,7 @@ public: return false; } - handler->PSendSysMessage("LinkGUID '%u' added to creature with DBTableGUID: '%u'", linkguid, creature->GetSpawnId()); + handler->PSendSysMessage("LinkGUID '{}' added to creature with DBTableGUID: '{}'", linkguid, creature->GetSpawnId()); return true; } }; diff --git a/src/server/scripts/Commands/cs_pet.cpp b/src/server/scripts/Commands/cs_pet.cpp index 30937d5ca..afd83c1a6 100644 --- a/src/server/scripts/Commands/cs_pet.cpp +++ b/src/server/scripts/Commands/cs_pet.cpp @@ -108,19 +108,19 @@ public: uint32 spellDifficultyId = sSpellMgr->GetSpellDifficultyId(spell->Id); if (bounds.first != bounds.second || spellDifficultyId) { - handler->SendErrorMessage("Spell %u cannot be learnt using a command!", spell->Id); + handler->SendErrorMessage("Spell {} cannot be learnt using a command!", spell->Id); return false; } // Check if pet already has it if (pet->HasSpell(spell->Id)) { - handler->SendErrorMessage("Pet already has spell: %u", spell->Id); + handler->SendErrorMessage("Pet already has spell: {}", spell->Id); return false; } pet->learnSpell(spell->Id); - handler->PSendSysMessage("Pet has learned spell %u", spell->Id); + handler->PSendSysMessage("Pet has learned spell {}", spell->Id); return true; } diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp index f02f34d02..1434f2e6b 100644 --- a/src/server/scripts/Commands/cs_quest.cpp +++ b/src/server/scripts/Commands/cs_quest.cpp @@ -126,7 +126,7 @@ public: CharacterDatabase.Execute(stmt); } - handler->PSendSysMessage(LANG_COMMAND_QUEST_ADD, quest->GetTitle().c_str(), entry); + handler->PSendSysMessage(LANG_COMMAND_QUEST_ADD, quest->GetTitle(), entry); handler->SetSentErrorMessage(false); return true; } @@ -216,7 +216,7 @@ public: CharacterDatabase.CommitTransaction(trans); } - handler->PSendSysMessage(LANG_COMMAND_QUEST_REMOVED, quest->GetTitle().c_str(), entry); + handler->PSendSysMessage(LANG_COMMAND_QUEST_REMOVED, quest->GetTitle(), entry); handler->SetSentErrorMessage(false); return true; } @@ -482,7 +482,7 @@ public: CharacterDatabase.Execute(stmt); } - handler->PSendSysMessage(LANG_COMMAND_QUEST_COMPLETE, quest->GetTitle().c_str(), entry); + handler->PSendSysMessage(LANG_COMMAND_QUEST_COMPLETE, quest->GetTitle(), entry); handler->SetSentErrorMessage(false); return true; } @@ -727,7 +727,7 @@ public: CharacterDatabase.CommitTransaction(trans); } - handler->PSendSysMessage(LANG_COMMAND_QUEST_REWARDED, quest->GetTitle().c_str(), entry); + handler->PSendSysMessage(LANG_COMMAND_QUEST_REWARDED, quest->GetTitle(), entry); handler->SetSentErrorMessage(false); return true; } diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp index cdd32ada0..26bf8109d 100644 --- a/src/server/scripts/Commands/cs_reset.cpp +++ b/src/server/scripts/Commands/cs_reset.cpp @@ -196,7 +196,7 @@ public: ChatHandler(playerTarget->GetSession()).SendSysMessage(LANG_RESET_SPELLS); if (!handler->GetSession() || handler->GetSession()->GetPlayer() != playerTarget) - handler->PSendSysMessage(LANG_RESET_SPELLS_ONLINE, handler->GetNameLink(playerTarget).c_str()); + handler->PSendSysMessage(LANG_RESET_SPELLS_ONLINE, handler->GetNameLink(playerTarget)); } else { @@ -252,7 +252,7 @@ public: targetPlayer->SendTalentsInfoData(false); ChatHandler(targetPlayer->GetSession()).SendSysMessage(LANG_RESET_TALENTS); if (!handler->GetSession() || handler->GetSession()->GetPlayer() != targetPlayer) - handler->PSendSysMessage(LANG_RESET_TALENTS_ONLINE, handler->GetNameLink(targetPlayer).c_str()); + handler->PSendSysMessage(LANG_RESET_TALENTS_ONLINE, handler->GetNameLink(targetPlayer)); Pet* pet = targetPlayer->GetPet(); Pet::resetTalentsForAllPetsOf(targetPlayer, pet); @@ -268,7 +268,7 @@ public: CharacterDatabase.Execute(stmt); std::string nameLink = handler->playerLink(target->GetName()); - handler->PSendSysMessage(LANG_RESET_TALENTS_OFFLINE, nameLink.c_str()); + handler->PSendSysMessage(LANG_RESET_TALENTS_OFFLINE, nameLink); return true; } } @@ -320,7 +320,7 @@ public: else { int16 deletedItemsCount = ResetItemsEquipped(targetPlayer); - handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_EQUIPPED, deletedItemsCount, handler->GetNameLink(targetPlayer).c_str()); + handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_EQUIPPED, deletedItemsCount, handler->GetNameLink(targetPlayer)); } return true; @@ -337,7 +337,7 @@ public: else { int16 deletedItemsCount = ResetItemsInBags(targetPlayer); - handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_BAGS, deletedItemsCount, handler->GetNameLink(targetPlayer).c_str()); + handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_BAGS, deletedItemsCount, handler->GetNameLink(targetPlayer)); } return true; @@ -354,7 +354,7 @@ public: else { int16 deletedItemsCount = ResetItemsInKeyring(targetPlayer); - handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_KEYRING, deletedItemsCount, handler->GetNameLink(targetPlayer).c_str()); + handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_KEYRING, deletedItemsCount, handler->GetNameLink(targetPlayer)); } return true; @@ -371,7 +371,7 @@ public: else { int16 deletedItemsCount = ResetItemsInCurrenciesList(targetPlayer); - handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_CURRENCY, deletedItemsCount, handler->GetNameLink(targetPlayer).c_str()); + handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_CURRENCY, deletedItemsCount, handler->GetNameLink(targetPlayer)); } return true; @@ -388,7 +388,7 @@ public: else { int16 deletedItemsCount = ResetItemsInBank(targetPlayer); - handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_BANK, deletedItemsCount, handler->GetNameLink(targetPlayer).c_str()); + handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_BANK, deletedItemsCount, handler->GetNameLink(targetPlayer)); } return true; @@ -405,7 +405,7 @@ public: else { int16 deletedItemsCount = ResetItemsInVendorBuyBackTab(targetPlayer); - handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_BUYBACK, deletedItemsCount, handler->GetNameLink(targetPlayer).c_str()); + handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_BUYBACK, deletedItemsCount, handler->GetNameLink(targetPlayer)); } return true; @@ -430,7 +430,7 @@ public: int16 deletedItemsInCurrenciesListCount = ResetItemsInCurrenciesList(targetPlayer); int16 deletedItemsInVendorBuyBackTabCount = ResetItemsInVendorBuyBackTab(targetPlayer); - handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_ALL, handler->GetNameLink(targetPlayer).c_str(), + handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_ALL, handler->GetNameLink(targetPlayer), deletedItemsEquippedCount, deletedItemsInBagsCount, deletedItemsInBankCount, @@ -463,7 +463,7 @@ public: int16 deletedItemsStandardBagsCount = ResetItemsDeleteStandardBags(targetPlayer); int16 deletedItemsBankBagsCount = ResetItemsDeleteBankBags(targetPlayer); - handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_ALL_BAGS, handler->GetNameLink(targetPlayer).c_str(), + handler->PSendSysMessage(LANG_COMMAND_RESET_ITEMS_ALL_BAGS, handler->GetNameLink(targetPlayer), deletedItemsEquippedCount, deletedItemsInBagsCount, deletedItemsInBankCount, diff --git a/src/server/scripts/Commands/cs_send.cpp b/src/server/scripts/Commands/cs_send.cpp index cc2bd9c35..3645370ae 100644 --- a/src/server/scripts/Commands/cs_send.cpp +++ b/src/server/scripts/Commands/cs_send.cpp @@ -133,7 +133,7 @@ public: draft.SendMailTo(trans, MailReceiver(target->GetConnectedPlayer(), target->GetGUID().GetCounter()), sender); CharacterDatabase.CommitTransaction(trans); - handler->PSendSysMessage(LANG_MAIL_SENT, handler->playerLink(target->GetName()).c_str()); + handler->PSendSysMessage(LANG_MAIL_SENT, handler->playerLink(target->GetName())); return true; } @@ -158,7 +158,7 @@ public: draft.SendMailTo(trans, MailReceiver(target->GetConnectedPlayer(), target->GetGUID().GetCounter()), sender); CharacterDatabase.CommitTransaction(trans); - handler->PSendSysMessage(LANG_MAIL_SENT, handler->playerLink(target->GetName()).c_str()); + handler->PSendSysMessage(LANG_MAIL_SENT, handler->playerLink(target->GetName())); return true; } @@ -183,7 +183,7 @@ public: player->GetSession()->SendAreaTriggerMessage("|cffff0000[Message from administrator]:|r"); // Confirmation message - handler->PSendSysMessage(LANG_SENDMESSAGE, handler->playerLink(target->GetName()).c_str(), msg.c_str()); + handler->PSendSysMessage(LANG_SENDMESSAGE, handler->playerLink(target->GetName()), msg); return true; } @@ -211,7 +211,7 @@ public: CharacterDatabase.CommitTransaction(trans); - handler->PSendSysMessage(LANG_MAIL_SENT, handler->playerLink(target->GetName()).c_str()); + handler->PSendSysMessage(LANG_MAIL_SENT, handler->playerLink(target->GetName())); return true; } }; diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index 34a74babe..5a45f3245 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -123,22 +123,22 @@ public: if (dbPort) dbPortOutput = Acore::StringFormatFmt("Realmlist (Realm Id: {}) configured in port {}", realm.Id.Realm, dbPort); else - dbPortOutput = Acore::StringFormat("Realm Id: %u not found in `realmlist` table. Please check your setup", realm.Id.Realm); + dbPortOutput = Acore::StringFormatFmt("Realm Id: {} not found in `realmlist` table. Please check your setup", realm.Id.Realm); } HandleServerInfoCommand(handler); - handler->PSendSysMessage("Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, OpenSSL_version(OPENSSL_VERSION)); - handler->PSendSysMessage("Using Boost version: %i.%i.%i", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100); - handler->PSendSysMessage("Using CMake version: %s", GitRevision::GetCMakeVersion()); + handler->PSendSysMessage("Using SSL version: {} (library: {})", OPENSSL_VERSION_TEXT, OpenSSL_version(OPENSSL_VERSION)); + handler->PSendSysMessage("Using Boost version: {}.{}.{}", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100); + handler->PSendSysMessage("Using CMake version: {}", GitRevision::GetCMakeVersion()); - handler->PSendSysMessage("Using MySQL version: %u", MySQL::GetLibraryVersion()); - handler->PSendSysMessage("Found MySQL Executable: %s", GitRevision::GetMySQLExecutable()); + handler->PSendSysMessage("Using MySQL version: {}", MySQL::GetLibraryVersion()); + handler->PSendSysMessage("Found MySQL Executable: {}", GitRevision::GetMySQLExecutable()); - handler->PSendSysMessage("Compiled on: %s", GitRevision::GetHostOSVersion()); + handler->PSendSysMessage("Compiled on: {}", GitRevision::GetHostOSVersion()); handler->PSendSysMessage("Worldserver listening connections on port %" PRIu16, worldPort); - handler->PSendSysMessage("%s", dbPortOutput.c_str()); + handler->PSendSysMessage("{}", dbPortOutput); bool vmapIndoorCheck = sWorld->getBoolConfig(CONFIG_VMAP_INDOOR_CHECK); bool vmapLOSCheck = VMAP::VMapFactory::createOrGetVMapMgr()->isLineOfSightCalcEnabled(); @@ -151,7 +151,7 @@ public: subDirs.emplace_back("maps"); if (vmapIndoorCheck || vmapLOSCheck || vmapHeightCheck) { - handler->PSendSysMessage("VMAPs status: Enabled. LineOfSight: %i, getHeight: %i, indoorCheck: %i", vmapLOSCheck, vmapHeightCheck, vmapIndoorCheck); + handler->PSendSysMessage("VMAPs status: Enabled. LineOfSight: {}, getHeight: {}, indoorCheck: {}", vmapLOSCheck, vmapHeightCheck, vmapIndoorCheck); subDirs.emplace_back("vmaps"); } else @@ -172,7 +172,7 @@ public: if (!std::filesystem::exists(mapPath)) { - handler->PSendSysMessage("%s directory doesn't exist!. Using path: %s", subDir.c_str(), mapPath.generic_string().c_str()); + handler->PSendSysMessage("{} directory doesn't exist!. Using path: {}", subDir, mapPath.generic_string()); continue; } @@ -184,7 +184,7 @@ public: return val; }); - handler->PSendSysMessage(Acore::StringFormatFmt("{} directory located in {}. Total size: {} bytes", subDir.c_str(), mapPath.generic_string().c_str(), folderSize).c_str()); + handler->PSendSysMessage("{} directory located in {}. Total size: {} bytes", subDir, mapPath.generic_string(), folderSize); } LocaleConstant defaultLocale = sWorld->GetDefaultDbcLocale(); @@ -211,9 +211,9 @@ public: availableLocales += " "; } - handler->PSendSysMessage("Default DBC locale: %s.\nAll available DBC locales: %s", localeNames[defaultLocale], availableLocales.c_str()); + handler->PSendSysMessage("Default DBC locale: {}.\nAll available DBC locales: {}", localeNames[defaultLocale], availableLocales); - handler->PSendSysMessage("Using World DB: %s", sWorld->GetDBVersion()); + handler->PSendSysMessage("Using World DB: {}", sWorld->GetDBVersion()); std::string lldb = "No updates found!"; if (QueryResult resL = LoginDatabase.Query("SELECT name FROM updates ORDER BY name DESC LIMIT 1")) @@ -234,22 +234,22 @@ public: lwdb = fields[0].Get(); } - handler->PSendSysMessage("Latest LoginDatabase update: %s", lldb.c_str()); - handler->PSendSysMessage("Latest CharacterDatabase update: %s", lcdb.c_str()); - handler->PSendSysMessage("Latest WorldDatabase update: %s", lwdb.c_str()); + handler->PSendSysMessage("Latest LoginDatabase update: {}", lldb); + handler->PSendSysMessage("Latest CharacterDatabase update: {}", lcdb); + handler->PSendSysMessage("Latest WorldDatabase update: {}", lwdb); - handler->PSendSysMessage("LoginDatabase queue size: %zu", LoginDatabase.QueueSize()); - handler->PSendSysMessage("CharacterDatabase queue size: %zu", CharacterDatabase.QueueSize()); - handler->PSendSysMessage("WorldDatabase queue size: %zu", WorldDatabase.QueueSize()); + handler->PSendSysMessage("LoginDatabase queue size: {}", LoginDatabase.QueueSize()); + handler->PSendSysMessage("CharacterDatabase queue size: {}", CharacterDatabase.QueueSize()); + handler->PSendSysMessage("WorldDatabase queue size: {}", WorldDatabase.QueueSize()); if (Acore::Module::GetEnableModulesList().empty()) - handler->SendSysMessage("No modules are enabled"); + handler->PSendSysMessage("No modules are enabled"); else - handler->SendSysMessage("List of enabled modules:"); + handler->PSendSysMessage("List of enabled modules:"); for (auto const& modName : Acore::Module::GetEnableModulesList()) { - handler->SendSysMessage(Acore::StringFormatFmt("|- {}", modName)); + handler->PSendSysMessage("|- {}", modName); } return true; @@ -263,25 +263,25 @@ public: uint32 queuedSessionCount = sWorld->GetQueuedSessionCount(); uint32 connPeak = sWorld->GetMaxActiveSessionCount(); - handler->PSendSysMessage("%s", GitRevision::GetFullVersion()); + handler->PSendSysMessage("{}", GitRevision::GetFullVersion()); if (!queuedSessionCount) - handler->PSendSysMessage("Connected players: %u. Characters in world: %u.", activeSessionCount, playerCount); + handler->PSendSysMessage("Connected players: {}. Characters in world: {}.", activeSessionCount, playerCount); else - handler->PSendSysMessage("Connected players: %u. Characters in world: %u. Queue: %u.", activeSessionCount, playerCount, queuedSessionCount); + handler->PSendSysMessage("Connected players: {}. Characters in world: {}. Queue: {}.", activeSessionCount, playerCount, queuedSessionCount); - handler->PSendSysMessage("Connection peak: %u.", connPeak); - handler->PSendSysMessage(LANG_UPTIME, secsToTimeString(GameTime::GetUptime().count()).c_str()); - handler->PSendSysMessage("Update time diff: %ums. Last %d diffs summary:", sWorldUpdateTime.GetLastUpdateTime(), sWorldUpdateTime.GetDatasetSize()); - handler->PSendSysMessage("|- Mean: %ums", sWorldUpdateTime.GetAverageUpdateTime()); - handler->PSendSysMessage("|- Median: %ums", sWorldUpdateTime.GetPercentile(50)); - handler->PSendSysMessage("|- Percentiles (95, 99, max): %ums, %ums, %ums", + handler->PSendSysMessage("Connection peak: {}.", connPeak); + handler->PSendSysMessage(LANG_UPTIME, secsToTimeString(GameTime::GetUptime().count())); + handler->PSendSysMessage("Update time diff: {}ms. Last %d diffs summary:", sWorldUpdateTime.GetLastUpdateTime(), sWorldUpdateTime.GetDatasetSize()); + handler->PSendSysMessage("|- Mean: {}ms", sWorldUpdateTime.GetAverageUpdateTime()); + handler->PSendSysMessage("|- Median: {}ms", sWorldUpdateTime.GetPercentile(50)); + handler->PSendSysMessage("|- Percentiles (95, 99, max): {}ms, {}ms, {}ms", sWorldUpdateTime.GetPercentile(95), sWorldUpdateTime.GetPercentile(99), sWorldUpdateTime.GetPercentile(100)); //! Can't use sWorld->ShutdownMsg here in case of console command if (sWorld->IsShuttingDown()) - handler->PSendSysMessage(LANG_SHUTDOWN_TIMELEFT, secsToTimeString(sWorld->GetShutDownTimeLeft()).append(".").c_str()); + handler->PSendSysMessage(LANG_SHUTDOWN_TIMELEFT, secsToTimeString(sWorld->GetShutDownTimeLeft()).append(".")); return true; } diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp index 01cfd6f75..259fd89ad 100644 --- a/src/server/scripts/Commands/cs_tele.cpp +++ b/src/server/scripts/Commands/cs_tele.cpp @@ -134,9 +134,9 @@ public: return false; } - handler->PSendSysMessage(LANG_TELEPORTING_TO, chrNameLink.c_str(), "", locationName.c_str()); + handler->PSendSysMessage(LANG_TELEPORTING_TO, chrNameLink, "", locationName); if (handler->needReportToTarget(target)) - ChatHandler(target->GetSession()).PSendSysMessage(LANG_TELEPORTED_TO_BY, handler->GetNameLink().c_str()); + ChatHandler(target->GetSession()).PSendSysMessage(LANG_TELEPORTED_TO_BY, handler->GetNameLink()); // stop flight if need if (target->IsInFlight()) @@ -157,7 +157,7 @@ public: std::string nameLink = handler->playerLink(player.GetName()); - handler->PSendSysMessage(LANG_TELEPORTING_TO, nameLink.c_str(), handler->GetAcoreString(LANG_OFFLINE), locationName.c_str()); + handler->PSendSysMessage(LANG_TELEPORTING_TO, nameLink, handler->GetAcoreString(LANG_OFFLINE), locationName); Player::SavePositionInDB({ mapId, pos }, sMapMgr->GetZoneId(PHASEMASK_NORMAL, { mapId, pos }), player.GetGUID(), nullptr); } @@ -252,13 +252,13 @@ public: if (player->IsBeingTeleported()) { - handler->PSendSysMessage(LANG_IS_TELEPORTED, plNameLink.c_str()); + handler->PSendSysMessage(LANG_IS_TELEPORTED, plNameLink); continue; } - handler->PSendSysMessage(LANG_TELEPORTING_TO, plNameLink.c_str(), "", tele->name.c_str()); + handler->PSendSysMessage(LANG_TELEPORTING_TO, plNameLink.c_str(), "", tele->name); if (handler->needReportToTarget(player)) - ChatHandler(player->GetSession()).PSendSysMessage(LANG_TELEPORTED_TO_BY, nameLink.c_str()); + ChatHandler(player->GetSession()).PSendSysMessage(LANG_TELEPORTED_TO_BY, nameLink); // stop flight if need if (target->IsInFlight()) diff --git a/src/server/scripts/Commands/cs_ticket.cpp b/src/server/scripts/Commands/cs_ticket.cpp index 2eb69c7b3..bef6f6f13 100644 --- a/src/server/scripts/Commands/cs_ticket.cpp +++ b/src/server/scripts/Commands/cs_ticket.cpp @@ -109,7 +109,7 @@ public: Player* player = handler->GetSession() ? handler->GetSession()->GetPlayer() : nullptr; if (player && ticket->IsAssignedNotTo(player->GetGUID())) { - handler->PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->GetId(), target.c_str()); + handler->PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->GetId(), target); return true; } @@ -469,7 +469,7 @@ public: std::string msg = ticket->FormatMessageString(*handler, nullptr, nullptr, nullptr, nullptr); msg += handler->PGetParseString(LANG_COMMAND_TICKETRESPONSEAPPENDED, response); - handler->PSendSysMessage(msg.c_str()); + handler->PSendSysMessage(msg); return true; } @@ -526,7 +526,7 @@ public: std::string msg = ticket->FormatMessageString(*handler, nullptr, nullptr, nullptr, nullptr); msg += handler->PGetParseString(LANG_COMMAND_TICKETLISTRESPONSE, ticket->GetResponse()); - handler->PSendSysMessage(msg.c_str()); + handler->PSendSysMessage(msg); return true; } }; diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index 2200d5683..2d5b9b23e 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -101,7 +101,7 @@ public: uint32 maxpathid = result->Fetch()->Get(); pathid = maxpathid + 1; - handler->PSendSysMessage("%s%s|r", "|cff00ff00", "New path started."); + handler->PSendSysMessage("{}{}|r", "|cff00ff00", "New path started."); } } else @@ -112,7 +112,7 @@ public: if (!pathid) { - handler->PSendSysMessage("%s%s|r", "|cffff33ff", "Current creature haven't loaded path."); + handler->PSendSysMessage("{}{}|r", "|cffff33ff", "Current creature haven't loaded path."); return true; } @@ -136,7 +136,7 @@ public: WorldDatabase.Execute(stmt); - handler->PSendSysMessage("%s%s%u%s%u%s|r", "|cff00ff00", "PathID: |r|cff00ffff", pathid, "|r|cff00ff00: Waypoint |r|cff00ffff", point + 1, "|r|cff00ff00 created. "); + handler->PSendSysMessage("{}{}{}{}{}{}|r", "|cff00ff00", "PathID: |r|cff00ffff", pathid, "|r|cff00ff00: Waypoint |r|cff00ffff", point + 1, "|r|cff00ff00 created. "); return true; } // HandleWpAddCommand @@ -167,7 +167,7 @@ public: if (target->GetEntry() == 1) { - handler->SendErrorMessage("%s%s|r", "|cffff33ff", "You want to load path to a waypoint? Aren't you?"); + handler->SendErrorMessage("{}{}|r", "|cffff33ff", "You want to load path to a waypoint? Aren't you?"); return false; } @@ -175,7 +175,7 @@ public: if (!pathid) { - handler->PSendSysMessage("%s%s|r", "|cffff33ff", "No valid path number provided."); + handler->PSendSysMessage("{}{}|r", "|cffff33ff", "No valid path number provided."); return true; } @@ -229,7 +229,7 @@ public: if (!id) return false; - handler->PSendSysMessage("%s%s|r|cff00ffff%u|r", "|cff00ff00", "Loading Path: ", id); + handler->PSendSysMessage("{}{}|r|cff00ffff{}|r", "|cff00ff00", "Loading Path: ", id); sWaypointMgr->ReloadPath(id); return true; } @@ -240,7 +240,7 @@ public: if (!target) { - handler->PSendSysMessage("%s%s|r", "|cff33ffff", "You must select target."); + handler->PSendSysMessage("{}{}|r", "|cff33ffff", "You must select target."); return true; } @@ -270,7 +270,7 @@ public: target->Say("Path unloaded.", LANG_UNIVERSAL); return true; } - handler->PSendSysMessage("%s%s|r", "|cffff33ff", "Target have no loaded path."); + handler->PSendSysMessage("{}{}|r", "|cffff33ff", "Target have no loaded path."); } return true; } @@ -309,10 +309,10 @@ public: WorldDatabase.Execute(stmt); - handler->PSendSysMessage("%s%s%u|r", "|cff00ff00", "Wp Event: New waypoint event added: ", id); + handler->PSendSysMessage("{}{}{}|r", "|cff00ff00", "Wp Event: New waypoint event added: ", id); } else - handler->PSendSysMessage("|cff00ff00Wp Event: You have choosed an existing waypoint script guid: %u|r", id); + handler->PSendSysMessage("|cff00ff00Wp Event: You have choosed an existing waypoint script guid: {}|r", id); } else { @@ -328,7 +328,7 @@ public: WorldDatabase.Execute(stmt); - handler->PSendSysMessage("%s%s%u|r", "|cff00ff00", "Wp Event: New waypoint event added: |r|cff00ffff", id + 1); + handler->PSendSysMessage("{}{}{}|r", "|cff00ff00", "Wp Event: New waypoint event added: |r|cff00ffff", id + 1); } return true; @@ -338,7 +338,7 @@ public: { if (!arg_id) { - handler->PSendSysMessage("%s%s|r", "|cff33ffff", "Wp Event: You must provide waypoint script id."); + handler->PSendSysMessage("{}{}|r", "|cff33ffff", "Wp Event: You must provide waypoint script id."); return true; } @@ -354,7 +354,7 @@ public: if (!result) { - handler->PSendSysMessage("%s%s%u|r", "|cff33ffff", "Wp Event: No waypoint scripts found on id: ", id); + handler->PSendSysMessage("{}{}{}|r", "|cff33ffff", "Wp Event: No waypoint scripts found on id: ", id); return true; } @@ -374,7 +374,7 @@ public: a10 = fields[8].Get(); a11 = fields[9].Get(); - handler->PSendSysMessage("|cffff33ffid:|r|cff00ffff %u|r|cff00ff00, guid: |r|cff00ffff%u|r|cff00ff00, delay: |r|cff00ffff%u|r|cff00ff00, command: |r|cff00ffff%u|r|cff00ff00, datalong: |r|cff00ffff%u|r|cff00ff00, datalong2: |r|cff00ffff%u|r|cff00ff00, datatext: |r|cff00ffff%s|r|cff00ff00, posx: |r|cff00ffff%f|r|cff00ff00, posy: |r|cff00ffff%f|r|cff00ff00, posz: |r|cff00ffff%f|r|cff00ff00, orientation: |r|cff00ffff%f|r", id, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); + handler->PSendSysMessage("|cffff33ffid:|r|cff00ffff {}|r|cff00ff00, guid: |r|cff00ffff{}|r|cff00ff00, delay: |r|cff00ffff{}|r|cff00ff00, command: |r|cff00ffff{}|r|cff00ff00, datalong: |r|cff00ffff{}|r|cff00ff00, datalong2: |r|cff00ffff{}|r|cff00ff00, datatext: |r|cff00ffff{}|r|cff00ff00, posx: |r|cff00ffff{}|r|cff00ff00, posy: |r|cff00ffff{}|r|cff00ff00, posz: |r|cff00ffff{}|r|cff00ff00, orientation: |r|cff00ffff{}|r", id, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } while (result->NextRow()); } @@ -402,10 +402,10 @@ public: WorldDatabase.Execute(stmt); - handler->PSendSysMessage("%s%s%u|r", "|cff00ff00", "Wp Event: Waypoint script removed: ", id); + handler->PSendSysMessage("{}{}{}|r", "|cff00ff00", "Wp Event: Waypoint script removed: ", id); } else - handler->PSendSysMessage("|cffff33ffWp Event: ERROR: you have selected a non existing script: %u|r", id); + handler->PSendSysMessage("|cffff33ffWp Event: ERROR: you have selected a non existing script: {}|r", id); return true; } @@ -457,7 +457,7 @@ public: if (arg_str_2 == "setid") { uint32 newid = atoi(arg_3); - handler->PSendSysMessage("%s%s|r|cff00ffff%u|r|cff00ff00%s|r|cff00ffff%u|r", "|cff00ff00", "Wp Event: Wypoint scipt guid: ", newid, " id changed: ", id); + handler->PSendSysMessage("{}{}|r|cff00ffff{}|r|cff00ff00{}|r|cff00ffff{}|r", "|cff00ff00", "Wp Event: Wypoint scipt guid: ", newid, " id changed: ", id); WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_WAYPOINT_SCRIPT_ID); @@ -489,7 +489,7 @@ public: WorldDatabase.Execute(stmt); - handler->PSendSysMessage("|cff00ff00Waypoint script:|r|cff00ffff %u|r|cff00ff00 position_x updated.|r", id); + handler->PSendSysMessage("|cff00ff00Waypoint script:|r|cff00ffff {}|r|cff00ff00 position_x updated.|r", id); return true; } else if (arg_str_2 == "posy") @@ -501,7 +501,7 @@ public: WorldDatabase.Execute(stmt); - handler->PSendSysMessage("|cff00ff00Waypoint script: %u position_y updated.|r", id); + handler->PSendSysMessage("|cff00ff00Waypoint script: {} position_y updated.|r", id); return true; } else if (arg_str_2 == "posz") @@ -513,7 +513,7 @@ public: WorldDatabase.Execute(stmt); - handler->PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 position_z updated.|r", id); + handler->PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff{}|r|cff00ff00 position_z updated.|r", id); return true; } else if (arg_str_2 == "orientation") @@ -525,14 +525,14 @@ public: WorldDatabase.Execute(stmt); - handler->PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 orientation updated.|r", id); + handler->PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff{}|r|cff00ff00 orientation updated.|r", id); return true; } else if (arg_str_2 == "dataint") { WorldDatabase.Execute("UPDATE waypoint_scripts SET {}='{}' WHERE guid='{}'", arg_2, atoi(arg_3), id); // Query can't be a prepared statement - handler->PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 dataint updated.|r", id); + handler->PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff{}|r|cff00ff00 dataint updated.|r", id); return true; } else @@ -542,7 +542,7 @@ public: WorldDatabase.Execute("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."); + handler->PSendSysMessage("{}{}|r|cff00ffff{}:|r|cff00ff00 {} {}|r", "|cff00ff00", "Waypoint script:", id, arg_2, "updated."); } return true; } @@ -642,7 +642,7 @@ public: if (show == "del") { - handler->PSendSysMessage("|cff00ff00DEBUG: wp modify del, PathID: |r|cff00ffff%u|r", pathid); + handler->PSendSysMessage("|cff00ff00DEBUG: wp modify del, PathID: |r|cff00ffff{}|r", pathid); if (wpSpawnId != 0) if (Creature* wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(target->GetGUID())) @@ -670,7 +670,7 @@ public: if (show == "move") { - handler->PSendSysMessage("|cff00ff00DEBUG: wp move, PathID: |r|cff00ffff%u|r", pathid); + handler->PSendSysMessage("|cff00ff00DEBUG: wp move, PathID: |r|cff00ffff{}|r", pathid); Player* chr = handler->GetSession()->GetPlayer(); Map* map = chr->GetMap(); @@ -787,7 +787,7 @@ public: std::string show = show_str; - //handler->PSendSysMessage("wpshow - show: %s", show); + //handler->PSendSysMessage("wpshow - show: {}", show); // Show info for the selected waypoint if (show == "info") @@ -822,11 +822,11 @@ public: uint32 ev_id = fields[4].Get(); uint32 ev_chance = fields[5].Get(); - handler->PSendSysMessage("|cff00ff00Show info: for current point: |r|cff00ffff%u|r|cff00ff00, Path ID: |r|cff00ffff%u|r", point, pathid); - handler->PSendSysMessage("|cff00ff00Show info: delay: |r|cff00ffff%u|r", delay); - handler->PSendSysMessage("|cff00ff00Show info: Move flag: |r|cff00ffff%u|r", flag); - handler->PSendSysMessage("|cff00ff00Show info: Waypoint event: |r|cff00ffff%u|r", ev_id); - handler->PSendSysMessage("|cff00ff00Show info: Event chance: |r|cff00ffff%u|r", ev_chance); + handler->PSendSysMessage("|cff00ff00Show info: for current point: |r|cff00ffff{}|r|cff00ff00, Path ID: |r|cff00ffff{}|r", point, pathid); + handler->PSendSysMessage("|cff00ff00Show info: delay: |r|cff00ffff{}|r", delay); + handler->PSendSysMessage("|cff00ff00Show info: Move flag: |r|cff00ffff{}|r", flag); + handler->PSendSysMessage("|cff00ff00Show info: Waypoint event: |r|cff00ffff{}|r", ev_id); + handler->PSendSysMessage("|cff00ff00Show info: Event chance: |r|cff00ffff{}|r", ev_chance); } while (result->NextRow()); return true; @@ -846,7 +846,7 @@ public: return false; } - handler->PSendSysMessage("|cff00ff00DEBUG: wp on, PathID: |cff00ffff%u|r", pathid); + handler->PSendSysMessage("|cff00ff00DEBUG: wp on, PathID: |cff00ffff{}|r", pathid); // Delete all visuals for this NPC stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_WPGUID_BY_ID); @@ -943,7 +943,7 @@ public: if (show == "first") { - handler->PSendSysMessage("|cff00ff00DEBUG: wp first, GUID: %u|r", pathid); + handler->PSendSysMessage("|cff00ff00DEBUG: wp first, GUID: {}|r", pathid); WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_POS_FIRST_BY_ID); stmt->SetData(0, pathid); @@ -992,7 +992,7 @@ public: if (show == "last") { - handler->PSendSysMessage("|cff00ff00DEBUG: wp last, PathID: |r|cff00ffff%u|r", pathid); + handler->PSendSysMessage("|cff00ff00DEBUG: wp last, PathID: |r|cff00ffff{}|r", pathid); WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_WAYPOINT_DATA_POS_LAST_BY_ID); stmt->SetData(0, pathid);