Rework the log messages to not spam on channel message
This commit is contained in:
@@ -57,24 +57,29 @@ function shared.AgentTracker.Init()
|
|||||||
local agentTrackerChannelSniffer = CreateFrame("Frame")
|
local agentTrackerChannelSniffer = CreateFrame("Frame")
|
||||||
agentTrackerChannelSniffer:RegisterEvent("CHAT_MSG_CHANNEL")
|
agentTrackerChannelSniffer:RegisterEvent("CHAT_MSG_CHANNEL")
|
||||||
agentTrackerChannelSniffer:SetScript("OnEvent", function(self, event, msg, sender, ...)
|
agentTrackerChannelSniffer:SetScript("OnEvent", function(self, event, msg, sender, ...)
|
||||||
if Heimdall_Data.config.agentTracker.debug then
|
-- if Heimdall_Data.config.agentTracker.debug then
|
||||||
print(string.format("[%s] Channel message received from: %s", ModuleName, sender))
|
-- print(string.format("[%s] Channel message received from: %s", ModuleName, sender))
|
||||||
end
|
-- end
|
||||||
if not Heimdall_Data.config.agentTracker.enabled then
|
if not Heimdall_Data.config.agentTracker.enabled then
|
||||||
if Heimdall_Data.config.agentTracker.debug then
|
-- if Heimdall_Data.config.agentTracker.debug then
|
||||||
print(string.format("[%s] Module disabled, ignoring channel message", ModuleName))
|
-- print(string.format("[%s] Module disabled, ignoring channel message", ModuleName))
|
||||||
end
|
-- end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local channelId = select(6, ...)
|
local channelId = select(6, ...)
|
||||||
local _, channelname = GetChannelName(channelId)
|
local _, channelname = GetChannelName(channelId)
|
||||||
if channelname ~= Heimdall_Data.config.agentTracker.masterChannel then
|
if channelname ~= Heimdall_Data.config.agentTracker.masterChannel then
|
||||||
if Heimdall_Data.config.agentTracker.debug then
|
-- if Heimdall_Data.config.agentTracker.debug then
|
||||||
print(string.format("[%s] Ignoring message from non-master channel: %s", ModuleName, channelname))
|
-- print(string.format("[%s] Ignoring message from non-master channel: %s", ModuleName, channelname))
|
||||||
end
|
-- end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if Heimdall_Data.config.agentTracker.debug then
|
||||||
|
print(string.format("[%s] Processing message from master channel: %s", ModuleName, sender))
|
||||||
|
shared.dumpTable(Heimdall_Data.config.agentTracker)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
sender = string.match(sender, "^[^-]+")
|
sender = string.match(sender, "^[^-]+")
|
||||||
local isNewAgent = not Heimdall_Data.config.agents[sender]
|
local isNewAgent = not Heimdall_Data.config.agents[sender]
|
||||||
|
@@ -212,20 +212,26 @@ function shared.Commander.Init()
|
|||||||
local commanderChannelFrame = CreateFrame("Frame")
|
local commanderChannelFrame = CreateFrame("Frame")
|
||||||
commanderChannelFrame:RegisterEvent("CHAT_MSG_CHANNEL")
|
commanderChannelFrame:RegisterEvent("CHAT_MSG_CHANNEL")
|
||||||
commanderChannelFrame:SetScript("OnEvent", function(self, event, msg, sender, ...)
|
commanderChannelFrame:SetScript("OnEvent", function(self, event, msg, sender, ...)
|
||||||
if Heimdall_Data.config.commander.debug then
|
-- if Heimdall_Data.config.commander.debug then
|
||||||
print(string.format("[%s] Event received", ModuleName))
|
-- print(string.format("[%s] Event received", ModuleName))
|
||||||
shared.dumpTable(Heimdall_Data.config.commander)
|
-- shared.dumpTable(Heimdall_Data.config.commander)
|
||||||
|
-- end
|
||||||
|
if not Heimdall_Data.config.commander.enabled then
|
||||||
|
-- if Heimdall_Data.config.commander.debug then
|
||||||
|
-- print(string.format("[%s] Module disabled, ignoring event", ModuleName))
|
||||||
|
-- end
|
||||||
|
return
|
||||||
end
|
end
|
||||||
if not Heimdall_Data.config.commander.enabled then return end
|
|
||||||
local channelId = select(6, ...)
|
local channelId = select(6, ...)
|
||||||
local _, channelname = GetChannelName(channelId)
|
local _, channelname = GetChannelName(channelId)
|
||||||
if Heimdall_Data.config.commander.debug then
|
-- if Heimdall_Data.config.commander.debug then
|
||||||
print(string.format("[%s] Channel received: %s", ModuleName, channelname))
|
-- print(string.format("[%s] Channel received: %s", ModuleName, channelname))
|
||||||
end
|
-- end
|
||||||
if channelname ~= Heimdall_Data.config.commander.masterChannel then return end
|
if channelname ~= Heimdall_Data.config.commander.masterChannel then return end
|
||||||
sender = string.match(sender, "^[^-]+")
|
sender = string.match(sender, "^[^-]+")
|
||||||
if Heimdall_Data.config.commander.debug then
|
if Heimdall_Data.config.commander.debug then
|
||||||
print(string.format("[%s] Message from: %s", ModuleName, sender))
|
print(string.format("[%s] Message from: %s", ModuleName, sender))
|
||||||
|
shared.dumpTable(Heimdall_Data.config.commander)
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, command in ipairs(commands) do
|
for _, command in ipairs(commands) do
|
||||||
|
@@ -9,22 +9,22 @@ function shared.Echoer.Init()
|
|||||||
local frame = CreateFrame("Frame")
|
local frame = CreateFrame("Frame")
|
||||||
frame:RegisterEvent("CHAT_MSG_CHANNEL")
|
frame:RegisterEvent("CHAT_MSG_CHANNEL")
|
||||||
frame:SetScript("OnEvent", function(self, event, msg, sender, ...)
|
frame:SetScript("OnEvent", function(self, event, msg, sender, ...)
|
||||||
if Heimdall_Data.config.echoer.debug then
|
-- if Heimdall_Data.config.echoer.debug then
|
||||||
print(string.format("[%s] Channel message received from: %s", ModuleName, sender))
|
-- print(string.format("[%s] Channel message received from: %s", ModuleName, sender))
|
||||||
end
|
-- end
|
||||||
|
|
||||||
if not Heimdall_Data.config.echoer.enabled then
|
if not Heimdall_Data.config.echoer.enabled then
|
||||||
if Heimdall_Data.config.echoer.debug then
|
-- if Heimdall_Data.config.echoer.debug then
|
||||||
print(string.format("[%s] Module disabled, ignoring message", ModuleName))
|
-- print(string.format("[%s] Module disabled, ignoring message", ModuleName))
|
||||||
end
|
-- end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local channelId = select(6, ...)
|
local channelId = select(6, ...)
|
||||||
local _, channelname = GetChannelName(channelId)
|
local _, channelname = GetChannelName(channelId)
|
||||||
if Heimdall_Data.config.echoer.debug then
|
-- if Heimdall_Data.config.echoer.debug then
|
||||||
print(string.format("[%s] Processing message from channel: %s", ModuleName, channelname))
|
-- print(string.format("[%s] Processing message from channel: %s", ModuleName, channelname))
|
||||||
end
|
-- end
|
||||||
|
|
||||||
if channelname ~= Heimdall_Data.config.echoer.masterChannel then
|
if channelname ~= Heimdall_Data.config.echoer.masterChannel then
|
||||||
if Heimdall_Data.config.echoer.debug then
|
if Heimdall_Data.config.echoer.debug then
|
||||||
@@ -32,6 +32,10 @@ function shared.Echoer.Init()
|
|||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if Heimdall_Data.config.echoer.debug then
|
||||||
|
print(string.format("[%s] Processing message from master channel: %s", ModuleName, sender))
|
||||||
|
shared.dumpTable(Heimdall_Data.config.echoer)
|
||||||
|
end
|
||||||
|
|
||||||
if string.find(msg, "^" .. Heimdall_Data.config.echoer.prefix) then
|
if string.find(msg, "^" .. Heimdall_Data.config.echoer.prefix) then
|
||||||
if Heimdall_Data.config.echoer.debug then
|
if Heimdall_Data.config.echoer.debug then
|
||||||
|
@@ -9,29 +9,33 @@ function shared.Emoter.Init()
|
|||||||
local frame = CreateFrame("Frame")
|
local frame = CreateFrame("Frame")
|
||||||
frame:RegisterEvent("CHAT_MSG_CHANNEL")
|
frame:RegisterEvent("CHAT_MSG_CHANNEL")
|
||||||
frame:SetScript("OnEvent", function(self, event, msg, sender, ...)
|
frame:SetScript("OnEvent", function(self, event, msg, sender, ...)
|
||||||
if Heimdall_Data.config.emoter.debug then
|
-- if Heimdall_Data.config.emoter.debug then
|
||||||
print(string.format("[%s] Channel message received from: %s", ModuleName, sender))
|
-- print(string.format("[%s] Channel message received from: %s", ModuleName, sender))
|
||||||
end
|
-- end
|
||||||
|
|
||||||
if not Heimdall_Data.config.emoter.enabled then
|
if not Heimdall_Data.config.emoter.enabled then
|
||||||
if Heimdall_Data.config.emoter.debug then
|
-- if Heimdall_Data.config.emoter.debug then
|
||||||
print(string.format("[%s] Module disabled, ignoring message", ModuleName))
|
-- print(string.format("[%s] Module disabled, ignoring message", ModuleName))
|
||||||
end
|
-- end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local channelId = select(6, ...)
|
local channelId = select(6, ...)
|
||||||
local _, channelname = GetChannelName(channelId)
|
local _, channelname = GetChannelName(channelId)
|
||||||
if Heimdall_Data.config.emoter.debug then
|
-- if Heimdall_Data.config.emoter.debug then
|
||||||
print(string.format("[%s] Processing message from channel: %s", ModuleName, channelname))
|
-- print(string.format("[%s] Processing message from channel: %s", ModuleName, channelname))
|
||||||
end
|
-- end
|
||||||
|
|
||||||
if channelname ~= Heimdall_Data.config.emoter.masterChannel then
|
if channelname ~= Heimdall_Data.config.emoter.masterChannel then
|
||||||
if Heimdall_Data.config.emoter.debug then
|
-- if Heimdall_Data.config.emoter.debug then
|
||||||
print(string.format("[%s] Ignoring message from non-master channel", ModuleName))
|
-- print(string.format("[%s] Ignoring message from non-master channel", ModuleName))
|
||||||
end
|
-- end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if Heimdall_Data.config.emoter.debug then
|
||||||
|
print(string.format("[%s] Processing message from master channel: %s", ModuleName, sender))
|
||||||
|
shared.dumpTable(Heimdall_Data.config.emoter)
|
||||||
|
end
|
||||||
|
|
||||||
if string.find(msg, "^" .. Heimdall_Data.config.emoter.prefix) then
|
if string.find(msg, "^" .. Heimdall_Data.config.emoter.prefix) then
|
||||||
if Heimdall_Data.config.emoter.debug then
|
if Heimdall_Data.config.emoter.debug then
|
||||||
|
@@ -95,23 +95,27 @@ function shared.StinkyTracker.Init()
|
|||||||
local frame = CreateFrame("Frame")
|
local frame = CreateFrame("Frame")
|
||||||
frame:RegisterEvent("CHAT_MSG_CHANNEL")
|
frame:RegisterEvent("CHAT_MSG_CHANNEL")
|
||||||
frame:SetScript("OnEvent", function(self, event, msg, sender, ...)
|
frame:SetScript("OnEvent", function(self, event, msg, sender, ...)
|
||||||
if Heimdall_Data.config.stinkyTracker.debug then
|
-- if Heimdall_Data.config.stinkyTracker.debug then
|
||||||
print(string.format("[%s] Event received: %s from %s", ModuleName, event, sender))
|
-- print(string.format("[%s] Event received: %s from %s", ModuleName, event, sender))
|
||||||
end
|
-- end
|
||||||
if not Heimdall_Data.config.stinkyTracker.enabled then
|
if not Heimdall_Data.config.stinkyTracker.enabled then
|
||||||
if Heimdall_Data.config.stinkyTracker.debug then
|
-- if Heimdall_Data.config.stinkyTracker.debug then
|
||||||
print(string.format("[%s] Module disabled, ignoring event", ModuleName))
|
-- print(string.format("[%s] Module disabled, ignoring event", ModuleName))
|
||||||
end
|
-- end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local channelId = select(6, ...)
|
local channelId = select(6, ...)
|
||||||
local _, channelname = GetChannelName(channelId)
|
local _, channelname = GetChannelName(channelId)
|
||||||
if channelname ~= Heimdall_Data.config.stinkyTracker.masterChannel then
|
if channelname ~= Heimdall_Data.config.stinkyTracker.masterChannel then
|
||||||
if Heimdall_Data.config.stinkyTracker.debug then
|
-- if Heimdall_Data.config.stinkyTracker.debug then
|
||||||
print(string.format("[%s] Ignoring message from non-master channel: %s", ModuleName, channelname))
|
-- print(string.format("[%s] Ignoring message from non-master channel: %s", ModuleName, channelname))
|
||||||
end
|
-- end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if Heimdall_Data.config.stinkyTracker.debug then
|
||||||
|
print(string.format("[%s] Processing message from master channel: %s", ModuleName, sender))
|
||||||
|
shared.dumpTable(Heimdall_Data.config.stinkyTracker)
|
||||||
|
end
|
||||||
|
|
||||||
if string.find(msg, "^who:") then
|
if string.find(msg, "^who:") then
|
||||||
if Heimdall_Data.config.stinkyTracker.debug then
|
if Heimdall_Data.config.stinkyTracker.debug then
|
||||||
@@ -191,4 +195,3 @@ function shared.StinkyTracker.Init()
|
|||||||
end
|
end
|
||||||
print("[Heimdall] StinkyTracker loaded")
|
print("[Heimdall] StinkyTracker loaded")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user