Core/Warden: Add Lua checks to Warden (PR #25286)

(cherry picked from commit 0531463a3c)
This commit is contained in:
Treeston
2020-08-21 01:19:28 +02:00
committed by Shauren
parent b5d0a94ead
commit c6582096ab
8 changed files with 100 additions and 33 deletions

View File

@@ -39,6 +39,7 @@
#include "ScriptMgr.h"
#include "SpellAuraEffects.h"
#include "Util.h"
#include "Warden.h"
#include "World.h"
#include "WorldPacket.h"
#include <algorithm>
@@ -217,7 +218,6 @@ void WorldSession::HandleChatMessage(ChatMsg type, Language lang, std::string ms
if (msg.size() > 255)
return;
if (msg.empty())
return;
@@ -466,6 +466,13 @@ void WorldSession::HandleChatAddonMessage(ChatMsg type, std::string prefix, std:
if (prefix.empty() || prefix.length() > 16)
return;
// Our Warden module also uses SendAddonMessage as a way to communicate Lua check results to the server, see if this is that
if (type == CHAT_MSG_GUILD)
{
if (_warden && _warden->ProcessLuaCheckResponse(text))
return;
}
// Disabled addon channel?
if (!sWorld->getBoolConfig(CONFIG_ADDON_CHANNEL))
return;