Fix zone notify for in commander

This commit is contained in:
2025-01-27 16:21:57 +01:00
parent d047c632ed
commit 7aa5d50a6c
5 changed files with 17 additions and 12 deletions

View File

@@ -2,7 +2,7 @@ local addonname, shared = ...
---@cast shared HeimdallShared
---@cast addonname string
local VERSION = "3.9.3"
local VERSION = "3.9.4"
shared.VERSION = VERSION
local function init()
@@ -35,7 +35,7 @@ local function init()
---@field Memoize fun(f: function): function
---@field GetLocaleForChannel fun(channel: string): string
---@field WhoQueryService WhoQueryService
---@field Whoer InitTable
---@field Whoer InitTable|{ShouldNotifyForZone: fun(zone: string): boolean}
---@field Messenger InitTable
---@field Spotter InitTable
---@field DeathReporter InitTable

View File

@@ -1,6 +1,6 @@
## Interface: 70300
## Title: Heimdall
## Version: 3.9.3
## Version: 3.9.4
## Notes: Watches over areas and alerts when hostiles spotted
## Author: Cyka
## SavedVariables: Heimdall_Data, Heimdall_Achievements

BIN
Heimdall.zip (Stored with Git LFS)

Binary file not shown.

View File

@@ -69,7 +69,7 @@ function shared.Commander.Init()
local function Count(arr)
local ret = {}
for _, player in pairs(arr) do
if Heimdall_Data.config.who.zoneNotifyFor[player.zone] then
if shared.Whoer.ShouldNotifyForZone(player.zone) then
ret[player.zone] = (ret[player.zone] or 0) + 1
end
end
@@ -94,7 +94,7 @@ function shared.Commander.Init()
local function Who(arr)
local ret = {}
for _, player in pairs(arr) do
if Heimdall_Data.config.who.zoneNotifyFor[player.zone] then
if shared.Whoer.ShouldNotifyForZone(player.zone) then
ret[#ret + 1] = string.format("%s/%s (%s) %s", player.name, player.class, player.zone,
player.stinky and "(!!!!)" or "")
end
@@ -119,7 +119,7 @@ function shared.Commander.Init()
local function CountClass(arr)
local ret = {}
for _, player in pairs(arr) do
if Heimdall_Data.config.who.zoneNotifyFor[player.zone] then
if shared.Whoer.ShouldNotifyForZone(player.zone) then
ret[player.class] = (ret[player.class] or 0) + 1
end
end
@@ -157,6 +157,7 @@ function shared.Commander.Init()
if Heimdall_Data.config.commander.debug then
print(string.format("[%s] Executing: WhoPartitionedStinkies",
ModuleName))
shared.dumpTable(HeimdallStinkies)
end
local res = WhoPartitioned(HeimdallStinkies)
if #res == 0 then
@@ -322,6 +323,10 @@ function shared.Commander.Init()
data = channelname,
message = message
}
if Heimdall_Data.config.commander.debug then
print(string.format("[%s] Queuing message", ModuleName))
shared.dumpTable(msg)
end
--table.insert(shared.messenger.queue, msg)
table.insert(shared.networkMessenger.queue, msg)
end

View File

@@ -182,7 +182,7 @@ function shared.Whoer.Init()
---@param inputZone string
---@return boolean
local ShouldNotifyForZone = shared.Memoize(function(inputZone)
shared.Whoer.ShouldNotifyForZone = shared.Memoize(function(inputZone)
if not Heimdall_Data.config.who.debug then
print(string.format("[%s] ShouldNotifyForZone %s", ModuleName, inputZone))
end
@@ -245,7 +245,7 @@ function shared.Whoer.Init()
return string.format("Cannot notify for nil player %s", tostring(player))
end
if not ShouldNotifyForZone(player.zone) then
if not shared.Whoer.ShouldNotifyForZone(player.zone) then
--if not Heimdall_Data.config.who.zoneNotifyFor[player.zone] then
if Heimdall_Data.config.who.debug then
print(string.format("[%s] Skipping notification - Zone '%s' not in notify list", ModuleName, player.zone))
@@ -306,7 +306,7 @@ function shared.Whoer.Init()
if not player then return string.format("Cannot notify for nil player %s", tostring(player)) end
--if not Heimdall_Data.config.who.zoneNotifyFor[zone]
-- and not Heimdall_Data.config.who.zoneNotifyFor[player.zone] then
if not ShouldNotifyForZone(zone) and not ShouldNotifyForZone(player.zone) then
if not shared.Whoer.ShouldNotifyForZone(zone) and not shared.Whoer.ShouldNotifyForZone(player.zone) then
return string.format("Not notifying for zones %s and %s", tostring(zone), tostring(player.zone))
end
for _, channel in pairs(Heimdall_Data.config.who.channels) do
@@ -354,7 +354,7 @@ function shared.Whoer.Init()
if not Heimdall_Data.config.who.enabled then return end
if not player then return string.format("Cannot notify for nil player %s", tostring(player)) end
--if not Heimdall_Data.config.who.zoneNotifyFor[player.zone] then
if not ShouldNotifyForZone(player.zone) then
if not shared.Whoer.ShouldNotifyForZone(player.zone) then
return string.format("Not notifying for zone %s", tostring(player.zone))
end