Handle host pool serialization (exception for backward compatibility).

Fix recipients add
Initial work for alerts dispatching to recipients
This commit is contained in:
Alfredo Cardigliano 2020-07-23 06:22:17 +02:00
parent befc2ec821
commit 7ffb4df9a6
11 changed files with 128 additions and 37 deletions

View file

@ -16,7 +16,28 @@ local alert_entity_pool_instances = {}
-- ################################################################################
-- @brief Returns the host pool of a given `entity_info`
-- @brief Returns the pools of a given `entity_id`
function pools_alert_utils.get_entity_pools_by_id(entity_id)
local alert_entity = alert_consts.alertEntityById(entity_id)
if not alert_entity then
return nil
end
if not alert_entity_pool_instances[alert_entity.entity_id] then
if not alert_entity.pools then
return nil
end
local pools = require(alert_entity.pools)
alert_entity_pool_instances[alert_entity.entity_id] = pools:create()
end
return alert_entity_pool_instances[alert_entity.entity_id]
end
-- ################################################################################
-- @brief Returns the pool id of a given `entity_info`
function pools_alert_utils.get_entity_pool_id(entity_info)
local alert_entity = entity_info.alert_entity
local pool_member = entity_info.alert_entity_val