Fix zone notify for in commander
This commit is contained in:
@@ -2,7 +2,7 @@ local addonname, shared = ...
|
|||||||
---@cast shared HeimdallShared
|
---@cast shared HeimdallShared
|
||||||
---@cast addonname string
|
---@cast addonname string
|
||||||
|
|
||||||
local VERSION = "3.9.3"
|
local VERSION = "3.9.4"
|
||||||
shared.VERSION = VERSION
|
shared.VERSION = VERSION
|
||||||
|
|
||||||
local function init()
|
local function init()
|
||||||
@@ -35,7 +35,7 @@ local function init()
|
|||||||
---@field Memoize fun(f: function): function
|
---@field Memoize fun(f: function): function
|
||||||
---@field GetLocaleForChannel fun(channel: string): string
|
---@field GetLocaleForChannel fun(channel: string): string
|
||||||
---@field WhoQueryService WhoQueryService
|
---@field WhoQueryService WhoQueryService
|
||||||
---@field Whoer InitTable
|
---@field Whoer InitTable|{ShouldNotifyForZone: fun(zone: string): boolean}
|
||||||
---@field Messenger InitTable
|
---@field Messenger InitTable
|
||||||
---@field Spotter InitTable
|
---@field Spotter InitTable
|
||||||
---@field DeathReporter InitTable
|
---@field DeathReporter InitTable
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
## Interface: 70300
|
## Interface: 70300
|
||||||
## Title: Heimdall
|
## Title: Heimdall
|
||||||
## Version: 3.9.3
|
## Version: 3.9.4
|
||||||
## Notes: Watches over areas and alerts when hostiles spotted
|
## Notes: Watches over areas and alerts when hostiles spotted
|
||||||
## Author: Cyka
|
## Author: Cyka
|
||||||
## SavedVariables: Heimdall_Data, Heimdall_Achievements
|
## SavedVariables: Heimdall_Data, Heimdall_Achievements
|
||||||
|
BIN
Heimdall.zip
(Stored with Git LFS)
BIN
Heimdall.zip
(Stored with Git LFS)
Binary file not shown.
@@ -69,7 +69,7 @@ function shared.Commander.Init()
|
|||||||
local function Count(arr)
|
local function Count(arr)
|
||||||
local ret = {}
|
local ret = {}
|
||||||
for _, player in pairs(arr) do
|
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
|
ret[player.zone] = (ret[player.zone] or 0) + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -94,7 +94,7 @@ function shared.Commander.Init()
|
|||||||
local function Who(arr)
|
local function Who(arr)
|
||||||
local ret = {}
|
local ret = {}
|
||||||
for _, player in pairs(arr) do
|
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,
|
ret[#ret + 1] = string.format("%s/%s (%s) %s", player.name, player.class, player.zone,
|
||||||
player.stinky and "(!!!!)" or "")
|
player.stinky and "(!!!!)" or "")
|
||||||
end
|
end
|
||||||
@@ -119,7 +119,7 @@ function shared.Commander.Init()
|
|||||||
local function CountClass(arr)
|
local function CountClass(arr)
|
||||||
local ret = {}
|
local ret = {}
|
||||||
for _, player in pairs(arr) do
|
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
|
ret[player.class] = (ret[player.class] or 0) + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -157,6 +157,7 @@ function shared.Commander.Init()
|
|||||||
if Heimdall_Data.config.commander.debug then
|
if Heimdall_Data.config.commander.debug then
|
||||||
print(string.format("[%s] Executing: WhoPartitionedStinkies",
|
print(string.format("[%s] Executing: WhoPartitionedStinkies",
|
||||||
ModuleName))
|
ModuleName))
|
||||||
|
shared.dumpTable(HeimdallStinkies)
|
||||||
end
|
end
|
||||||
local res = WhoPartitioned(HeimdallStinkies)
|
local res = WhoPartitioned(HeimdallStinkies)
|
||||||
if #res == 0 then
|
if #res == 0 then
|
||||||
@@ -322,6 +323,10 @@ function shared.Commander.Init()
|
|||||||
data = channelname,
|
data = channelname,
|
||||||
message = message
|
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.messenger.queue, msg)
|
||||||
table.insert(shared.networkMessenger.queue, msg)
|
table.insert(shared.networkMessenger.queue, msg)
|
||||||
end
|
end
|
||||||
|
@@ -182,7 +182,7 @@ function shared.Whoer.Init()
|
|||||||
|
|
||||||
---@param inputZone string
|
---@param inputZone string
|
||||||
---@return boolean
|
---@return boolean
|
||||||
local ShouldNotifyForZone = shared.Memoize(function(inputZone)
|
shared.Whoer.ShouldNotifyForZone = shared.Memoize(function(inputZone)
|
||||||
if not Heimdall_Data.config.who.debug then
|
if not Heimdall_Data.config.who.debug then
|
||||||
print(string.format("[%s] ShouldNotifyForZone %s", ModuleName, inputZone))
|
print(string.format("[%s] ShouldNotifyForZone %s", ModuleName, inputZone))
|
||||||
end
|
end
|
||||||
@@ -245,7 +245,7 @@ function shared.Whoer.Init()
|
|||||||
return string.format("Cannot notify for nil player %s", tostring(player))
|
return string.format("Cannot notify for nil player %s", tostring(player))
|
||||||
end
|
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 not Heimdall_Data.config.who.zoneNotifyFor[player.zone] then
|
||||||
if Heimdall_Data.config.who.debug then
|
if Heimdall_Data.config.who.debug then
|
||||||
print(string.format("[%s] Skipping notification - Zone '%s' not in notify list", ModuleName, player.zone))
|
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 player then return string.format("Cannot notify for nil player %s", tostring(player)) end
|
||||||
--if not Heimdall_Data.config.who.zoneNotifyFor[zone]
|
--if not Heimdall_Data.config.who.zoneNotifyFor[zone]
|
||||||
-- and not Heimdall_Data.config.who.zoneNotifyFor[player.zone] then
|
-- 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))
|
return string.format("Not notifying for zones %s and %s", tostring(zone), tostring(player.zone))
|
||||||
end
|
end
|
||||||
for _, channel in pairs(Heimdall_Data.config.who.channels) do
|
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 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 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 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))
|
return string.format("Not notifying for zone %s", tostring(player.zone))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user