mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 17:49:10 +00:00
feat(Core/Network): Per-user togglable packet logging (#23254)
Co-authored-by: Ryan Turner <16946913+TheSCREWEDSoftware@users.noreply.github.com>
This commit is contained in:
@@ -194,7 +194,8 @@ public:
|
||||
{ "mailbox", HandleMailBoxCommand, SEC_MODERATOR, Console::No },
|
||||
{ "string", HandleStringCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "opendoor", HandleOpenDoorCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "bm", HandleBMCommand, SEC_GAMEMASTER, Console::No }
|
||||
{ "bm", HandleBMCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "packetlog", HandlePacketLog, SEC_GAMEMASTER, Console::No }
|
||||
};
|
||||
|
||||
return commandTable;
|
||||
@@ -3108,6 +3109,33 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool HandlePacketLog(ChatHandler* handler, Optional<bool> enableArg)
|
||||
{
|
||||
WorldSession* session = handler->GetSession();
|
||||
|
||||
if (!session)
|
||||
return false;
|
||||
|
||||
if (enableArg)
|
||||
{
|
||||
if (*enableArg)
|
||||
{
|
||||
session->SetPacketLogging(true);
|
||||
handler->SendNotification(LANG_ON);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
session->SetPacketLogging(false);
|
||||
handler->SendNotification(LANG_OFF);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
handler->SendErrorMessage(LANG_USE_BOL);
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
void AddSC_misc_commandscript()
|
||||
|
||||
Reference in New Issue
Block a user