Skip to content

Commit

Permalink
add GlobalIgnore support
Browse files Browse the repository at this point in the history
  • Loading branch information
icyblade committed Feb 7, 2020
1 parent 2c18fa5 commit 86dbeae
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions Modules/Antispam/ContentProcessors/RMT.lua
Expand Up @@ -23,6 +23,7 @@ local Patterns = {
'经验宝宝', '经验BB', '带血色', '带监狱',
-- Battlegrounds
'国家队', '1351', '15998', '崇拜', '战歌', '荣誉',
'奥山', '澳山',
-- Quests
'史诗弓', '上古守护者的长弓', '大水任务',
-- Others
Expand Down
19 changes: 19 additions & 0 deletions Modules/Antispam/HeaderProcessors/Sender.lua
Expand Up @@ -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

Expand Down

0 comments on commit 86dbeae

Please sign in to comment.