Implement threat threshold validation

This commit is contained in:
2024-10-14 15:57:13 +02:00
parent 34c76b7087
commit 8be102a6be

View File

@@ -38,6 +38,14 @@ Message = {
---@param stinky Stinky
QueueNotifyGuild = function(stinky)
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
local message = Message.new(stinky:FormMessage(), nil, "GUILD")
if aura_env.config.debug then DevTools_Dump(message) end
@@ -46,6 +54,14 @@ Message = {
---@param stinky Stinky
QueueNotifyWhisper = function(stinky)
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
local text = stinky:FormMessage()
for _, to in ipairs(toNotify) do
@@ -58,6 +74,14 @@ Message = {
---@param stinky Stinky
QueueNotifyAddonGuild = function(stinky)
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
local message = Message.new(stinky:FormAddonMessage(), nil, "GUILD", true)
if aura_env.config.debug then DevTools_Dump(message) end
@@ -66,6 +90,14 @@ Message = {
---@param stinky Stinky
QueueNotifyAddonWhisper = function(stinky)
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
local text = stinky:FormMessage()
for _, to in ipairs(toNotify) do
@@ -82,7 +114,8 @@ Message = {
QueueNotifyKilledAddonGuild = function(faction, source, destination, spellName)
if not aura_env.config.killNotifyAddonGuild then return 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)
if aura_env.config.debug then DevTools_Dump(message) end
table.insert(aura_env.messageQueue, message)
@@ -94,7 +127,8 @@ Message = {
QueueNotifyKilledAddonWhisper = function(faction, source, destination, spellName)
if not aura_env.config.killNotifyAddonWhisper then return 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
local message = Message.new(text, to, "WHISPER", true)
if aura_env.config.debug then DevTools_Dump(message) end