Rework the log messages to not spam on channel message
This commit is contained in:
@@ -212,20 +212,26 @@ function shared.Commander.Init()
|
||||
local commanderChannelFrame = CreateFrame("Frame")
|
||||
commanderChannelFrame:RegisterEvent("CHAT_MSG_CHANNEL")
|
||||
commanderChannelFrame:SetScript("OnEvent", function(self, event, msg, sender, ...)
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Event received", ModuleName))
|
||||
shared.dumpTable(Heimdall_Data.config.commander)
|
||||
-- if Heimdall_Data.config.commander.debug then
|
||||
-- print(string.format("[%s] Event received", ModuleName))
|
||||
-- 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
|
||||
if not Heimdall_Data.config.commander.enabled then return end
|
||||
local channelId = select(6, ...)
|
||||
local _, channelname = GetChannelName(channelId)
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Channel received: %s", ModuleName, channelname))
|
||||
end
|
||||
-- if Heimdall_Data.config.commander.debug then
|
||||
-- print(string.format("[%s] Channel received: %s", ModuleName, channelname))
|
||||
-- end
|
||||
if channelname ~= Heimdall_Data.config.commander.masterChannel then return end
|
||||
sender = string.match(sender, "^[^-]+")
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Message from: %s", ModuleName, sender))
|
||||
shared.dumpTable(Heimdall_Data.config.commander)
|
||||
end
|
||||
|
||||
for _, command in ipairs(commands) do
|
||||
|
||||
Reference in New Issue
Block a user