Refactor Heimdall messenger module to improve structure and utilize ReactiveValue for queue management

This commit is contained in:
2025-05-18 15:54:11 +02:00
parent ce92e8e12c
commit 3ef0e4c935
2 changed files with 41 additions and 73 deletions

View File

@@ -93,23 +93,6 @@ local function init()
---@field locale string
---@field debug boolean
--- Data ---
---@class HeimdallMessengerData
---@field queue table<string, Message>
---@field ticker Timer?
---@class HeimdallNetworkMessengerData
---@field queue table<string, Message>
---@field ticker Timer?
---@class HeimdallWhoData
---@field updateTicker Timer?
---@field whoTicker Timer?
---@field ignored table<string, boolean>
---@class HeimdallStinkyCacheData
---@field stinkies table<string, {value: number, timestamp: number}>
shared.GetOrDefault = function(table, keys, default)
local value = default
if not table then return value end
@@ -129,13 +112,6 @@ local function init()
return value
end
shared.messenger = {
queue = {},
}
shared.who = {
ignored = {},
}
--/run Heimdall_Data.config.who.queries="g-\"БеспредеЛ\"|ally"
Heimdall_Data.config = {
debug = shared.GetOrDefault(Heimdall_Data, { "config", "debug" }, false),