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