From 86dbeae59b5bea129d5b87e0645f12593ffb404c Mon Sep 17 00:00:00 2001 From: icyblade Date: Fri, 7 Feb 2020 23:48:58 +0800 Subject: [PATCH] add GlobalIgnore support --- Modules/Antispam/ContentProcessors/RMT.lua | 1 + Modules/Antispam/HeaderProcessors/Sender.lua | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Modules/Antispam/ContentProcessors/RMT.lua b/Modules/Antispam/ContentProcessors/RMT.lua index 4126582..fcd13b5 100644 --- a/Modules/Antispam/ContentProcessors/RMT.lua +++ b/Modules/Antispam/ContentProcessors/RMT.lua @@ -23,6 +23,7 @@ local Patterns = { '经验宝宝', '经验BB', '带血色', '带监狱', -- Battlegrounds '国家队', '1351', '15998', '崇拜', '战歌', '荣誉', + '奥山', '澳山', -- Quests '史诗弓', '上古守护者的长弓', '大水任务', -- Others diff --git a/Modules/Antispam/HeaderProcessors/Sender.lua b/Modules/Antispam/HeaderProcessors/Sender.lua index c85529e..154b9d6 100644 --- a/Modules/Antispam/HeaderProcessors/Sender.lua +++ b/Modules/Antispam/HeaderProcessors/Sender.lua @@ -9,6 +9,25 @@ local function SenderProcessor(payload) return end end + + -- Global Ignore + local name = payload.PlayerName + if (string.find(payload.PlayerName, '-', 1, true) ~= nil) then + name = string.sub(payload.PlayerName, 1, string.find(payload.PlayerName, '-', 1, true) - 1) + end + if (GlobalIgnoreDB ~= nil) then + for index, fullName in pairs(GlobalIgnoreDB.ignoreList) do + local blacklistName = string.sub(fullName, 1, string.find(fullName, '-', 1, true) - 1) + if ( + GlobalIgnoreDB.typeList[index] == 'player' and + GlobalIgnoreDB.factionList[index] == 'Alliance' and + name == blacklistName + ) then + payload.Label = 'SPAM' + return + end + end + end end HeaderProcessors.SenderProcessor = SenderProcessor