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:
parent
4c3eab650c
commit
72d060f097
6 changed files with 49 additions and 4 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue