This commit is contained in:
@@ -41,12 +41,16 @@ function shared.AgentTracker.Init()
|
||||
if name then
|
||||
local isNewAgent = not Heimdall_Data.config.agents[name]
|
||||
Heimdall_Data.config.agents[name] = date("%Y-%m-%dT%H:%M:%S")
|
||||
if isNewAgent then
|
||||
newAgents = newAgents + 1
|
||||
end
|
||||
if isNewAgent then newAgents = newAgents + 1 end
|
||||
if Heimdall_Data.config.agentTracker.debug then
|
||||
print(string.format("[%s] %s agent: %s", ModuleName, isNewAgent and "Added new" or "Updated existing",
|
||||
name))
|
||||
print(
|
||||
string.format(
|
||||
"[%s] %s agent: %s",
|
||||
ModuleName,
|
||||
isNewAgent and "Added new" or "Updated existing",
|
||||
name
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -89,20 +93,27 @@ function shared.AgentTracker.Init()
|
||||
shared.dumpTable(Heimdall_Data.config.agentTracker)
|
||||
end
|
||||
|
||||
|
||||
sender = string.match(sender, "^[^-]+")
|
||||
local isNewAgent = not Heimdall_Data.config.agents[sender]
|
||||
Heimdall_Data.config.agents[sender] = date("%Y-%m-%dT%H:%M:%S")
|
||||
|
||||
if Heimdall_Data.config.agentTracker.debug then
|
||||
print(string.format("[%s] %s agent from message: %s", ModuleName,
|
||||
isNewAgent and "Added new" or "Updated existing", sender))
|
||||
print(
|
||||
string.format(
|
||||
"[%s] %s agent from message: %s",
|
||||
ModuleName,
|
||||
isNewAgent and "Added new" or "Updated existing",
|
||||
sender
|
||||
)
|
||||
)
|
||||
end
|
||||
end)
|
||||
|
||||
if Heimdall_Data.config.agentTracker.debug then
|
||||
local count = 0
|
||||
for _ in pairs(Heimdall_Data.config.agents) do count = count + 1 end
|
||||
for _ in pairs(Heimdall_Data.config.agents) do
|
||||
count = count + 1
|
||||
end
|
||||
print(string.format("[%s] Module initialized - Tracking %d agents", ModuleName, count))
|
||||
end
|
||||
print("[Heimdall] AgentTracker loaded")
|
||||
|
||||
Reference in New Issue
Block a user