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:
2025-01-24 20:35:49 +01:00
parent 036b6b23a8
commit 30068a5b11
12 changed files with 33 additions and 29 deletions

View File

@@ -6,6 +6,7 @@ local ModuleName = "AgentTracker"
---@diagnostic disable-next-line: missing-fields ---@diagnostic disable-next-line: missing-fields
shared.AgentTracker = {} shared.AgentTracker = {}
function shared.AgentTracker.Init() function shared.AgentTracker.Init()
--/run Heimdall_Data.config.agents["Cyheuraeth"]=date("%Y-%m-%dT%H:%M:%S")
---@type table<string, boolean> ---@type table<string, boolean>
local channelRosterFrame = CreateFrame("Frame") local channelRosterFrame = CreateFrame("Frame")
channelRosterFrame:RegisterEvent("CHANNEL_ROSTER_UPDATE") channelRosterFrame:RegisterEvent("CHANNEL_ROSTER_UPDATE")

View File

@@ -93,7 +93,7 @@ function shared.BonkDetector.Init()
end end
---@type Message ---@type Message
local message = { local message = {
channel = "CHANNEL", channel = "C",
data = notifyChannel, data = notifyChannel,
message = string.format(shared.L.en.bonkDetected, source, destination, subevent), message = string.format(shared.L.en.bonkDetected, source, destination, subevent),
} }
@@ -105,7 +105,7 @@ function shared.BonkDetector.Init()
if Heimdall_Data.config.echoToRussian then if Heimdall_Data.config.echoToRussian then
-- Russian message -- Russian message
local ruMessage = { local ruMessage = {
channel = "CHANNEL", channel = "C",
data = notifyChannel .. "ru", data = notifyChannel .. "ru",
message = string.format(shared.L.ru.bonkDetected, source, destination, subevent), message = string.format(shared.L.ru.bonkDetected, source, destination, subevent),
} }

View File

