Add debug flag
This commit is contained in:
@@ -3,14 +3,13 @@ function()
|
||||
---@type Message
|
||||
local message = aura_env.messageQueue[1]
|
||||
if message == nil then return end
|
||||
|
||||
table.remove(aura_env.messageQueue, 1)
|
||||
print(string.format("Processing message; %d in queue", #aura_env.messageQueue))
|
||||
DevTools_Dump(message)
|
||||
|
||||
if message.addon then
|
||||
SendAddonMessage("STINKY_DETECTED", message.message, message.channel, nil, message.to)
|
||||
else
|
||||
SendChatMessage(message.message, message.channel, nil, message.to)
|
||||
end
|
||||
|
||||
table.remove(aura_env.messageQueue, 1)
|
||||
end
|
@@ -1,4 +1,4 @@
|
||||
-- CHAT_MSG_ADDON
|
||||
function(e, msg)
|
||||
print(e, msg)
|
||||
function(e, ...)
|
||||
print(e, ...)
|
||||
end
|
@@ -1,20 +1,9 @@
|
||||
---@type Message[]
|
||||
aura_env.messageQueue = {}
|
||||
|
||||
---@type number
|
||||
local threatNotifyLevel = aura_env.config.threatNotifyLevel or 5
|
||||
local stinkyNotifyGuild = aura_env.config.stinkyNotifyGuild or true
|
||||
local stinkyNotifyWhisper = aura_env.config.stinkyNotifyWhisper or true
|
||||
local stinkyNotifyAddonGuild = aura_env.config.stinkyNotifyAddonGuild or true
|
||||
local stinkyNotifyAddonWhisper = aura_env.config.stinkyNotifyAddonWhisper or true
|
||||
local killNotifyGuild = aura_env.config.killNotifyGuild or true
|
||||
local killNotifyWhisper = aura_env.config.killNotifyWhisper or true
|
||||
local killNotifyAddonGuild = aura_env.config.killNotifyAddonGuild or true
|
||||
local killNotifyAddonWhisper = aura_env.config.killNotifyAddonWhisper or true
|
||||
|
||||
---@type string[]
|
||||
local toNotify = { "Succpotato", "Extazyk", "Smokefire", "Smokemantra", "Хихихантер", "Муркот", "Растафаркрай" }
|
||||
local toNotify = { "Succpotato" }
|
||||
local toNotify = { "Succpotato", "Totleta" }
|
||||
|
||||
---@class Message
|
||||
---@field message string
|
||||
@@ -22,6 +11,11 @@ local toNotify = { "Succpotato" }
|
||||
---@field channel string
|
||||
---@field addon boolean
|
||||
Message = {
|
||||
message = "",
|
||||
to = "",
|
||||
channel = "",
|
||||
addon = false,
|
||||
|
||||
---@param message string
|
||||
---@param to string
|
||||
---@param channel string
|
||||
@@ -40,32 +34,40 @@ Message = {
|
||||
|
||||
---@param stinky Stinky
|
||||
QueueNotifyGuild = function(stinky)
|
||||
if not stinkyNotifyGuild then return end
|
||||
if not aura_env.config.stinkyNotifyGuild then 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
|
||||
table.insert(aura_env.messageQueue, message)
|
||||
end,
|
||||
---@param stinky Stinky
|
||||
QueueNotifyWhisper = function(stinky)
|
||||
if not stinkyNotifyWhisper then return end
|
||||
if not aura_env.config.stinkyNotifyWhisper then return end
|
||||
if aura_env.config.debug then print("Queueing notify whisper:") end
|
||||
local text = stinky:FormMessage()
|
||||
for _, to in ipairs(toNotify) do
|
||||
local message = Message.new(text, to, "WHISPER")
|
||||
if aura_env.config.debug then DevTools_Dump(message) end
|
||||
table.insert(aura_env.messageQueue, message)
|
||||
end
|
||||
end,
|
||||
|
||||
---@param stinky Stinky
|
||||
QueueNotifyAddonGuild = function(stinky)
|
||||
if not stinkyNotifyAddonGuild then return end
|
||||
if not aura_env.config.stinkyNotifyAddonGuild then 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
|
||||
table.insert(aura_env.messageQueue, message)
|
||||
end,
|
||||
---@param stinky Stinky
|
||||
QueueNotifyAddonWhisper = function(stinky)
|
||||
if not stinkyNotifyAddonWhisper then return end
|
||||
if not aura_env.config.stinkyNotifyAddonWhisper then return end
|
||||
if aura_env.config.debug then print("Queueing notify addon whisper:") end
|
||||
local text = stinky:FormMessage()
|
||||
for _, to in ipairs(toNotify) do
|
||||
local message = Message.new(text, to, "WHISPER", true)
|
||||
if aura_env.config.debug then DevTools_Dump(message) end
|
||||
table.insert(aura_env.messageQueue, message)
|
||||
end
|
||||
end,
|
||||
@@ -75,9 +77,11 @@ Message = {
|
||||
---@param destination string
|
||||
---@param spellName string
|
||||
QueueNotifyKilledAddonGuild = function(faction, source, destination, spellName)
|
||||
if not 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
|
||||
local text = string.format("%s|%s|%s|%s", faction, source, destination, 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)
|
||||
end,
|
||||
---@param faction string
|
||||
@@ -85,10 +89,12 @@ Message = {
|
||||
---@param destination string
|
||||
---@param spellName string
|
||||
QueueNotifyKilledAddonWhisper = function(faction, source, destination, spellName)
|
||||
if not 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
|
||||
local text = string.format("%s|%s|%s|%s", faction, source, destination, 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
|
||||
table.insert(aura_env.messageQueue, message)
|
||||
end
|
||||
end,
|
||||
@@ -98,9 +104,11 @@ Message = {
|
||||
---@param destination string
|
||||
---@param spellName string
|
||||
QueueNotifyKilledGuild = function(faction, source, destination, spellName)
|
||||
if not killNotifyGuild then return end
|
||||
if not aura_env.config.killNotifyGuild then return end
|
||||
if aura_env.config.debug then print("Queueing notify guild:") end
|
||||
local text = string.format("%s %s убил %s с помощью %s", faction, source, destination, 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)
|
||||
end,
|
||||
---@param faction string
|
||||
@@ -108,10 +116,12 @@ Message = {
|
||||
---@param destination string
|
||||
---@param spellName string
|
||||
QueueNotifyKilledWhisper = function(faction, source, destination, spellName)
|
||||
if not killNotifyWhisper then return end
|
||||
if not aura_env.config.killNotifyWhisper then return end
|
||||
if aura_env.config.debug then print("Queueing notify whisper:") end
|
||||
local text = string.format("%s %s убил %s с помощью %s", faction, source, destination, 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
|
||||
table.insert(aura_env.messageQueue, message)
|
||||
end
|
||||
end
|
||||
@@ -155,6 +165,8 @@ Stinky = {
|
||||
if not WeakAurasSaved.Cyka then WeakAurasSaved.Cyka = {} end
|
||||
if not WeakAurasSaved.Cyka.PlayerFactionCache then WeakAurasSaved.Cyka.PlayerFactionCache = {} end
|
||||
WeakAurasSaved.Cyka.Stinkies = {
|
||||
["Totleta"] = Stinky.new("Totleta", 1),
|
||||
|
||||
["Redbulka"] = Stinky.new("Redbulka", 5),
|
||||
["Курлык"] = Stinky.new("Курлык", 5),
|
||||
["Riener"] = Stinky.new("Riener", 5),
|
||||
@@ -224,7 +236,7 @@ aura_env.RegisterKill = function(source, destination, spellName, overkill)
|
||||
Message.QueueNotifyKilledWhisper(faction, source, destination, spellName)
|
||||
Message.QueueNotifyKilledAddonGuild(faction, source, destination, spellName)
|
||||
Message.QueueNotifyKilledAddonWhisper(faction, source, destination, spellName)
|
||||
|
||||
|
||||
recentlyKilled[source] = GetTime()
|
||||
end
|
||||
|
||||
@@ -235,13 +247,12 @@ aura_env.localStinkies = {}
|
||||
aura_env.StinkyDetected = function(name)
|
||||
if not aura_env.localStinkies[name] or aura_env.localStinkies[name] <
|
||||
GetTime() - 60 then
|
||||
local stinky = aura_env.stinkies[name]
|
||||
PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master")
|
||||
local msg = string.format("%s в Оргриммаре!", name)
|
||||
for k, v in pairs(toNotify) do
|
||||
-- SendChatMessage(msg, "WHISPER", nil, v)
|
||||
table.insert(aura_env.messageQueue, { to = v, msg = msg, channel = "WHISPER" })
|
||||
end
|
||||
table.insert(aura_env.messageQueue, { to = name, msg = msg, channel = "GUILD" })
|
||||
Message.QueueNotifyGuild(stinky)
|
||||
Message.QueueNotifyWhisper(stinky)
|
||||
Message.QueueNotifyAddonGuild(stinky)
|
||||
Message.QueueNotifyAddonWhisper(stinky)
|
||||
end
|
||||
aura_env.localStinkies[name] = GetTime()
|
||||
end
|
||||
|
Reference in New Issue
Block a user