Fix up the event messaging
This commit is contained in:
@@ -8,7 +8,7 @@ function()
|
||||
print(string.format("Processing message; %d in queue", #aura_env.messageQueue))
|
||||
|
||||
if message.addon then
|
||||
SendAddonMessage(aura_env.addonprefix, message.message, message.channel, nil, message.to)
|
||||
SendAddonMessage(aura_env.addonprefix, message.message, message.channel, message.to)
|
||||
else
|
||||
SendChatMessage(message.message, message.channel, nil, message.to)
|
||||
end
|
||||
|
||||
@@ -52,9 +52,14 @@ function(allstates, e, prefix, msg, ...)
|
||||
end
|
||||
|
||||
if not prefix or prefix ~= aura_env.addonprefix then return end
|
||||
local name, threat, note = strsplit(aura_env.separator, msg)
|
||||
print("threat", threat)
|
||||
threat = tonumber(threat)
|
||||
local parts = {}
|
||||
for part in string.gmatch(msg, "([^" .. aura_env.separator .. "]+)") do
|
||||
table.insert(parts, part)
|
||||
end
|
||||
local name = parts[1]
|
||||
local threat = tonumber(parts[2])
|
||||
local note = parts[3]
|
||||
|
||||
if not name then
|
||||
if aura_env.config.debug then
|
||||
print(string.format("Could not get name for %s (%s) with deliminer '%s'", msg, name or "nil", aura_env.separator))
|
||||
|
||||
@@ -6,7 +6,7 @@ RegisterAddonMessagePrefix(aura_env.addonprefix)
|
||||
|
||||
---@type string[]
|
||||
local toNotify = { "Succpotato", "Extazyk", "Smokefire", "Smokemantra", "Хихихантер", "Муркот", "Растафаркрай" }
|
||||
local toNotify = { "Succpotato", "Totleta" }
|
||||
local toNotify = { "Deathleta" }
|
||||
|
||||
---@class Message
|
||||
---@field message string
|
||||
@@ -67,7 +67,7 @@ Message = {
|
||||
QueueNotifyAddonWhisper = function(stinky)
|
||||
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:FormAddonMessage()
|
||||
for _, to in ipairs(toNotify) do
|
||||
local message = Message.new(text, to, "WHISPER", true)
|
||||
if aura_env.config.debug then DevTools_Dump(message) end
|
||||
@@ -82,8 +82,7 @@ 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 = table.concat({ faction, source, spellName }, aura_env.separator)
|
||||
local message = Message.new(text, nil, "GUILD", true)
|
||||
if aura_env.config.debug then DevTools_Dump(message) end
|
||||
table.insert(aura_env.messageQueue, message)
|
||||
@@ -95,8 +94,7 @@ 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 = table.concat({ faction, source, destination, spellName }, aura_env.separator)
|
||||
for _, to in ipairs(toNotify) do
|
||||
local message = Message.new(text, to, "WHISPER", true)
|
||||
if aura_env.config.debug then DevTools_Dump(message) end
|
||||
@@ -163,14 +161,15 @@ Stinky = {
|
||||
---@param self Stinky
|
||||
---@return string
|
||||
FormAddonMessage = function(self)
|
||||
return string.format("%s%s%s%s%s", self.name, aura_env.separator, self.threat, aura_env.separator, self.note)
|
||||
return table.concat({ self.name, self.threat, self.note }, aura_env.separator)
|
||||
end,
|
||||
}
|
||||
|
||||
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),
|
||||
["Totleta"] = nil,
|
||||
["Deathleta"] = Stinky.new("Deathleta", 1),
|
||||
|
||||
["Redbulka"] = Stinky.new("Redbulka", 5),
|
||||
["Курлык"] = Stinky.new("Курлык", 5),
|
||||
@@ -251,7 +250,7 @@ aura_env.localStinkies = {}
|
||||
---@param name string
|
||||
aura_env.StinkyDetected = function(name)
|
||||
if not aura_env.localStinkies[name] or aura_env.localStinkies[name] <
|
||||
GetTime() - 60 then
|
||||
GetTime() - aura_env.config.throttle then
|
||||
local stinky = aura_env.stinkies[name]
|
||||
Message.QueueNotifyGuild(stinky)
|
||||
Message.QueueNotifyWhisper(stinky)
|
||||
|
||||
Reference in New Issue
Block a user