Implement notify gone to whosniffer

This commit is contained in:
2024-10-28 17:26:12 +01:00
parent a03d7faada
commit a61acf100b
4 changed files with 23 additions and 10 deletions

View File

@@ -17,7 +17,14 @@ function()
["class"] = class,
["zone"] = zone,
}
PlaySoundFile("Interface\\Sounds\\Cloak.ogg", "Master")
local stinky = WeakAurasSaved.Cyka.stinkies[name]
if stinky then
PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master")
else
PlaySoundFile("Interface\\Sounds\\Cloak.ogg", "Master")
end
aura_env.Notify(player)
end
player:Touch()

View File

@@ -7,12 +7,8 @@ function(allstates)
if ago > aura_env.ttl then
allstates[k] = { show = false, changed = true }
aura_env.alliance[k] = nil
local stinky = WeakAurasSaved.Cyka.stinkies[v.name]
if stinky then
PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master")
else
PlaySoundFile("Interface\\Sounds\\Uncloak.ogg", "Master")
end
PlaySoundFile("Interface\\Sounds\\Uncloak.ogg", "Master")
aura_env.NotifyGone(v)
local timestamp = date("%Y-%m-%dT%H:%M:%S")
WeakAurasSaved.Cyka.WhoSniffer[v.name][timestamp] = {

File diff suppressed because one or more lines are too long

View File

@@ -9,7 +9,8 @@ if not WeakAurasSaved.Cyka.WhoSniffer then WeakAurasSaved.Cyka.WhoSniffer = {} e
---@field ttl number
---@field messageQueue WHOMessage[]
---@field UpdateMacro fun()
---@field Notify fun(string)
---@field Notify fun(Player)
---@field NotifyGone fun(Player)
---@class WHOMessage
---@field message string
@@ -59,7 +60,7 @@ aura_env.messageQueue = {}
aura_env.ttl = 60
aura_env.whoQueryIdx = 1
aura_env.whoQueries = {
"z-\"Orgrimmar\" z-\"Durotar\" g-\"БеспредеЛ\"",
"g-\"БеспредеЛ\"",
"z-\"Orgrimmar\" z-\"Durotar\" r-\"Human\" r-\"Dwarf\" r-\"Night Elf\" r-\"Gnome\"",
"z-\"Orgrimmar\" z-\"Durotar\" r-\"Draenei\" r-\"Worgen\" r-\"Kul Tiran\" r-\"Dark Iron Dwarf\" r-\"Void Elf\" r-\"Lightforged Draenei\" r-\"Mechagnome\""
}
@@ -181,3 +182,12 @@ aura_env.Notify = function(player)
table.insert(aura_env.messageQueue, {to = rec, message = msg})
end
end
---@param player Player
aura_env.NotifyGone = function(player)
if not notifyFor[player.zone] then return end
local msg = string.format("%s of class %s and guild %s left %s", player.name, player.class, player.guild, player.zone)
for _, rec in ipairs(toNotify) do
table.insert(aura_env.messageQueue, {to = rec, message = msg})
end
end