@@ -71,7 +71,7 @@ function shared.CombatAlerter.Init()
SetMapByID(GetCurrentMapAreaID()) SetMapByID(GetCurrentMapAreaID())
---@type Message ---@type Message
local msg = { local msg = {
channel = "CHANNEL", channel = "C",
data = Heimdall_Data.config.combatAlerter.masterChannel, data = Heimdall_Data.config.combatAlerter.masterChannel,
message = string.format(shared.L.en.combatAlerterInCombat, message = string.format(shared.L.en.combatAlerterInCombat,
source, source,
@@ -97,7 +97,7 @@ function shared.CombatAlerter.Init()
if Heimdall_Data.config.echoToRussian then if Heimdall_Data.config.echoToRussian then
-- Russian message -- Russian message
local ruMsg = { local ruMsg = {
channel = "CHANNEL", channel = "C",
data = Heimdall_Data.config.combatAlerter.masterChannel .. "ru", data = Heimdall_Data.config.combatAlerter.masterChannel .. "ru",
message = string.format(shared.L.ru.combatAlerterInCombat, message = string.format(shared.L.ru.combatAlerterInCombat,
source, source,

View File

@@ -307,7 +307,7 @@ function shared.Commander.Init()
for _, message in ipairs(messages) do for _, message in ipairs(messages) do
---@type Message ---@type Message
local msg = { local msg = {
channel = "CHANNEL", channel = "C",
data = channelname, data = channelname,
message = message message = message
} }

View File

@@ -94,7 +94,7 @@ function shared.DeathReporter.Init()
---@type Message ---@type Message
local msg = { local msg = {
channel = "CHANNEL", channel = "C",
data = Heimdall_Data.config.deathReporter.masterChannel, data = Heimdall_Data.config.deathReporter.masterChannel,
message = string.format(shared.L.en.killed, message = string.format(shared.L.en.killed,
source, source,
@@ -121,7 +121,7 @@ function shared.DeathReporter.Init()
if Heimdall_Data.config.echoToRussian then if Heimdall_Data.config.echoToRussian then
-- Russian message -- Russian message
local ruMsg = { local ruMsg = {
channel = "CHANNEL", channel = "C",
data = Heimdall_Data.config.deathReporter.masterChannel .. "ru", data = Heimdall_Data.config.deathReporter.masterChannel .. "ru",
message = string.format(shared.L.ru.killed, message = string.format(shared.L.ru.killed,
source, source,

View File

@@ -64,6 +64,11 @@ function shared.Messenger.Init()
end end
return return
end 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 message.channel == "CHANNEL" and message.data and string.match(message.data, "%D") then
if Heimdall_Data.config.messenger.debug 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)) print(string.format("[%s] Message too long!!!!: %s", ModuleName, message.message))
return return
end end
if string.find(message.channel, "^C") then
message.channel = "CHANNEL"
end
SendChatMessage(message.message, message.channel, nil, message.data) SendChatMessage(message.message, message.channel, nil, message.data)
end end
local function Tick() local function Tick()

View File

@@ -165,7 +165,7 @@ function shared.NetworkMessenger.Init()
--/run Heimdall_Data.Test() --/run Heimdall_Data.Test()
Heimdall_Data.Test = function() Heimdall_Data.Test = function()
local testmsg = { local testmsg = {
channel = "WHISPER", channel = "W",
message = "Hi, mom!", message = "Hi, mom!",
data = "Secundus" data = "Secundus"
} }

View File

@@ -115,7 +115,7 @@ function shared.Noter.Init()
end end
---@type Message ---@type Message
local msg = { local msg = {
channel = "CHANNEL", channel = "C",
data = Heimdall_Data.config.noter.masterChannel, data = Heimdall_Data.config.noter.masterChannel,
message = string.format("[%s][%d] %s: %s", note.source, index, note.date, note.note) message = string.format("[%s][%d] %s: %s", note.source, index, note.date, note.note)
} }

View File

@@ -31,7 +31,7 @@ function shared.Sniffer.Init()
end end
smellThrottle[stinky] = GetTime() smellThrottle[stinky] = GetTime()
local msg = { local msg = {
channel = "CHANNEL", channel = "C",
data = Heimdall_Data.config.deathReporter.notifyChannel, data = Heimdall_Data.config.deathReporter.notifyChannel,
message = string.format(shared.L.en.snifferStinky, stinky), message = string.format(shared.L.en.snifferStinky, stinky),
} }
@@ -44,7 +44,7 @@ function shared.Sniffer.Init()
if Heimdall_Data.config.echoToRussian then if Heimdall_Data.config.echoToRussian then
-- Russian message -- Russian message
local ruMsg = { local ruMsg = {
channel = "CHANNEL", channel = "C",
data = Heimdall_Data.config.deathReporter.notifyChannel .. "ru", data = Heimdall_Data.config.deathReporter.notifyChannel .. "ru",
message = string.format(shared.L.ru.snifferStinky, stinky), message = string.format(shared.L.ru.snifferStinky, stinky),
} }

View File

@@ -177,7 +177,7 @@ function shared.Spotter.Init()
---@type Message ---@type Message
local msg = { local msg = {
channel = "CHANNEL", channel = "C",
data = Heimdall_Data.config.spotter.notifyChannel, data = Heimdall_Data.config.spotter.notifyChannel,
message = text message = text
} }
@@ -220,7 +220,7 @@ function shared.Spotter.Init()
x * 100, y * 100) x * 100, y * 100)
if Heimdall_Data.config.essencex.spotter and Heimdall_Data.config.essencex.enabled then if Heimdall_Data.config.essencex.spotter and Heimdall_Data.config.essencex.enabled then
local msg = { local msg = {
channel = "CHANNEL", channel = "C",
data = Heimdall_Data.config.essencex.masterChannel, data = Heimdall_Data.config.essencex.masterChannel,
message = text message = text
} }
@@ -234,7 +234,7 @@ function shared.Spotter.Init()
if Heimdall_Data.config.echoToRussian then if Heimdall_Data.config.echoToRussian then
-- Russian message -- Russian message
local ruMsg = { local ruMsg = {
channel = "CHANNEL", channel = "C",
data = Heimdall_Data.config.spotter.notifyChannel .. "ru", data = Heimdall_Data.config.spotter.notifyChannel .. "ru",
message = text message = text
} }

View File

@@ -64,8 +64,8 @@ function shared.StinkyTracker.Init()
return stinkies return stinkies
end end
local arrivedRegex = "([^ -/]+)-?%w* of class (%w+)" local arrivedRegex = "([^ -/]+)-?%w* c:(%w+)"
local arrivedRegexAlt = "([^ -/]+)-?%w* %(!!!!%) of class (%w+)" local arrivedRegexAlt = "([^ -/]+)-?%w* %(!!!!%) c:(%w+)"
---@param msg string ---@param msg string
---@return table<string, stinky> ---@return table<string, stinky>
local function ParseArrived(msg) local function ParseArrived(msg)
@@ -164,7 +164,7 @@ function shared.StinkyTracker.Init()
end end
end end
end end
if string.find(msg, " and guild ") then if string.find(msg, "times: ") then
if Heimdall_Data.config.stinkyTracker.debug then if Heimdall_Data.config.stinkyTracker.debug then
print(string.format("[%s] Processing ARRIVED message from %s", ModuleName, sender)) print(string.format("[%s] Processing ARRIVED message from %s", ModuleName, sender))
end end

View File

@@ -140,6 +140,7 @@ function shared.Whoer.Init()
---@type WHOQuery[] ---@type WHOQuery[]
local whoQueries = { local whoQueries = {
WHOQuery.new("g-\"БеспредеЛ\"", {}), WHOQuery.new("g-\"БеспредеЛ\"", {}),
WHOQuery.new("g-\"ЗАО бещёки\"", {}),
--WHOQuery.new("g-\"Dovahkin\"", {}), --WHOQuery.new("g-\"Dovahkin\"", {}),
WHOQuery.new( WHOQuery.new(
"z-\"Orgrimmar\" z-\"Durotar\" z-\"Valley of Trials\" r-\"Human\" r-\"Dwarf\" r-\"Night Elf\"", "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 ---@type Message
local msg = { local msg = {
channel = "CHANNEL", channel = "C",
data = Heimdall_Data.config.who.notifyChannel, data = Heimdall_Data.config.who.notifyChannel,
message = text message = text
} }
@@ -209,7 +210,7 @@ function shared.Whoer.Init()
for _, name in pairs(Heimdall_Data.config.whisperNotify) do for _, name in pairs(Heimdall_Data.config.whisperNotify) do
---@type Message ---@type Message
local msg = { local msg = {
channel = "WHISPER", channel = "W",
data = name, data = name,
message = text message = text
} }
@@ -224,7 +225,7 @@ function shared.Whoer.Init()
if Heimdall_Data.config.echoToRussian then if Heimdall_Data.config.echoToRussian then
-- Russian message -- Russian message
local ruMsg = { local ruMsg = {
channel = "CHANNEL", channel = "C",
data = Heimdall_Data.config.who.notifyChannel .. "ru", data = Heimdall_Data.config.who.notifyChannel .. "ru",
message = player:NotifyRu() message = player:NotifyRu()
} }
@@ -264,7 +265,7 @@ function shared.Whoer.Init()
---@type Message ---@type Message
local msg = { local msg = {
channel = "CHANNEL", channel = "C",
data = Heimdall_Data.config.who.notifyChannel, data = Heimdall_Data.config.who.notifyChannel,
message = text message = text
} }
@@ -281,7 +282,7 @@ function shared.Whoer.Init()
---@type Message ---@type Message
msg = { msg = {
channel = "CHANNEL", channel = "C",
data = Heimdall_Data.config.who.notifyChannel .. "ru", data = Heimdall_Data.config.who.notifyChannel .. "ru",
message = text message = text
} }
@@ -298,7 +299,7 @@ function shared.Whoer.Init()
for _, name in pairs(Heimdall_Data.config.whisperNotify) do for _, name in pairs(Heimdall_Data.config.whisperNotify) do
---@type Message ---@type Message
local msg = { local msg = {
channel = "WHISPER", channel = "W",
data = name, data = name,
message = text message = text
} }
@@ -327,7 +328,7 @@ function shared.Whoer.Init()
---@type Message ---@type Message
local msg = { local msg = {
channel = "CHANNEL", channel = "C",
data = Heimdall_Data.config.who.notifyChannel, data = Heimdall_Data.config.who.notifyChannel,
message = text message = text
} }
@@ -342,7 +343,7 @@ function shared.Whoer.Init()
---@type Message ---@type Message
msg = { msg = {
channel = "CHANNEL", channel = "C",
data = Heimdall_Data.config.who.notifyChannel .. "ru", data = Heimdall_Data.config.who.notifyChannel .. "ru",
message = text message = text
} }
@@ -359,7 +360,7 @@ function shared.Whoer.Init()
for _, name in pairs(Heimdall_Data.config.whisperNotify) do for _, name in pairs(Heimdall_Data.config.whisperNotify) do
---@type Message ---@type Message
local msg = { local msg = {
channel = "WHISPER", channel = "W",
data = name, data = name,
message = text message = text
} }