mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/ChatCommands: C++17 cleanup (again) (PR #25323)
(cherry picked from commit 2f7d2ef3e9)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user