Shorten every instance of "CHANNEL" to "C" and whisper too
To save a little space in messages, it's getting very cramped
This commit is contained in:
@@ -6,6 +6,7 @@ local ModuleName = "AgentTracker"
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
shared.AgentTracker = {}
|
||||
function shared.AgentTracker.Init()
|
||||
--/run Heimdall_Data.config.agents["Cyheuraeth"]=date("%Y-%m-%dT%H:%M:%S")
|
||||
---@type table<string, boolean>
|
||||
local channelRosterFrame = CreateFrame("Frame")
|
||||
channelRosterFrame:RegisterEvent("CHANNEL_ROSTER_UPDATE")
|
||||
|
@@ -93,7 +93,7 @@ function shared.BonkDetector.Init()
|
||||
end
|
||||
---@type Message
|
||||
local message = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = notifyChannel,
|
||||
message = string.format(shared.L.en.bonkDetected, source, destination, subevent),
|
||||
}
|
||||
@@ -105,7 +105,7 @@ function shared.BonkDetector.Init()
|
||||
if Heimdall_Data.config.echoToRussian then
|
||||
-- Russian message
|
||||
local ruMessage = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = notifyChannel .. "ru",
|
||||
message = string.format(shared.L.ru.bonkDetected, source, destination, subevent),
|
||||
}
|
||||
|
@@ -71,7 +71,7 @@ function shared.CombatAlerter.Init()
|
||||
SetMapByID(GetCurrentMapAreaID())
|
||||
---@type Message
|
||||
local msg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = Heimdall_Data.config.combatAlerter.masterChannel,
|
||||
message = string.format(shared.L.en.combatAlerterInCombat,
|
||||
source,
|
||||
@@ -97,7 +97,7 @@ function shared.CombatAlerter.Init()
|
||||
if Heimdall_Data.config.echoToRussian then
|
||||
-- Russian message
|
||||
local ruMsg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = Heimdall_Data.config.combatAlerter.masterChannel .. "ru",
|
||||
message = string.format(shared.L.ru.combatAlerterInCombat,
|
||||
source,
|
||||
|
@@ -307,7 +307,7 @@ function shared.Commander.Init()
|
||||
for _, message in ipairs(messages) do
|
||||
---@type Message
|
||||
local msg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = channelname,
|
||||
message = message
|
||||
}
|
||||
|
@@ -94,7 +94,7 @@ function shared.DeathReporter.Init()
|
||||
|
||||
---@type Message
|
||||
local msg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = Heimdall_Data.config.deathReporter.masterChannel,
|
||||
message = string.format(shared.L.en.killed,
|
||||
source,
|
||||
@@ -121,7 +121,7 @@ function shared.DeathReporter.Init()
|
||||
if Heimdall_Data.config.echoToRussian then
|
||||
-- Russian message
|
||||
local ruMsg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = Heimdall_Data.config.deathReporter.masterChannel .. "ru",
|
||||
message = string.format(shared.L.ru.killed,
|
||||
source,
|
||||
|
@@ -64,6 +64,11 @@ function shared.Messenger.Init()
|
||||
end
|
||||
return
|
||||
end
|
||||
if string.find(message.channel, "^C") then
|
||||
message.channel = "CHANNEL"
|
||||
elseif string.find(message.channel, "^W") then
|
||||
message.channel = "WHISPER"
|
||||
end
|
||||
|
||||
if message.channel == "CHANNEL" and message.data and string.match(message.data, "%D") then
|
||||
if Heimdall_Data.config.messenger.debug then
|
||||
@@ -111,9 +116,6 @@ function shared.Messenger.Init()
|
||||
print(string.format("[%s] Message too long!!!!: %s", ModuleName, message.message))
|
||||
return
|
||||
end
|
||||
if string.find(message.channel, "^C") then
|
||||
message.channel = "CHANNEL"
|
||||
end
|
||||
SendChatMessage(message.message, message.channel, nil, message.data)
|
||||
end
|
||||
local function Tick()
|
||||
|
@@ -165,7 +165,7 @@ function shared.NetworkMessenger.Init()
|
||||
--/run Heimdall_Data.Test()
|
||||
Heimdall_Data.Test = function()
|
||||
local testmsg = {
|
||||
channel = "WHISPER",
|
||||
channel = "W",
|
||||
message = "Hi, mom!",
|
||||
data = "Secundus"
|
||||
}
|
||||
|
@@ -115,7 +115,7 @@ function shared.Noter.Init()
|
||||
end
|
||||
---@type Message
|
||||
local msg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = Heimdall_Data.config.noter.masterChannel,
|
||||
message = string.format("[%s][%d] %s: %s", note.source, index, note.date, note.note)
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ function shared.Sniffer.Init()
|
||||
end
|
||||
smellThrottle[stinky] = GetTime()
|
||||
local msg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = Heimdall_Data.config.deathReporter.notifyChannel,
|
||||
message = string.format(shared.L.en.snifferStinky, stinky),
|
||||
}
|
||||
@@ -44,7 +44,7 @@ function shared.Sniffer.Init()
|
||||
if Heimdall_Data.config.echoToRussian then
|
||||
-- Russian message
|
||||
local ruMsg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = Heimdall_Data.config.deathReporter.notifyChannel .. "ru",
|
||||
message = string.format(shared.L.ru.snifferStinky, stinky),
|
||||
}
|
||||
|
@@ -177,7 +177,7 @@ function shared.Spotter.Init()
|
||||
|
||||
---@type Message
|
||||
local msg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = Heimdall_Data.config.spotter.notifyChannel,
|
||||
message = text
|
||||
}
|
||||
@@ -220,7 +220,7 @@ function shared.Spotter.Init()
|
||||
x * 100, y * 100)
|
||||
if Heimdall_Data.config.essencex.spotter and Heimdall_Data.config.essencex.enabled then
|
||||
local msg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = Heimdall_Data.config.essencex.masterChannel,
|
||||
message = text
|
||||
}
|
||||
@@ -234,7 +234,7 @@ function shared.Spotter.Init()
|
||||
if Heimdall_Data.config.echoToRussian then
|
||||
-- Russian message
|
||||
local ruMsg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = Heimdall_Data.config.spotter.notifyChannel .. "ru",
|
||||
message = text
|
||||
}
|
||||
|
@@ -64,8 +64,8 @@ function shared.StinkyTracker.Init()
|
||||
return stinkies
|
||||
end
|
||||
|
||||
local arrivedRegex = "([^ -/]+)-?%w* of class (%w+)"
|
||||
local arrivedRegexAlt = "([^ -/]+)-?%w* %(!!!!%) of class (%w+)"
|
||||
local arrivedRegex = "([^ -/]+)-?%w* c:(%w+)"
|
||||
local arrivedRegexAlt = "([^ -/]+)-?%w* %(!!!!%) c:(%w+)"
|
||||
---@param msg string
|
||||
---@return table<string, stinky>
|
||||
local function ParseArrived(msg)
|
||||
@@ -164,7 +164,7 @@ function shared.StinkyTracker.Init()
|
||||
end
|
||||
end
|
||||
end
|
||||
if string.find(msg, " and guild ") then
|
||||
if string.find(msg, "times: ") then
|
||||
if Heimdall_Data.config.stinkyTracker.debug then
|
||||
print(string.format("[%s] Processing ARRIVED message from %s", ModuleName, sender))
|
||||
end
|
||||
|
@@ -140,6 +140,7 @@ function shared.Whoer.Init()
|
||||
---@type WHOQuery[]
|
||||
local whoQueries = {
|
||||
WHOQuery.new("g-\"БеспредеЛ\"", {}),
|
||||
WHOQuery.new("g-\"ЗАО бещёки\"", {}),
|
||||
--WHOQuery.new("g-\"Dovahkin\"", {}),
|
||||
WHOQuery.new(
|
||||
"z-\"Orgrimmar\" z-\"Durotar\" z-\"Valley of Trials\" r-\"Human\" r-\"Dwarf\" r-\"Night Elf\"",
|
||||
@@ -194,7 +195,7 @@ function shared.Whoer.Init()
|
||||
|
||||
---@type Message
|
||||
local msg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = Heimdall_Data.config.who.notifyChannel,
|
||||
message = text
|
||||
}
|
||||
@@ -209,7 +210,7 @@ function shared.Whoer.Init()
|
||||
for _, name in pairs(Heimdall_Data.config.whisperNotify) do
|
||||
---@type Message
|
||||
local msg = {
|
||||
channel = "WHISPER",
|
||||
channel = "W",
|
||||
data = name,
|
||||
message = text
|
||||
}
|
||||
@@ -224,7 +225,7 @@ function shared.Whoer.Init()
|
||||
if Heimdall_Data.config.echoToRussian then
|
||||
-- Russian message
|
||||
local ruMsg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = Heimdall_Data.config.who.notifyChannel .. "ru",
|
||||
message = player:NotifyRu()
|
||||
}
|
||||
@@ -264,7 +265,7 @@ function shared.Whoer.Init()
|
||||
|
||||
---@type Message
|
||||
local msg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = Heimdall_Data.config.who.notifyChannel,
|
||||
message = text
|
||||
}
|
||||
@@ -281,7 +282,7 @@ function shared.Whoer.Init()
|
||||
|
||||
---@type Message
|
||||
msg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = Heimdall_Data.config.who.notifyChannel .. "ru",
|
||||
message = text
|
||||
}
|
||||
@@ -298,7 +299,7 @@ function shared.Whoer.Init()
|
||||
for _, name in pairs(Heimdall_Data.config.whisperNotify) do
|
||||
---@type Message
|
||||
local msg = {
|
||||
channel = "WHISPER",
|
||||
channel = "W",
|
||||
data = name,
|
||||
message = text
|
||||
}
|
||||
@@ -327,7 +328,7 @@ function shared.Whoer.Init()
|
||||
|
||||
---@type Message
|
||||
local msg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = Heimdall_Data.config.who.notifyChannel,
|
||||
message = text
|
||||
}
|
||||
@@ -342,7 +343,7 @@ function shared.Whoer.Init()
|
||||
|
||||
---@type Message
|
||||
msg = {
|
||||
channel = "CHANNEL",
|
||||
channel = "C",
|
||||
data = Heimdall_Data.config.who.notifyChannel .. "ru",
|
||||
message = text
|
||||
}
|
||||
@@ -359,7 +360,7 @@ function shared.Whoer.Init()
|
||||
for _, name in pairs(Heimdall_Data.config.whisperNotify) do
|
||||
---@type Message
|
||||
local msg = {
|
||||
channel = "WHISPER",
|
||||
channel = "W",
|
||||
data = name,
|
||||
message = text
|
||||
}
|
||||
|
Reference in New Issue
Block a user