Core/Chat: Provide a fully-formed protocol for addons to interact with GM commands

Send success/fail state, allow interleaving, and indicate end of output. Add framework for supporting non-human-readable output in commands.
This commit is contained in:
Aokromes
2017-07-29 10:51:58 +02:00
parent 05b21ab9e1
commit 8583263896
3 changed files with 162 additions and 27 deletions

View File

@@ -272,11 +272,15 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
if (msg.empty())
return;
if (ChatHandler(this).ParseCommands(msg.c_str()))
return;
if (lang == LANG_ADDON)
{
if (AddonChannelCommandHandler(this).ParseCommands(msg.c_str()))
return;
}
if (lang != LANG_ADDON)
{
if (ChatHandler(this).ParseCommands(msg.c_str()))
return;
// Strip invisible characters for non-addon messages
if (sWorld->getBoolConfig(CONFIG_CHAT_FAKE_MESSAGE_PREVENTING))
stripLineInvisibleChars(msg);