aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2020-08-30 02:50:25 +0200
committerShauren <shauren.trinity@gmail.com>2022-02-04 21:21:17 +0100
commit45e9e943115badd1a10ce18dc660408564e4aac9 (patch)
tree3e573ba9d5da2c8eada7c71f923b5fcdc814459c /src/server/scripts/Commands
parent175fb7056b32d5455b59d83cc0f46fc55d905307 (diff)
Core/ChatCommands: C++17 cleanup (again) (PR #25323)
(cherry picked from commit 2f7d2ef3e979ecd0536f3a3713e56c8e59652a47)
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp4
-rw-r--r--src/server/scripts/Commands/cs_message.cpp38
2 files changed, 20 insertions, 22 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index 1e9c07ca554..ce9d0952f73 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -1681,7 +1681,7 @@ public:
return true;
};
- static bool HandleDebugOutOfBounds([[maybe_unused]] ChatHandler* handler, CommandArgs* /*args*/)
+ static bool HandleDebugOutOfBounds([[maybe_unused]] ChatHandler* handler)
{
#ifdef ASAN
uint8 stack_array[10] = {};
@@ -1838,7 +1838,7 @@ public:
return true;
}
- static bool HandleDebugDummyCommand(ChatHandler* handler, CommandArgs* /*args*/)
+ static bool HandleDebugDummyCommand(ChatHandler* handler)
{
handler->SendSysMessage("This command does nothing right now. Edit your local core (cs_debug.cpp) to make it do whatever you need for testing.");
return true;
diff --git a/src/server/scripts/Commands/cs_message.cpp b/src/server/scripts/Commands/cs_message.cpp
index 8fbf85fda83..157961594ab 100644
--- a/src/server/scripts/Commands/cs_message.cpp
+++ b/src/server/scripts/Commands/cs_message.cpp
@@ -130,62 +130,60 @@ public:
return true;
}
- static bool HandleNameAnnounceCommand(ChatHandler* handler, CommandArgs* args)
+ static bool HandleNameAnnounceCommand(ChatHandler* handler, Tail message)
{
- if (!*args)
+ if (message.empty())
return false;
std::string name("Console");
if (WorldSession* session = handler->GetSession())
name = session->GetPlayer()->GetName();
- sWorld->SendWorldText(LANG_ANNOUNCE_COLOR, name.c_str(), args->GetFullArgs());
+ sWorld->SendWorldText(LANG_ANNOUNCE_COLOR, name.c_str(), message.data());
return true;
}
- static bool HandleGMNameAnnounceCommand(ChatHandler* handler, CommandArgs* args)
+ static bool HandleGMNameAnnounceCommand(ChatHandler* handler, Tail message)
{
- if (!*args)
+ if (message.empty())
return false;
std::string name("Console");
if (WorldSession* session = handler->GetSession())
name = session->GetPlayer()->GetName();
- sWorld->SendGMText(LANG_GM_ANNOUNCE_COLOR, name.c_str(), args->GetFullArgs());
+ sWorld->SendGMText(LANG_GM_ANNOUNCE_COLOR, name.c_str(), message.data());
return true;
}
// global announce
- static bool HandleAnnounceCommand(ChatHandler* handler, char const* args)
+ static bool HandleAnnounceCommand(ChatHandler* handler, Tail message)
{
- if (!*args)
+ if (message.empty())
return false;
- std::string str = handler->PGetParseString(LANG_SYSTEMMESSAGE, args);
-
- sWorld->SendServerMessage(SERVER_MSG_STRING, str);
+ sWorld->SendServerMessage(SERVER_MSG_STRING, Trinity::StringFormat(handler->GetTrinityString(LANG_SYSTEMMESSAGE), message.data()).c_str());
return true;
}
// announce to logged in GMs
- static bool HandleGMAnnounceCommand(ChatHandler* /*handler*/, CommandArgs* args)
+ static bool HandleGMAnnounceCommand(ChatHandler* /*handler*/, Tail message)
{
- if (!*args)
+ if (message.empty())
return false;
- sWorld->SendGMText(LANG_GM_BROADCAST, args->GetFullArgs());
+ sWorld->SendGMText(LANG_GM_BROADCAST, message.data());
return true;
}
// send on-screen notification to players
- static bool HandleNotifyCommand(ChatHandler* handler, CommandArgs* args)
+ static bool HandleNotifyCommand(ChatHandler* handler, Tail message)
{
- if (!*args)
+ if (message.empty())
return false;
std::string str = handler->GetTrinityString(LANG_GLOBAL_NOTIFY);
- str += args->GetFullArgs();
+ str += message;
sWorld->SendGlobalMessage(WorldPackets::Chat::PrintNotification(str).Write());
@@ -193,13 +191,13 @@ public:
}
// send on-screen notification to GMs
- static bool HandleGMNotifyCommand(ChatHandler* handler, CommandArgs* args)
+ static bool HandleGMNotifyCommand(ChatHandler* handler, Tail message)
{
- if (!*args)
+ if (message.empty())
return false;
std::string str = handler->GetTrinityString(LANG_GM_NOTIFY);
- str += args->GetFullArgs();
+ str += message;
sWorld->SendGlobalGMMessage(WorldPackets::Chat::PrintNotification(str).Write());