Implement threat threshold validation
This commit is contained in:
@@ -38,6 +38,14 @@ Message = {
|
|||||||
---@param stinky Stinky
|
---@param stinky Stinky
|
||||||
QueueNotifyGuild = function(stinky)
|
QueueNotifyGuild = function(stinky)
|
||||||
if not aura_env.config.stinkyNotifyGuild then return end
|
if not aura_env.config.stinkyNotifyGuild then return end
|
||||||
|
if stinky.threat < aura_env.config.threatThreshold then
|
||||||
|
if aura_env.config.debug then
|
||||||
|
print(string.format("Skipping notify guild due to low threat (%d < %d)",
|
||||||
|
stinky.threat, aura_env.config.threatThreshold))
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if aura_env.config.debug then print("Queueing notify guild:") end
|
if aura_env.config.debug then print("Queueing notify guild:") end
|
||||||
local message = Message.new(stinky:FormMessage(), nil, "GUILD")
|
local message = Message.new(stinky:FormMessage(), nil, "GUILD")
|
||||||
if aura_env.config.debug then DevTools_Dump(message) end
|
if aura_env.config.debug then DevTools_Dump(message) end
|
||||||
@@ -46,6 +54,14 @@ Message = {
|
|||||||
---@param stinky Stinky
|
---@param stinky Stinky
|
||||||
QueueNotifyWhisper = function(stinky)
|
QueueNotifyWhisper = function(stinky)
|
||||||
if not aura_env.config.stinkyNotifyWhisper then return end
|
if not aura_env.config.stinkyNotifyWhisper then return end
|
||||||
|
if stinky.threat < aura_env.config.threatThreshold then
|
||||||
|
if aura_env.config.debug then
|
||||||
|
print(string.format("Skipping notify whisper due to low threat (%d < %d)",
|
||||||
|
stinky.threat, aura_env.config.threatThreshold))
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if aura_env.config.debug then print("Queueing notify whisper:") end
|
if aura_env.config.debug then print("Queueing notify whisper:") end
|
||||||
local text = stinky:FormMessage()
|
local text = stinky:FormMessage()
|
||||||
for _, to in ipairs(toNotify) do
|
for _, to in ipairs(toNotify) do
|
||||||
@@ -58,6 +74,14 @@ Message = {
|
|||||||
---@param stinky Stinky
|
---@param stinky Stinky
|
||||||
QueueNotifyAddonGuild = function(stinky)
|
QueueNotifyAddonGuild = function(stinky)
|
||||||
if not aura_env.config.stinkyNotifyAddonGuild then return end
|
if not aura_env.config.stinkyNotifyAddonGuild then return end
|
||||||
|
if stinky.threat < aura_env.config.threatThreshold then
|
||||||
|
if aura_env.config.debug then
|
||||||
|
print(string.format("Skipping notify addon guild due to low threat (%d < %d)",
|
||||||
|
stinky.threat, aura_env.config.threatThreshold))
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if aura_env.config.debug then print("Queueing notify addon guild:") end
|
if aura_env.config.debug then print("Queueing notify addon guild:") end
|
||||||
local message = Message.new(stinky:FormAddonMessage(), nil, "GUILD", true)
|
local message = Message.new(stinky:FormAddonMessage(), nil, "GUILD", true)
|
||||||
if aura_env.config.debug then DevTools_Dump(message) end
|
if aura_env.config.debug then DevTools_Dump(message) end
|
||||||
@@ -66,6 +90,14 @@ Message = {
|
|||||||
---@param stinky Stinky
|
---@param stinky Stinky
|
||||||
QueueNotifyAddonWhisper = function(stinky)
|
QueueNotifyAddonWhisper = function(stinky)
|
||||||
if not aura_env.config.stinkyNotifyAddonWhisper then return end
|
if not aura_env.config.stinkyNotifyAddonWhisper then return end
|
||||||
|
if stinky.threat < aura_env.config.threatThreshold then
|
||||||
|
if aura_env.config.debug then
|
||||||
|
print(string.format("Skipping notify addon whisper due to low threat (%d < %d)",
|
||||||
|
stinky.threat, aura_env.config.threatThreshold))
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if aura_env.config.debug then print("Queueing notify addon whisper:") end
|
if aura_env.config.debug then print("Queueing notify addon whisper:") end
|
||||||
local text = stinky:FormMessage()
|
local text = stinky:FormMessage()
|
||||||
for _, to in ipairs(toNotify) do
|
for _, to in ipairs(toNotify) do
|
||||||
@@ -82,7 +114,8 @@ Message = {
|
|||||||
QueueNotifyKilledAddonGuild = function(faction, source, destination, spellName)
|
QueueNotifyKilledAddonGuild = function(faction, source, destination, spellName)
|
||||||
if not aura_env.config.killNotifyAddonGuild then return end
|
if not aura_env.config.killNotifyAddonGuild then return end
|
||||||
if aura_env.config.debug then print("Queueing notify addon guild:") end
|
if aura_env.config.debug then print("Queueing notify addon guild:") end
|
||||||
local text = string.format("%s%s%s%s%s%s%s", faction, aura_env.separator, source, aura_env.separator, destination, aura_env.separator, spellName)
|
local text = string.format("%s%s%s%s%s%s%s", faction, aura_env.separator, source, aura_env.separator, destination,
|
||||||
|
aura_env.separator, spellName)
|
||||||
local message = Message.new(text, nil, "GUILD", true)
|
local message = Message.new(text, nil, "GUILD", true)
|
||||||
if aura_env.config.debug then DevTools_Dump(message) end
|
if aura_env.config.debug then DevTools_Dump(message) end
|
||||||
table.insert(aura_env.messageQueue, message)
|
table.insert(aura_env.messageQueue, message)
|
||||||
@@ -94,7 +127,8 @@ Message = {
|
|||||||
QueueNotifyKilledAddonWhisper = function(faction, source, destination, spellName)
|
QueueNotifyKilledAddonWhisper = function(faction, source, destination, spellName)
|
||||||
if not aura_env.config.killNotifyAddonWhisper then return end
|
if not aura_env.config.killNotifyAddonWhisper then return end
|
||||||
if aura_env.config.debug then print("Queueing notify addon whisper:") end
|
if aura_env.config.debug then print("Queueing notify addon whisper:") end
|
||||||
local text = string.format("%s%s%s%s%s%s%s", faction, aura_env.separator, source, aura_env.separator, destination, aura_env.separator, spellName)
|
local text = string.format("%s%s%s%s%s%s%s", faction, aura_env.separator, source, aura_env.separator, destination,
|
||||||
|
aura_env.separator, spellName)
|
||||||
for _, to in ipairs(toNotify) do
|
for _, to in ipairs(toNotify) do
|
||||||
local message = Message.new(text, to, "WHISPER", true)
|
local message = Message.new(text, to, "WHISPER", true)
|
||||||
if aura_env.config.debug then DevTools_Dump(message) end
|
if aura_env.config.debug then DevTools_Dump(message) end
|
||||||
|
Reference in New Issue
Block a user