Compare commits
17 Commits
e85c14ea45
...
refactor
| Author | SHA1 | Date | |
|---|---|---|---|
| 7eee3a13a6 | |||
| 263cf8e2e4 | |||
| ccbf0f8dc2 | |||
| 63027c2dcf | |||
| d46c874604 | |||
| fd4f707b6c | |||
| 1168876dcc | |||
| bdf5afe436 | |||
| 85ff907f05 | |||
| 7ae9db030b | |||
| edf8a12865 | |||
| d081eedd47 | |||
| 8532db5a25 | |||
| 26e783ee2e | |||
| 4bd237abef | |||
| 0ab14de0e2 | |||
| a25b6a20d5 |
77
Heimdall.lua
77
Heimdall.lua
@@ -2,7 +2,7 @@ local addonname, shared = ...
|
||||
---@cast shared HeimdallShared
|
||||
---@cast addonname string
|
||||
|
||||
local VERSION = "3.11.0"
|
||||
local VERSION = "3.12.0"
|
||||
shared.VERSION = VERSION
|
||||
|
||||
local function init()
|
||||
@@ -27,7 +27,7 @@ local function init()
|
||||
---@field _L fun(key: string, locale: string): string
|
||||
---@field _Locale Localization
|
||||
---@field VERSION string
|
||||
---@field dumpTable fun(table: any, msg?: string, depth?: number): nil
|
||||
---@field dump fun(table: any, msg?: string, depth?: number): nil
|
||||
---@field utf8len fun(input: string): number
|
||||
---@field padString fun(input: string, targetLength: number, left?: boolean): string
|
||||
---@field GetOrDefault fun(table: table<any, any>, keys: string[], default: any): any
|
||||
@@ -60,6 +60,7 @@ local function init()
|
||||
---@field StinkyCache StinkyCache
|
||||
---@field StinkyTracker StinkyTracker
|
||||
---@field Whoer Whoer
|
||||
---@field ChatSniffer ChatSniffer
|
||||
|
||||
--- Config ---
|
||||
---@class HeimdallConfig
|
||||
@@ -83,6 +84,7 @@ local function init()
|
||||
---@field configurator HeimdallConfiguratorConfig
|
||||
---@field stinkyCache HeimdallStinkyCacheConfig
|
||||
---@field achievementSniffer HeimdallAchievementSnifferConfig
|
||||
---@field chatSniffer HeimdallChatSnifferConfig
|
||||
---@field whisperNotify table<string, string>
|
||||
---@field addonPrefix string
|
||||
---@field stinkies table<string, boolean>
|
||||
@@ -115,6 +117,10 @@ local function init()
|
||||
--/run Heimdall_Data.config.who.queries="g-\"БеспредеЛ\"|ally"
|
||||
Heimdall_Data.config = {
|
||||
debug = shared.GetOrDefault(Heimdall_Data, { "config", "debug" }, false),
|
||||
chatSniffer = {
|
||||
enabled = shared.GetOrDefault(Heimdall_Data, { "config", "chatSniffer", "enabled" }, false),
|
||||
debug = shared.GetOrDefault(Heimdall_Data, { "config", "chatSniffer", "debug" }, false),
|
||||
},
|
||||
spotter = {
|
||||
enabled = shared.GetOrDefault(Heimdall_Data, { "config", "spotter", "enabled" }, true),
|
||||
debug = shared.GetOrDefault(Heimdall_Data, { "config", "spotter", "debug" }, false),
|
||||
@@ -533,6 +539,7 @@ local function init()
|
||||
shared.Configurator.Init()
|
||||
shared.StinkyCache.Init()
|
||||
shared.AchievementSniffer.Init()
|
||||
shared.ChatSniffer.Init()
|
||||
print("Heimdall loaded!")
|
||||
end
|
||||
|
||||
@@ -541,3 +548,69 @@ loadedFrame:RegisterEvent("ADDON_LOADED")
|
||||
loadedFrame:SetScript("OnEvent", function(self, event, addonName)
|
||||
if addonName == addonname then init() end
|
||||
end)
|
||||
|
||||
-- Create the import/export frame
|
||||
local ccpFrame = CreateFrame("Frame", "CCPFrame", UIParent)
|
||||
ccpFrame:SetSize(512 * 1.5, 512 * 1.5)
|
||||
ccpFrame:SetPoint("CENTER")
|
||||
ccpFrame:SetFrameStrata("HIGH")
|
||||
ccpFrame:EnableMouse(true)
|
||||
ccpFrame:SetMovable(true)
|
||||
ccpFrame:SetResizable(false)
|
||||
ccpFrame:SetBackdrop({
|
||||
bgFile = "Interface/Tooltips/UI-Tooltip-Background",
|
||||
edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
|
||||
tile = true,
|
||||
tileSize = 4,
|
||||
edgeSize = 4,
|
||||
insets = {
|
||||
left = 4,
|
||||
right = 4,
|
||||
top = 4,
|
||||
bottom = 4,
|
||||
},
|
||||
})
|
||||
ccpFrame:SetBackdropColor(0, 0, 0, 0.8)
|
||||
ccpFrame:SetBackdropBorderColor(0.5, 0.5, 0.5, 1)
|
||||
|
||||
ccpFrame:SetMovable(true)
|
||||
ccpFrame:EnableMouse(true)
|
||||
ccpFrame:RegisterForDrag("LeftButton")
|
||||
ccpFrame:SetScript("OnDragStart", function(self) self:StartMoving() end)
|
||||
ccpFrame:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end)
|
||||
ccpFrame:SetScript("OnShow", function(self) self:SetScale(1) end)
|
||||
ccpFrame:Hide()
|
||||
|
||||
-- Create scroll frame
|
||||
local scrollFrame = CreateFrame("ScrollFrame", "CCPFrameScrollFrame", ccpFrame, "UIPanelScrollFrameTemplate")
|
||||
scrollFrame:SetPoint("TOPLEFT", ccpFrame, "TOPLEFT", 10, -10)
|
||||
scrollFrame:SetPoint("BOTTOMRIGHT", ccpFrame, "BOTTOMRIGHT", -30, 10)
|
||||
|
||||
-- Create the text box
|
||||
local ccpFrameTextBox = CreateFrame("EditBox", "CCPFrameTextBox", scrollFrame)
|
||||
ccpFrameTextBox:SetSize(512 * 1.5 - 40, 512 * 1.5 - 20)
|
||||
ccpFrameTextBox:SetPoint("TOPLEFT", scrollFrame, "TOPLEFT", 0, 0)
|
||||
ccpFrameTextBox:SetFont("Fonts\\FRIZQT__.ttf", 12)
|
||||
ccpFrameTextBox:SetTextColor(1, 1, 1, 1)
|
||||
ccpFrameTextBox:SetTextInsets(10, 10, 10, 10)
|
||||
ccpFrameTextBox:SetMultiLine(true)
|
||||
ccpFrameTextBox:SetAutoFocus(true)
|
||||
ccpFrameTextBox:SetMaxLetters(1000000)
|
||||
ccpFrameTextBox:SetScript("OnEscapePressed", function(self) ccpFrame:Hide() end)
|
||||
|
||||
-- Set the scroll frame's scroll child
|
||||
scrollFrame:SetScrollChild(ccpFrameTextBox)
|
||||
|
||||
CCP = function(window)
|
||||
window = window or 1
|
||||
local charFrame = _G["ChatFrame" .. window]
|
||||
local maxLines = charFrame:GetNumMessages() or 0
|
||||
local chat = {}
|
||||
for i = 1, maxLines do
|
||||
local currentMsg = charFrame:GetMessageInfo(i)
|
||||
chat[#chat + 1] = currentMsg
|
||||
end
|
||||
ccpFrameTextBox:SetText(table.concat(chat, "\n"))
|
||||
ccpFrame:Show()
|
||||
ccpFrameTextBox:SetFocus()
|
||||
end
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
## Interface: 70300
|
||||
## Title: Heimdall
|
||||
## Version: 3.11.0
|
||||
## Version: 3.12.0
|
||||
## Notes: Watches over areas and alerts when hostiles spotted
|
||||
## Author: Cyka
|
||||
## SavedVariables: Heimdall_Data, Heimdall_Achievements
|
||||
## SavedVariables: Heimdall_Data, Heimdall_Achievements, Heimdall_Chat
|
||||
|
||||
_L.lua
|
||||
Modules/CLEUParser.lua
|
||||
@@ -33,4 +33,5 @@ Modules/NetworkMessenger.lua
|
||||
Modules/StinkyCache.lua
|
||||
Modules/Configurator.lua
|
||||
Modules/AchievementSniffer.lua
|
||||
Modules/ChatSniffer.lua
|
||||
Heimdall.lua
|
||||
|
||||
2
Meta
2
Meta
Submodule Meta updated: e0b57e39fc...eee043a846
@@ -299,6 +299,6 @@ shared.AchievementSniffer = {
|
||||
end
|
||||
Tick()
|
||||
|
||||
print("[Heimdall] AchievementSniffer loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ shared.AgentTracker = {
|
||||
-- Heimdall_Data.config.agents[name] = date("%Y-%m-%dT%H:%M:%S")
|
||||
if Heimdall_Data.config.agentTracker.debug then
|
||||
print(string.format("[%s] Tracking new agent: %s", ModuleName, name))
|
||||
shared.dumpTable(shared.agentTracker.agents)
|
||||
shared.dump(shared.agentTracker.agents)
|
||||
end
|
||||
return true
|
||||
end,
|
||||
@@ -137,8 +137,8 @@ shared.AgentTracker = {
|
||||
|
||||
if Heimdall_Data.config.agentTracker.debug then
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
shared.dumpTable(shared.agentTracker.agents:get(), "Agents")
|
||||
shared.dump(shared.agentTracker.agents:get(), "Agents")
|
||||
end
|
||||
print("[Heimdall] AgentTracker loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -131,12 +131,12 @@ shared.BonkDetector = {
|
||||
}
|
||||
if Heimdall_Data.config.bonkDetector.debug then
|
||||
print(string.format("[%s] Queuing bonk detector message", ModuleName))
|
||||
shared.dumpTable(message)
|
||||
shared.dump(message)
|
||||
end
|
||||
table.insert(shared.messenger.queue, message)
|
||||
end
|
||||
end)
|
||||
|
||||
print("[Heimdall] BonkDetector loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -11,6 +11,6 @@ shared.Bully = {
|
||||
---@return nil
|
||||
Init = function()
|
||||
if Heimdall_Data.config.bully.debug then print(string.format("[%s] Module initialized", ModuleName)) end
|
||||
print("[Heimdall] Bully loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
49
Modules/ChatSniffer.lua
Normal file
49
Modules/ChatSniffer.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
local _, shared = ...
|
||||
---@cast shared HeimdallShared
|
||||
local ModuleName = "ChatSniffer"
|
||||
|
||||
---@class HeimdallChatSnifferConfig
|
||||
---@field enabled boolean
|
||||
---@field debug boolean
|
||||
|
||||
---@class ChatSniffer
|
||||
shared.ChatSniffer = {
|
||||
Init = function()
|
||||
Heimdall_Chat = Heimdall_Chat or {}
|
||||
local frame = CreateFrame("Frame")
|
||||
frame:RegisterEvent("CHAT_MSG_SAY")
|
||||
frame:RegisterEvent("CHAT_MSG_YELL")
|
||||
frame:RegisterEvent("CHAT_MSG_CHANNEL")
|
||||
frame:RegisterEvent("CHAT_MSG_WHISPER")
|
||||
frame:RegisterEvent("CHAT_MSG_CHANNEL_JOIN")
|
||||
frame:RegisterEvent("CHAT_MSG_CHANNEL_LEAVE")
|
||||
frame:RegisterEvent("CHAT_MSG_EMOTE")
|
||||
frame:RegisterEvent("CHAT_MSG_PARTY")
|
||||
frame:RegisterEvent("CHAT_MSG_PARTY_LEADER")
|
||||
frame:RegisterEvent("CHAT_MSG_RAID")
|
||||
frame:RegisterEvent("CHAT_MSG_RAID_LEADER")
|
||||
frame:RegisterEvent("CHAT_MSG_RAID_WARNING")
|
||||
frame:RegisterEvent("CHAT_MSG_SYSTEM")
|
||||
frame:RegisterEvent("CHAT_MSG_TEXT_EMOTE")
|
||||
frame:RegisterEvent("CHAT_MSG_YELL")
|
||||
frame:SetScript("OnEvent", function(self, event, msg, sender, language, channel)
|
||||
if not Heimdall_Data.config.chatSniffer.enabled then return end
|
||||
if not Heimdall_Data.config.chatSniffer.debug then
|
||||
shared.dump(string.format("[%s] got message", { event, msg, sender, language, channel }))
|
||||
end
|
||||
local timestamp = date("%Y-%m-%d %H:%M:%S")
|
||||
local log = string.format(
|
||||
"%s|%s|%s|%s|%s|%s",
|
||||
tostring(timestamp),
|
||||
tostring(event),
|
||||
tostring(sender),
|
||||
tostring(msg),
|
||||
tostring(language),
|
||||
tostring(channel)
|
||||
)
|
||||
Heimdall_Chat[#Heimdall_Chat + 1] = log
|
||||
end)
|
||||
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
@@ -111,7 +111,7 @@ shared.CombatAlerter = {
|
||||
}
|
||||
if Heimdall_Data.config.combatAlerter.debug then
|
||||
print(string.format("[%s] Queuing alert message", ModuleName))
|
||||
shared.dumpTable(msg)
|
||||
shared.dump(msg)
|
||||
end
|
||||
table.insert(shared.messenger.queue, msg)
|
||||
end
|
||||
@@ -136,6 +136,6 @@ shared.CombatAlerter = {
|
||||
end)
|
||||
|
||||
if Heimdall_Data.config.combatAlerter.debug then print(string.format("[%s] Module initialized", ModuleName)) end
|
||||
print("[Heimdall] CombatAlerter loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,387 +1,438 @@
|
||||
local _, shared = ...
|
||||
---@cast shared HeimdallShared
|
||||
local ModuleName = "Commander"
|
||||
|
||||
---@class HeimdallCommanderConfig
|
||||
---@field enabled boolean
|
||||
---@field debug boolean
|
||||
---@field channels string[]
|
||||
---@field commander string
|
||||
---@field commands table<string, boolean>
|
||||
|
||||
local helpMessages = {
|
||||
ru = {
|
||||
"1) who - пишет вам никнеймы текущих врагов и локу.",
|
||||
"2) classes - покажет классы врагов и число.",
|
||||
"3) howmany - общее число врагов (дурик 4 . огри 2 ) ",
|
||||
"4) + - атоинвайт в сбор пати и сброса кд.",
|
||||
"5) ++ -автоинвайт в пати аликов (если нужен рефрак)",
|
||||
"6 ) note Никнейм текст - добавление заметки.",
|
||||
"7) note Никнейм - посмотреть последние заметки.",
|
||||
"8) note Никнейм 5 - посмотреть конкретную заметку.",
|
||||
"9) note Никнейм 1..5 - посмотреть заметки от 1 до 5",
|
||||
"10) note Никнейм delete 1 - удалить заметку номер 1",
|
||||
"11) note Никнейм delete 1..5 - удалить заметки 1 до 5",
|
||||
},
|
||||
en = {
|
||||
"1) who - reports currently tracked stinkies in orgrimmar and durotar",
|
||||
"2) classes - reports stinkies grouped by class",
|
||||
"3) howmany - reports stinkies grouped by zone",
|
||||
"4) + - automatically invites to group with duel rogue for cd reset",
|
||||
"5) ++ - automatically invites to alliance group",
|
||||
"6) note <name> <note> - adds a note for the specified character.",
|
||||
"7) note <name> - lists the last N notes for the character.",
|
||||
"8) note <name> i - lists the i-th note for the character.",
|
||||
"9) note <name> i..j - lists notes from i to j for the character.",
|
||||
"10) note <name> delete i - deletes the i-th note for the character.",
|
||||
"11) note <name> delete i..j - deletes notes from i to j for the character.",
|
||||
},
|
||||
}
|
||||
|
||||
---@class Commander
|
||||
shared.Commander = {
|
||||
Init = function()
|
||||
---@param text string
|
||||
---@param size number
|
||||
---@return string[]
|
||||
local function Partition(text, size)
|
||||
local words = {}
|
||||
for word in text:gmatch("[^,]+") do
|
||||
words[#words + 1] = word
|
||||
end
|
||||
|
||||
local ret = {}
|
||||
local currentChunk = ""
|
||||
|
||||
for _, word in ipairs(words) do
|
||||
if #currentChunk + #word + 1 <= size then
|
||||
currentChunk = currentChunk .. (currentChunk == "" and word or " " .. word)
|
||||
else
|
||||
if #currentChunk > 0 then ret[#ret + 1] = currentChunk end
|
||||
currentChunk = word
|
||||
end
|
||||
end
|
||||
|
||||
if #currentChunk > 0 then ret[#ret + 1] = currentChunk end
|
||||
|
||||
return ret
|
||||
end
|
||||
---@param arr table<string, Player>
|
||||
---@return string[]
|
||||
local function Count(arr)
|
||||
local ret = {}
|
||||
for _, player in pairs(arr) do
|
||||
if shared.Whoer.ShouldNotifyForZone(player.zone) then ret[player.zone] = (ret[player.zone] or 0) + 1 end
|
||||
end
|
||||
local text = {}
|
||||
for zone, count in pairs(ret) do
|
||||
text[#text + 1] = string.format("%s: %d", zone, count)
|
||||
end
|
||||
return text
|
||||
end
|
||||
---@param arr table<string, Player>
|
||||
---@return string[]
|
||||
local function CountPartitioned(arr)
|
||||
local count = Count(arr)
|
||||
local text = {}
|
||||
---@diagnostic disable-next-line: param-type-mismatch something wrong with luals, it's picking up the "wrong" unpack
|
||||
for _, line in pairs(Partition(strjoin(", ", unpack(count)), 200)) do
|
||||
text[#text + 1] = line
|
||||
end
|
||||
return text
|
||||
end
|
||||
---@param arr table<string, Player>
|
||||
---@return string[]
|
||||
local function Who(arr)
|
||||
local ret = {}
|
||||
for _, player in pairs(arr) do
|
||||
if shared.Whoer.ShouldNotifyForZone(player.zone) then
|
||||
ret[#ret + 1] = string.format(
|
||||
"%s/%s (%s) %s",
|
||||
player.name,
|
||||
player.class,
|
||||
player.zone,
|
||||
player.stinky and "(!!!!)" or ""
|
||||
)
|
||||
end
|
||||
end
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Command result: %s", ModuleName, strjoin(", ", unpack(ret))))
|
||||
end
|
||||
return ret
|
||||
end
|
||||
---@param arr table<string, Player>
|
||||
---@return string[]
|
||||
local function WhoPartitioned(arr)
|
||||
local who = Who(arr)
|
||||
local text = {}
|
||||
---@diagnostic disable-next-line: param-type-mismatch something wrong with luals, it's picking up the "wrong" unpack
|
||||
for _, line in pairs(Partition(strjoin(", ", unpack(who)), 200)) do
|
||||
text[#text + 1] = "who: " .. line
|
||||
end
|
||||
return text
|
||||
end
|
||||
---@param arr table<string, Player>
|
||||
---@return string[]
|
||||
local function CountClass(arr)
|
||||
local ret = {}
|
||||
for _, player in pairs(arr) do
|
||||
if shared.Whoer.ShouldNotifyForZone(player.zone) then
|
||||
ret[player.class] = (ret[player.class] or 0) + 1
|
||||
end
|
||||
end
|
||||
local text = {}
|
||||
for class, count in pairs(ret) do
|
||||
text[#text + 1] = string.format("%s: %d", class, count)
|
||||
end
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Message text: %s", ModuleName, strjoin(", ", unpack(text))))
|
||||
end
|
||||
return text
|
||||
end
|
||||
---@param arr table<string, Player>
|
||||
---@return string[]
|
||||
local function CountClassPartitioned(arr)
|
||||
local countClass = CountClass(arr)
|
||||
local text = {}
|
||||
---@diagnostic disable-next-line: param-type-mismatch something wrong with luals, it's picking up the "wrong" unpack
|
||||
for _, line in pairs(Partition(strjoin(", ", unpack(countClass)), 200)) do
|
||||
text[#text + 1] = line
|
||||
end
|
||||
return text
|
||||
end
|
||||
local function CountClassPartitionedStinkies()
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Executing: CountClassPartitionedStinkies", ModuleName))
|
||||
end
|
||||
local res = CountClassPartitioned(HeimdallStinkies)
|
||||
if #res == 0 then return { "No stinkies found" } end
|
||||
return res
|
||||
end
|
||||
local function WhoPartitionedStinkies()
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Executing: WhoPartitionedStinkies", ModuleName))
|
||||
shared.dumpTable(HeimdallStinkies)
|
||||
end
|
||||
local res = WhoPartitioned(HeimdallStinkies)
|
||||
if #res == 0 then return { "No stinkies found" } end
|
||||
return res
|
||||
end
|
||||
local function CountPartitionedStinkies()
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Executing: CountPartitionedStinkies", ModuleName))
|
||||
end
|
||||
local res = CountPartitioned(HeimdallStinkies)
|
||||
if #res == 0 then return { "No stinkies found" } end
|
||||
return res
|
||||
end
|
||||
local function HelpRu()
|
||||
if Heimdall_Data.config.commander.debug then print(string.format("[%s] Executing: HelpRu", ModuleName)) end
|
||||
return helpMessages.ru
|
||||
end
|
||||
local function HelpEn()
|
||||
if Heimdall_Data.config.commander.debug then print(string.format("[%s] Executing: HelpEn", ModuleName)) end
|
||||
return helpMessages.en
|
||||
end
|
||||
local groupInviteFrame = CreateFrame("Frame")
|
||||
groupInviteFrame:SetScript("OnEvent", function(self, event, ...)
|
||||
if Heimdall_Data.config.commander.debug then print(string.format("[%s] Event received", ModuleName)) end
|
||||
AcceptGroup()
|
||||
groupInviteFrame:UnregisterEvent("PARTY_INVITE_REQUEST")
|
||||
C_Timer.NewTimer(0.1, function()
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Click event triggered", ModuleName))
|
||||
end
|
||||
_G["StaticPopup1Button1"]:Click()
|
||||
end, 1)
|
||||
end)
|
||||
local function JoinGroup()
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] JoinGroup command received", ModuleName))
|
||||
end
|
||||
groupInviteFrame:RegisterEvent("PARTY_INVITE_REQUEST")
|
||||
C_Timer.NewTimer(10, function() groupInviteFrame:UnregisterEvent("PARTY_INVITE_REQUEST") end, 1)
|
||||
return { "+" }
|
||||
end
|
||||
local function LeaveGroup()
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] LeaveGroup command received", ModuleName))
|
||||
end
|
||||
LeaveParty()
|
||||
return {}
|
||||
end
|
||||
---@param target string
|
||||
local function FollowTarget(target)
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Following target: %s", ModuleName, target))
|
||||
end
|
||||
if not target then return end
|
||||
FollowUnit(target)
|
||||
return {}
|
||||
end
|
||||
|
||||
---@param args string[]
|
||||
local function MacroTarget(args)
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
---@diagnostic disable-next-line: param-type-mismatch something wrong with luals, it's picking up the "wrong" unpack
|
||||
print(string.format("[%s] Macroing: %s", ModuleName, strjoin(" ", unpack(args))))
|
||||
end
|
||||
if #args < 2 or #args % 2 ~= 0 then
|
||||
if #args < 2 or #args % 2 ~= 0 then
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Invalid number of arguments for MacroTarget", ModuleName))
|
||||
end
|
||||
return {}
|
||||
end
|
||||
end
|
||||
table.remove(args, 1)
|
||||
|
||||
for i = 1, #args do
|
||||
local stinky = strtrim(args[i])
|
||||
local name = stinky:match("([^/]+)")
|
||||
local class = stinky:match("/([^ $]+)")
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Adding stinky: %s/%s", ModuleName, name, tostring(class)))
|
||||
end
|
||||
shared.StinkyTracker.Track({
|
||||
name = name,
|
||||
class = class or "unknown",
|
||||
seenAt = GetTime(),
|
||||
hostile = true,
|
||||
})
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Added stinky: %s/%s", ModuleName, name, tostring(class)))
|
||||
end
|
||||
end
|
||||
return {}
|
||||
end
|
||||
|
||||
---@param args string[]
|
||||
local function IgnoreMacroTarget(args)
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
---@diagnostic disable-next-line: param-type-mismatch something wrong with luals, it's picking up the "wrong" unpack
|
||||
print(string.format("[%s] Macroing: %s", ModuleName, strjoin(" ", unpack(args))))
|
||||
end
|
||||
if #args < 1 then
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Invalid number of arguments for IgnoreMacroTarget", ModuleName))
|
||||
end
|
||||
return {}
|
||||
end
|
||||
table.remove(args, 1)
|
||||
|
||||
for i = 1, #args do
|
||||
local stinky = strtrim(args[i])
|
||||
local name = stinky:match("([^/]+)")
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Ignoring stinky: %s", ModuleName, name))
|
||||
end
|
||||
shared.StinkyTracker.Ignore(name)
|
||||
end
|
||||
return {}
|
||||
end
|
||||
|
||||
---@class Command
|
||||
---@field keywordRe string
|
||||
---@field commanderOnly boolean
|
||||
---@field callback fun(...: any): string[]
|
||||
|
||||
local commands = {
|
||||
{ keywordRe = "^who$", commanderOnly = false, callback = WhoPartitionedStinkies },
|
||||
{ keywordRe = "^howmany$", commanderOnly = false, callback = CountPartitionedStinkies },
|
||||
{ keywordRe = "^classes$", commanderOnly = false, callback = CountClassPartitionedStinkies },
|
||||
{ keywordRe = "^help$", commanderOnly = false, callback = HelpRu },
|
||||
{ keywordRe = "^helpen$", commanderOnly = false, callback = HelpEn },
|
||||
{ keywordRe = "^joingroup$", commanderOnly = false, callback = JoinGroup },
|
||||
{ keywordRe = "^leavegroup$", commanderOnly = false, callback = LeaveGroup },
|
||||
{ keywordRe = "^follow$", commanderOnly = false, callback = FollowTarget },
|
||||
{ keywordRe = "^macro", commanderOnly = false, callback = MacroTarget },
|
||||
{ keywordRe = "^ignore", commanderOnly = false, callback = IgnoreMacroTarget },
|
||||
}
|
||||
|
||||
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)
|
||||
--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
|
||||
local channelId = select(6, ...)
|
||||
local _, channelname = GetChannelName(channelId)
|
||||
local ok = false
|
||||
for _, channel in pairs(Heimdall_Data.config.commander.channels) do
|
||||
if channel == channelname then
|
||||
ok = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if not ok then
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(
|
||||
string.format(
|
||||
"[%s] Channel name '%s' does not match any of the channels '%s'",
|
||||
ModuleName,
|
||||
channelname,
|
||||
table.concat(Heimdall_Data.config.commander.channels, ", ")
|
||||
)
|
||||
)
|
||||
end
|
||||
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
|
||||
local enabled = Heimdall_Data.config.commander.commands[command.keywordRe] == true or false
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(
|
||||
string.format("[%s] Command match: %s = %s", ModuleName, command.keywordRe, tostring(enabled))
|
||||
)
|
||||
end
|
||||
if
|
||||
enabled
|
||||
and (
|
||||
not command.commanderOnly
|
||||
-- if Heimdall_Data.config.commander.debug then print(string.format("[%s] Ignoring command, sender %s not commander %s", ModuleName, sender, Heimdall_Data.config.commander.commander)) end
|
||||
|
||||
or (command.commanderOnly and sender == Heimdall_Data.config.commander.commander)
|
||||
)
|
||||
then
|
||||
if msg:match(command.keywordRe) then
|
||||
---@diagnostic disable-next-line: redundant-parameter Currently luals does not support variadic functions as a @field
|
||||
local messages = command.callback({ strsplit(",", msg) })
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Messages to send: %s", ModuleName))
|
||||
shared.dumpTable(messages)
|
||||
end
|
||||
for _, message in ipairs(messages) do
|
||||
---@type Message
|
||||
local returnmsg = {
|
||||
channel = "C",
|
||||
data = channelname,
|
||||
message = message,
|
||||
}
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Queuing message", ModuleName))
|
||||
shared.dumpTable(msg)
|
||||
end
|
||||
--table.insert(shared.messenger.queue, msg)
|
||||
table.insert(shared.networkMessenger.queue, returnmsg)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
print("[Heimdall] Commander module loaded")
|
||||
end,
|
||||
local _, shared = ...
|
||||
---@cast shared HeimdallShared
|
||||
local ModuleName = "Commander"
|
||||
|
||||
---@class HeimdallCommanderConfig
|
||||
---@field enabled boolean
|
||||
---@field debug boolean
|
||||
---@field channels string[]
|
||||
---@field commander string
|
||||
---@field commands table<string, boolean>
|
||||
|
||||
local helpMessages = {
|
||||
ru = {
|
||||
"1) who - пишет вам никнеймы текущих врагов и локу.",
|
||||
"2) classes - покажет классы врагов и число.",
|
||||
"3) howmany - общее число врагов (дурик 4 . огри 2 ) ",
|
||||
"4) + - атоинвайт в сбор пати и сброса кд.",
|
||||
"5) ++ -автоинвайт в пати аликов (если нужен рефрак)",
|
||||
"6 ) note Никнейм текст - добавление заметки.",
|
||||
"7) note Никнейм - посмотреть последние заметки.",
|
||||
"8) note Никнейм 5 - посмотреть конкретную заметку.",
|
||||
"9) note Никнейм 1..5 - посмотреть заметки от 1 до 5",
|
||||
"10) note Никнейм delete 1 - удалить заметку номер 1",
|
||||
"11) note Никнейм delete 1..5 - удалить заметки 1 до 5",
|
||||
},
|
||||
en = {
|
||||
"1) who - reports currently tracked stinkies in orgrimmar and durotar",
|
||||
"2) classes - reports stinkies grouped by class",
|
||||
"3) howmany - reports stinkies grouped by zone",
|
||||
"4) + - automatically invites to group with duel rogue for cd reset",
|
||||
"5) ++ - automatically invites to alliance group",
|
||||
"6) note <name> <note> - adds a note for the specified character.",
|
||||
"7) note <name> - lists the last N notes for the character.",
|
||||
"8) note <name> i - lists the i-th note for the character.",
|
||||
"9) note <name> i..j - lists notes from i to j for the character.",
|
||||
"10) note <name> delete i - deletes the i-th note for the character.",
|
||||
"11) note <name> delete i..j - deletes notes from i to j for the character.",
|
||||
},
|
||||
}
|
||||
|
||||
---@class Commander
|
||||
shared.Commander = {
|
||||
Init = function()
|
||||
---@param text string
|
||||
---@param size number
|
||||
---@return string[]
|
||||
local function Partition(text, size)
|
||||
local words = {}
|
||||
for word in text:gmatch("[^,]+") do
|
||||
words[#words + 1] = word
|
||||
end
|
||||
|
||||
local ret = {}
|
||||
local currentChunk = ""
|
||||
|
||||
for _, word in ipairs(words) do
|
||||
if #currentChunk + #word + 1 <= size then
|
||||
currentChunk = currentChunk .. (currentChunk == "" and word or " " .. word)
|
||||
else
|
||||
if #currentChunk > 0 then ret[#ret + 1] = currentChunk end
|
||||
currentChunk = word
|
||||
end
|
||||
end
|
||||
|
||||
if #currentChunk > 0 then ret[#ret + 1] = currentChunk end
|
||||
|
||||
return ret
|
||||
end
|
||||
---@param arr table<string, Player>
|
||||
---@return string[]
|
||||
local function Count(arr)
|
||||
local ret = {}
|
||||
for _, player in pairs(arr) do
|
||||
if shared.Whoer.ShouldNotifyForZone(player.zone) then ret[player.zone] = (ret[player.zone] or 0) + 1 end
|
||||
end
|
||||
local text = {}
|
||||
for zone, count in pairs(ret) do
|
||||
text[#text + 1] = string.format("%s: %d", zone, count)
|
||||
end
|
||||
return text
|
||||
end
|
||||
---@param arr table<string, Player>
|
||||
---@return string[]
|
||||
local function CountPartitioned(arr)
|
||||
local count = Count(arr)
|
||||
local text = {}
|
||||
---@diagnostic disable-next-line: param-type-mismatch something wrong with luals, it's picking up the "wrong" unpack
|
||||
for _, line in pairs(Partition(strjoin(", ", unpack(count)), 200)) do
|
||||
text[#text + 1] = line
|
||||
end
|
||||
return text
|
||||
end
|
||||
---@param arr table<string, Player>
|
||||
---@return string[]
|
||||
local function Who(arr)
|
||||
local ret = {}
|
||||
for _, player in pairs(arr) do
|
||||
if shared.Whoer.ShouldNotifyForZone(player.zone) then
|
||||
ret[#ret + 1] = string.format(
|
||||
"%s/%s (%s) %s",
|
||||
player.name,
|
||||
player.class,
|
||||
player.zone,
|
||||
player.stinky and "(!!!!)" or ""
|
||||
)
|
||||
end
|
||||
end
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Command result: %s", ModuleName, strjoin(", ", unpack(ret))))
|
||||
end
|
||||
return ret
|
||||
end
|
||||
-- This is really ugly, duplicating methods like this
|
||||
-- But I have no better idea
|
||||
-- We would have to drag reference channel all the way here
|
||||
-- And then in here do some kind of deciding based on the fucking channel locale
|
||||
-- That's also a nasty solution... I guess adding "kto" is better
|
||||
---@param arr table<string, Player>
|
||||
---@return string[]
|
||||
local function WhoRu(arr)
|
||||
local ret = {}
|
||||
for _, player in pairs(arr) do
|
||||
if shared.Whoer.ShouldNotifyForZone(player.zone) then
|
||||
shared.dump(player)
|
||||
ret[#ret + 1] = string.format(
|
||||
"%s/%s (%s) %s",
|
||||
player.name,
|
||||
shared._L(player.class, "ru"),
|
||||
shared._L(player.zone, "ru"),
|
||||
player.stinky and "(!!!!)" or ""
|
||||
)
|
||||
end
|
||||
end
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Command result: %s", ModuleName, strjoin(", ", unpack(ret))))
|
||||
end
|
||||
return ret
|
||||
end
|
||||
---@param arr table<string, Player>
|
||||
---@return string[]
|
||||
local function WhoPartitioned(arr)
|
||||
local who = Who(arr)
|
||||
local text = {}
|
||||
---@diagnostic disable-next-line: param-type-mismatch something wrong with luals, it's picking up the "wrong" unpack
|
||||
for _, line in pairs(Partition(strjoin(", ", unpack(who)), 200)) do
|
||||
text[#text + 1] = "who: " .. line
|
||||
end
|
||||
return text
|
||||
end
|
||||
---@param arr table<string, Player>
|
||||
---@return string[]
|
||||
local function WhoPartitionedRu(arr)
|
||||
local who = WhoRu(arr)
|
||||
local text = {}
|
||||
---@diagnostic disable-next-line: param-type-mismatch something wrong with luals, it's picking up the "wrong" unpack
|
||||
for _, line in pairs(Partition(strjoin(", ", unpack(who)), 200)) do
|
||||
text[#text + 1] = "кто: " .. line
|
||||
end
|
||||
return text
|
||||
end
|
||||
---@param arr table<string, Player>
|
||||
---@return string[]
|
||||
local function CountClass(arr)
|
||||
local ret = {}
|
||||
for _, player in pairs(arr) do
|
||||
if shared.Whoer.ShouldNotifyForZone(player.zone) then
|
||||
ret[player.class] = (ret[player.class] or 0) + 1
|
||||
end
|
||||
end
|
||||
local text = {}
|
||||
for class, count in pairs(ret) do
|
||||
text[#text + 1] = string.format("%s: %d", class, count)
|
||||
end
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Message text: %s", ModuleName, strjoin(", ", unpack(text))))
|
||||
end
|
||||
return text
|
||||
end
|
||||
---@param arr table<string, Player>
|
||||
---@return string[]
|
||||
local function CountClassPartitioned(arr)
|
||||
local countClass = CountClass(arr)
|
||||
local text = {}
|
||||
---@diagnostic disable-next-line: param-type-mismatch something wrong with luals, it's picking up the "wrong" unpack
|
||||
for _, line in pairs(Partition(strjoin(", ", unpack(countClass)), 200)) do
|
||||
text[#text + 1] = line
|
||||
end
|
||||
return text
|
||||
end
|
||||
local function CountClassPartitionedStinkies()
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Executing: CountClassPartitionedStinkies", ModuleName))
|
||||
end
|
||||
local res = CountClassPartitioned(HeimdallStinkies)
|
||||
if #res == 0 then return { "No stinkies found" } end
|
||||
return res
|
||||
end
|
||||
local function WhoPartitionedStinkies()
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Executing: WhoPartitionedStinkies", ModuleName))
|
||||
shared.dump(HeimdallStinkies)
|
||||
end
|
||||
local res = WhoPartitioned(HeimdallStinkies)
|
||||
if #res == 0 then return { "No stinkies found" } end
|
||||
return res
|
||||
end
|
||||
local function WhoPartitionedStinkiesRu()
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Executing: WhoPartitionedStinkies", ModuleName))
|
||||
shared.dump(HeimdallStinkies)
|
||||
end
|
||||
local res = WhoPartitionedRu(HeimdallStinkies)
|
||||
if #res == 0 then return { "No stinkies found" } end
|
||||
return res
|
||||
end
|
||||
local function CountPartitionedStinkies()
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Executing: CountPartitionedStinkies", ModuleName))
|
||||
end
|
||||
local res = CountPartitioned(HeimdallStinkies)
|
||||
if #res == 0 then return { "No stinkies found" } end
|
||||
return res
|
||||
end
|
||||
local function HelpRu()
|
||||
if Heimdall_Data.config.commander.debug then print(string.format("[%s] Executing: HelpRu", ModuleName)) end
|
||||
return helpMessages.ru
|
||||
end
|
||||
local function HelpEn()
|
||||
if Heimdall_Data.config.commander.debug then print(string.format("[%s] Executing: HelpEn", ModuleName)) end
|
||||
return helpMessages.en
|
||||
end
|
||||
local groupInviteFrame = CreateFrame("Frame")
|
||||
groupInviteFrame:SetScript("OnEvent", function(self, event, ...)
|
||||
if Heimdall_Data.config.commander.debug then print(string.format("[%s] Event received", ModuleName)) end
|
||||
AcceptGroup()
|
||||
groupInviteFrame:UnregisterEvent("PARTY_INVITE_REQUEST")
|
||||
C_Timer.NewTimer(0.1, function()
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Click event triggered", ModuleName))
|
||||
end
|
||||
_G["StaticPopup1Button1"]:Click()
|
||||
end, 1)
|
||||
end)
|
||||
local function JoinGroup()
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] JoinGroup command received", ModuleName))
|
||||
end
|
||||
groupInviteFrame:RegisterEvent("PARTY_INVITE_REQUEST")
|
||||
C_Timer.NewTimer(10, function() groupInviteFrame:UnregisterEvent("PARTY_INVITE_REQUEST") end, 1)
|
||||
return { "+" }
|
||||
end
|
||||
local function LeaveGroup()
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] LeaveGroup command received", ModuleName))
|
||||
end
|
||||
LeaveParty()
|
||||
return {}
|
||||
end
|
||||
---@param target string
|
||||
local function FollowTarget(target)
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Following target: %s", ModuleName, target))
|
||||
end
|
||||
if not target then return end
|
||||
FollowUnit(target)
|
||||
return {}
|
||||
end
|
||||
|
||||
---@param args string[]
|
||||
local function MacroTarget(args)
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
---@diagnostic disable-next-line: param-type-mismatch something wrong with luals, it's picking up the "wrong" unpack
|
||||
print(string.format("[%s] Macroing: %s", ModuleName, strjoin(" ", unpack(args))))
|
||||
end
|
||||
if #args < 2 or #args % 2 ~= 0 then
|
||||
if #args < 2 or #args % 2 ~= 0 then
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Invalid number of arguments for MacroTarget", ModuleName))
|
||||
end
|
||||
return {}
|
||||
end
|
||||
end
|
||||
table.remove(args, 1)
|
||||
|
||||
for i = 1, #args do
|
||||
local stinky = strtrim(args[i])
|
||||
local name = stinky:match("([^/]+)")
|
||||
local class = stinky:match("/([^ $]+)")
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Adding stinky: %s/%s", ModuleName, name, tostring(class)))
|
||||
end
|
||||
shared.StinkyTracker.Track({
|
||||
name = name,
|
||||
class = class or "unknown",
|
||||
seenAt = GetTime(),
|
||||
hostile = true,
|
||||
})
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Added stinky: %s/%s", ModuleName, name, tostring(class)))
|
||||
end
|
||||
end
|
||||
return {}
|
||||
end
|
||||
|
||||
---@param args string[]
|
||||
local function IgnoreMacroTarget(args)
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
---@diagnostic disable-next-line: param-type-mismatch something wrong with luals, it's picking up the "wrong" unpack
|
||||
print(string.format("[%s] Macroing: %s", ModuleName, strjoin(" ", unpack(args))))
|
||||
end
|
||||
if #args < 1 then
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Invalid number of arguments for IgnoreMacroTarget", ModuleName))
|
||||
end
|
||||
return {}
|
||||
end
|
||||
table.remove(args, 1)
|
||||
|
||||
for i = 1, #args do
|
||||
local stinky = strtrim(args[i])
|
||||
local name = stinky:match("([^/]+)")
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Ignoring stinky: %s", ModuleName, name))
|
||||
end
|
||||
shared.StinkyTracker.Ignore(name)
|
||||
end
|
||||
return {}
|
||||
end
|
||||
|
||||
---@class Command
|
||||
---@field keywordRe string
|
||||
---@field commanderOnly boolean
|
||||
---@field callback fun(...: any): string[]
|
||||
|
||||
local commands = {
|
||||
{ keywordRe = "^who$", commanderOnly = false, callback = WhoPartitionedStinkies },
|
||||
{ keywordRe = "^кто$", commanderOnly = false, callback = WhoPartitionedStinkiesRu },
|
||||
{ keywordRe = "^howmany$", commanderOnly = false, callback = CountPartitionedStinkies },
|
||||
{ keywordRe = "^classes$", commanderOnly = false, callback = CountClassPartitionedStinkies },
|
||||
{ keywordRe = "^help$", commanderOnly = false, callback = HelpRu },
|
||||
{ keywordRe = "^helpen$", commanderOnly = false, callback = HelpEn },
|
||||
{ keywordRe = "^joingroup$", commanderOnly = false, callback = JoinGroup },
|
||||
{ keywordRe = "^leavegroup$", commanderOnly = false, callback = LeaveGroup },
|
||||
{ keywordRe = "^follow$", commanderOnly = false, callback = FollowTarget },
|
||||
{ keywordRe = "^macro", commanderOnly = false, callback = MacroTarget },
|
||||
{ keywordRe = "^ignore", commanderOnly = false, callback = IgnoreMacroTarget },
|
||||
}
|
||||
|
||||
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.dump(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
|
||||
local channelId = select(6, ...)
|
||||
local _, channelname = GetChannelName(channelId)
|
||||
local ok = false
|
||||
for _, channel in pairs(Heimdall_Data.config.commander.channels) do
|
||||
if channel == channelname then
|
||||
ok = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if not ok then
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(
|
||||
string.format(
|
||||
"[%s] Channel name '%s' does not match any of the channels '%s'",
|
||||
ModuleName,
|
||||
channelname,
|
||||
table.concat(Heimdall_Data.config.commander.channels, ", ")
|
||||
)
|
||||
)
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
sender = string.match(sender, "^[^-]+")
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Message from: %s", ModuleName, sender))
|
||||
shared.dump(Heimdall_Data.config.commander)
|
||||
end
|
||||
|
||||
for _, command in ipairs(commands) do
|
||||
local enabled = Heimdall_Data.config.commander.commands[command.keywordRe] == true or false
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(
|
||||
string.format("[%s] Command match: %s = %s", ModuleName, command.keywordRe, tostring(enabled))
|
||||
)
|
||||
end
|
||||
if
|
||||
enabled
|
||||
and (
|
||||
not command.commanderOnly
|
||||
-- if Heimdall_Data.config.commander.debug then print(string.format("[%s] Ignoring command, sender %s not commander %s", ModuleName, sender, Heimdall_Data.config.commander.commander)) end
|
||||
|
||||
or (command.commanderOnly and sender == Heimdall_Data.config.commander.commander)
|
||||
)
|
||||
then
|
||||
if msg:match(command.keywordRe) then
|
||||
---@diagnostic disable-next-line: redundant-parameter Currently luals does not support variadic functions as a @field
|
||||
local messages = command.callback({ strsplit(",", msg) })
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Messages to send: %s", ModuleName, #messages))
|
||||
shared.dump(messages)
|
||||
end
|
||||
for _, message in ipairs(messages) do
|
||||
---@type Message
|
||||
local returnmsg = {
|
||||
channel = "C",
|
||||
data = channelname,
|
||||
message = message,
|
||||
}
|
||||
if Heimdall_Data.config.commander.debug then
|
||||
print(string.format("[%s] Queuing message", ModuleName))
|
||||
shared.dump(msg)
|
||||
end
|
||||
if Heimdall_Data.config.networkMessenger.enabled then
|
||||
shared.NetworkMessenger.Enqueue(returnmsg)
|
||||
elseif Heimdall_Data.config.messenger.enabled then
|
||||
shared.Messenger.Enqueue(returnmsg)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -709,7 +709,7 @@ shared.Config = {
|
||||
local text = self:GetText()
|
||||
Heimdall_Data.config.spotter.channels = StringToArray(text, ",")
|
||||
print("Channels set to")
|
||||
shared.dumpTable(Heimdall_Data.config.spotter.channels)
|
||||
shared.dump(Heimdall_Data.config.spotter.channels)
|
||||
end
|
||||
)
|
||||
spotterConfigFrame:Add(channels, 2, 4)
|
||||
@@ -809,7 +809,7 @@ shared.Config = {
|
||||
local text = self:GetText()
|
||||
Heimdall_Data.config.who.channels = StringToArray(text, ",")
|
||||
print("Channels set to")
|
||||
shared.dumpTable(Heimdall_Data.config.who.channels)
|
||||
shared.dump(Heimdall_Data.config.who.channels)
|
||||
end
|
||||
)
|
||||
whoerConfigFrame:Add(channels, 2, 3)
|
||||
@@ -1021,7 +1021,7 @@ shared.Config = {
|
||||
local text = self:GetText()
|
||||
Heimdall_Data.config.deathReporter.channels = StringToArray(text, ",")
|
||||
print("Channels set to")
|
||||
shared.dumpTable(Heimdall_Data.config.deathReporter.channels)
|
||||
shared.dump(Heimdall_Data.config.deathReporter.channels)
|
||||
end
|
||||
)
|
||||
deathReporterConfigFrame:Add(channels, 2, 6)
|
||||
@@ -1146,7 +1146,7 @@ shared.Config = {
|
||||
local text = self:GetText()
|
||||
Heimdall_Data.config.inviter.channels = StringToArray(text, ",")
|
||||
print("Channels set to")
|
||||
shared.dumpTable(Heimdall_Data.config.inviter.channels)
|
||||
shared.dump(Heimdall_Data.config.inviter.channels)
|
||||
end
|
||||
)
|
||||
inviterConfigFrame:Add(channels, 2, 6)
|
||||
@@ -1301,7 +1301,7 @@ shared.Config = {
|
||||
local text = self:GetText()
|
||||
Heimdall_Data.config.agentTracker.channels = StringToArray(text, ",")
|
||||
print("Channels set to")
|
||||
shared.dumpTable(Heimdall_Data.config.agentTracker.channels)
|
||||
shared.dump(Heimdall_Data.config.agentTracker.channels)
|
||||
end
|
||||
)
|
||||
agentTrackerConfigFrame:Add(channels, 2, 6)
|
||||
@@ -1354,7 +1354,7 @@ shared.Config = {
|
||||
local text = self:GetText()
|
||||
Heimdall_Data.config.stinkyTracker.channels = StringToArray(text, ",")
|
||||
print("Channels set to")
|
||||
shared.dumpTable(Heimdall_Data.config.stinkyTracker.channels)
|
||||
shared.dump(Heimdall_Data.config.stinkyTracker.channels)
|
||||
end
|
||||
)
|
||||
stinkyTrackerConfigFrame:Add(channels, 2, 6)
|
||||
@@ -1407,7 +1407,7 @@ shared.Config = {
|
||||
local text = self:GetText()
|
||||
Heimdall_Data.config.emoter.channels = StringToArray(text, ",")
|
||||
print("Channels set to")
|
||||
shared.dumpTable(Heimdall_Data.config.emoter.channels)
|
||||
shared.dump(Heimdall_Data.config.emoter.channels)
|
||||
end
|
||||
)
|
||||
emoterConfigFrame:Add(channels, 2, 6)
|
||||
@@ -1478,7 +1478,7 @@ shared.Config = {
|
||||
local text = self:GetText()
|
||||
Heimdall_Data.config.echoer.channels = StringToArray(text, ",")
|
||||
print("Channels set to")
|
||||
shared.dumpTable(Heimdall_Data.config.echoer.channels)
|
||||
shared.dump(Heimdall_Data.config.echoer.channels)
|
||||
end
|
||||
)
|
||||
echoerConfigFrame:Add(channels, 2, 6)
|
||||
@@ -1549,7 +1549,7 @@ shared.Config = {
|
||||
local text = self:GetText()
|
||||
Heimdall_Data.config.commander.channels = StringToArray(text, ",")
|
||||
print("Channels set to")
|
||||
shared.dumpTable(Heimdall_Data.config.commander.channels)
|
||||
shared.dump(Heimdall_Data.config.commander.channels)
|
||||
end
|
||||
)
|
||||
commanderConfigFrame:Add(channels, 2, 6)
|
||||
@@ -1683,7 +1683,7 @@ shared.Config = {
|
||||
local text = self:GetText()
|
||||
Heimdall_Data.config.combatAlerter.channels = StringToArray(text, ",")
|
||||
print("Channels set to")
|
||||
shared.dumpTable(Heimdall_Data.config.combatAlerter.channels)
|
||||
shared.dump(Heimdall_Data.config.combatAlerter.channels)
|
||||
end
|
||||
)
|
||||
combatAlerterConfigFrame:Add(channels, 2, 6)
|
||||
@@ -1748,7 +1748,7 @@ shared.Config = {
|
||||
local text = self:GetText()
|
||||
Heimdall_Data.config.sniffer.channels = StringToArray(text, ",")
|
||||
print("Channels set to")
|
||||
shared.dumpTable(Heimdall_Data.config.sniffer.channels)
|
||||
shared.dump(Heimdall_Data.config.sniffer.channels)
|
||||
end
|
||||
)
|
||||
snifferConfigFrame:Add(channels, 2, 6)
|
||||
@@ -1838,7 +1838,7 @@ shared.Config = {
|
||||
local text = self:GetText()
|
||||
Heimdall_Data.config.bonkDetector.channels = StringToArray(text, ",")
|
||||
print("Channels set to")
|
||||
shared.dumpTable(Heimdall_Data.config.bonkDetector.channels)
|
||||
shared.dump(Heimdall_Data.config.bonkDetector.channels)
|
||||
end
|
||||
)
|
||||
bonkDetectorConfigFrame:Add(channels, 2, 6)
|
||||
@@ -1909,7 +1909,7 @@ shared.Config = {
|
||||
local text = self:GetText()
|
||||
Heimdall_Data.config.minimapTagger.channels = StringToArray(text, ",")
|
||||
print("Channels set to")
|
||||
shared.dumpTable(Heimdall_Data.config.minimapTagger.channels)
|
||||
shared.dump(Heimdall_Data.config.minimapTagger.channels)
|
||||
end
|
||||
)
|
||||
minimapTaggerConfigFrame:Add(channels, 2, 3)
|
||||
@@ -2278,7 +2278,7 @@ shared.Config = {
|
||||
local text = self:GetText()
|
||||
Heimdall_Data.config.noter.channels = StringToArray(text, ",")
|
||||
print("Channels set to")
|
||||
shared.dumpTable(Heimdall_Data.config.noter.channels)
|
||||
shared.dump(Heimdall_Data.config.noter.channels)
|
||||
end
|
||||
)
|
||||
noterConfigFrame:Add(channels, 2, 6)
|
||||
@@ -2660,6 +2660,46 @@ shared.Config = {
|
||||
channelLocaleConfigFrame:Add(channelLocale, 8, 12)
|
||||
end
|
||||
|
||||
-- ChatSniffer
|
||||
do
|
||||
local r, g, b, a = GetNextColor()
|
||||
local chatSnifferConfigFrame = GridFrame.new("HeimdallChatSnifferConfig", UIParent, 12, 20)
|
||||
chatSnifferConfigFrame.frame:SetBackdropColor(r, g, b, 0.3)
|
||||
configFrame:Add(chatSnifferConfigFrame, 4, 1)
|
||||
|
||||
title = CreateFancyText(
|
||||
"HeimdallChatSnifferConfigTitle",
|
||||
chatSnifferConfigFrame.frame,
|
||||
shared._L("chatSniffer", Heimdall_Data.config.locale),
|
||||
{ r, g, b, a }
|
||||
)
|
||||
chatSnifferConfigFrame:Add(title, 1, 8)
|
||||
|
||||
local debugButton = CreateBasicButton(
|
||||
"HeimdallChatSnifferConfigDebugButton",
|
||||
chatSnifferConfigFrame.frame,
|
||||
shared._L("debug", Heimdall_Data.config.locale),
|
||||
function()
|
||||
Heimdall_Data.config.chatSniffer.debug = not Heimdall_Data.config.chatSniffer.debug
|
||||
return Heimdall_Data.config.chatSniffer.debug
|
||||
end
|
||||
)
|
||||
debugButton:UpdateColor(Heimdall_Data.config.chatSniffer.debug)
|
||||
chatSnifferConfigFrame:Add(debugButton, 1, 4)
|
||||
|
||||
local enableButton = CreateBasicButton(
|
||||
"HeimdallChatSnifferConfigEnableButton",
|
||||
chatSnifferConfigFrame.frame,
|
||||
shared._L("enabled", Heimdall_Data.config.locale),
|
||||
function()
|
||||
Heimdall_Data.config.chatSniffer.enabled = not Heimdall_Data.config.chatSniffer.enabled
|
||||
return Heimdall_Data.config.chatSniffer.enabled
|
||||
end
|
||||
)
|
||||
enableButton:UpdateColor(Heimdall_Data.config.chatSniffer.enabled)
|
||||
chatSnifferConfigFrame:Add(enableButton, 1, 12)
|
||||
end
|
||||
|
||||
configFrame.frame:Hide()
|
||||
print("[Heimdall] Config loaded")
|
||||
end,
|
||||
|
||||
@@ -8,5 +8,5 @@ local ModuleName = "Configurator"
|
||||
|
||||
---@class Configurator
|
||||
shared.Configurator = {
|
||||
Init = function() print(string.format("[Heimdall] %s module loaded", ModuleName)) end,
|
||||
Init = function() print(string.format("[%s] Module initialized", ModuleName)) end,
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ shared.DeathReporter = {
|
||||
}
|
||||
if Heimdall_Data.config.deathReporter.debug then
|
||||
print(string.format("[%s] Queuing death report message", ModuleName))
|
||||
shared.dumpTable(msg)
|
||||
shared.dump(msg)
|
||||
end
|
||||
table.insert(shared.messenger.queue, msg)
|
||||
end
|
||||
@@ -263,6 +263,6 @@ shared.DeathReporter = {
|
||||
)
|
||||
)
|
||||
end
|
||||
print("[Heimdall] DeathReporter loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -58,6 +58,6 @@ shared.Dueler = {
|
||||
)
|
||||
)
|
||||
end
|
||||
print("[Heimdall] Dueler loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -1,25 +1,29 @@
|
||||
local _, shared = ...
|
||||
---@cast shared HeimdallShared
|
||||
|
||||
if not shared.dumpTable then
|
||||
---@param table table
|
||||
if not shared.dump then
|
||||
---@param value any
|
||||
---@param msg string?
|
||||
---@param depth number?
|
||||
shared.dumpTable = function(table, msg, depth)
|
||||
if not table then
|
||||
print(tostring(table))
|
||||
shared.dump = function(value, msg, depth)
|
||||
if not value then
|
||||
print(tostring(value))
|
||||
return
|
||||
end
|
||||
if type(value) ~= "table" then
|
||||
print(tostring(value))
|
||||
return
|
||||
end
|
||||
if msg then print(msg) end
|
||||
if depth == nil then depth = 0 end
|
||||
if depth > 200 then
|
||||
print("Error: Depth > 200 in dumpTable()")
|
||||
print("Error: Depth > 200 in dump()")
|
||||
return
|
||||
end
|
||||
for k, v in pairs(table) do
|
||||
for k, v in pairs(value) do
|
||||
if type(v) == "table" then
|
||||
print(string.rep(" ", depth) .. tostring(k) .. ":")
|
||||
shared.dumpTable(v, nil, depth + 1)
|
||||
shared.dump(v, msg, depth + 1)
|
||||
else
|
||||
print(string.rep(" ", depth) .. tostring(k) .. ": " .. tostring(v))
|
||||
end
|
||||
|
||||
@@ -42,7 +42,7 @@ shared.Echoer = {
|
||||
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)
|
||||
shared.dump(Heimdall_Data.config.echoer)
|
||||
end
|
||||
|
||||
if string.find(msg, "^" .. Heimdall_Data.config.echoer.prefix) then
|
||||
@@ -60,6 +60,6 @@ shared.Echoer = {
|
||||
end)
|
||||
|
||||
if Heimdall_Data.config.echoer.debug then print(string.format("[%s] Module initialized", ModuleName)) end
|
||||
print("[Heimdall] Echoer loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ shared.Emoter = {
|
||||
|
||||
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)
|
||||
shared.dump(Heimdall_Data.config.emoter)
|
||||
end
|
||||
|
||||
if string.find(msg, "^" .. Heimdall_Data.config.emoter.prefix) then
|
||||
@@ -61,6 +61,6 @@ shared.Emoter = {
|
||||
end)
|
||||
|
||||
if Heimdall_Data.config.emoter.debug then print(string.format("[%s] Module initialized", ModuleName)) end
|
||||
print("[Heimdall] Emoter loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ shared.Inviter = {
|
||||
inviterChannelFrame:SetScript("OnEvent", function(self, event, msg, sender, ...)
|
||||
--if Heimdall_Data.config.inviter.debug then
|
||||
-- print(string.format("[%s] Chat message received: %s", ModuleName, msg))
|
||||
-- shared.dumpTable(Heimdall_Data.config.inviter)
|
||||
-- shared.dump(Heimdall_Data.config.inviter)
|
||||
--end
|
||||
if not Heimdall_Data.config.inviter.enabled then return end
|
||||
local channelId = select(6, ...)
|
||||
@@ -270,6 +270,6 @@ shared.Inviter = {
|
||||
)
|
||||
)
|
||||
end
|
||||
print("[Heimdall] Inviter loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ shared.Macroer = {
|
||||
|
||||
if Heimdall_Data.config.macroer.debug then
|
||||
print(string.format("[%s] Sorted stinkies: %d", ModuleName, #sortedStinkies))
|
||||
shared.dumpTable(sortedStinkies)
|
||||
shared.dump(sortedStinkies)
|
||||
end
|
||||
local lines = { "/targetenemy" }
|
||||
for _, stinky in pairs(sortedStinkies) do
|
||||
@@ -91,11 +91,11 @@ shared.Macroer = {
|
||||
shared.StinkyTracker.OnChange(function(stinkies)
|
||||
if Heimdall_Data.config.macroer.debug then
|
||||
print(string.format("[%s] Stinkies changed, updating macro", ModuleName))
|
||||
shared.dumpTable(stinkies)
|
||||
shared.dump(stinkies)
|
||||
end
|
||||
FixMacro(stinkies)
|
||||
end)
|
||||
if Heimdall_Data.config.macroer.debug then print(string.format("[%s] Module initialized", ModuleName)) end
|
||||
print("[Heimdall] Macroer loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -46,54 +46,51 @@ shared.Messenger = {
|
||||
|
||||
if not shared.messenger.ticker then
|
||||
local function DoMessage()
|
||||
if Heimdall_Data.config.messenger.debug then
|
||||
print(
|
||||
string.format(
|
||||
"[%s] Processing message queue - Size: %d",
|
||||
ModuleName,
|
||||
#shared.messenger.queue:get()
|
||||
)
|
||||
)
|
||||
end
|
||||
-- if Heimdall_Data.config.messenger.debug then
|
||||
-- print(
|
||||
-- string.format(
|
||||
-- "[%s] Processing message queue - Size: %d",
|
||||
-- ModuleName,
|
||||
-- #shared.messenger.queue:get()
|
||||
-- )
|
||||
-- )
|
||||
-- end
|
||||
|
||||
if not Heimdall_Data.config.messenger.enabled then
|
||||
if Heimdall_Data.config.messenger.debug then
|
||||
print(string.format("[%s] Module disabled, skipping message processing", ModuleName))
|
||||
end
|
||||
-- if Heimdall_Data.config.messenger.debug then
|
||||
-- print(string.format("[%s] Module disabled, skipping message processing", ModuleName))
|
||||
-- end
|
||||
return
|
||||
end
|
||||
|
||||
---@type Message
|
||||
local message = shared.messenger.queue:get()[1]
|
||||
local message = shared.messenger.queue[1]
|
||||
if not message then
|
||||
if Heimdall_Data.config.messenger.debug then
|
||||
print(string.format("[%s] Message queue empty", ModuleName))
|
||||
end
|
||||
-- if Heimdall_Data.config.messenger.debug then
|
||||
-- print(string.format("[%s] Message queue empty", ModuleName))
|
||||
-- end
|
||||
return
|
||||
end
|
||||
|
||||
if Heimdall_Data.config.messenger.debug then shared.dumpTable(message, "[%s] Processing message:") end
|
||||
if Heimdall_Data.config.messenger.debug then shared.dump(message, "[%s] Processing message:") end
|
||||
|
||||
if not message.message or message.message == "" then
|
||||
if Heimdall_Data.config.messenger.debug then
|
||||
shared.dumpTable(message, string.format("[%s] Invalid message: empty content", ModuleName))
|
||||
shared.dump(message, string.format("[%s] Invalid message: empty content", ModuleName))
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
if not message.channel or message.channel == "" then
|
||||
if Heimdall_Data.config.messenger.debug then
|
||||
shared.dumpTable(
|
||||
message,
|
||||
string.format("[%s] Invalid message: no channel specified", ModuleName)
|
||||
)
|
||||
shared.dump(message, string.format("[%s] Invalid message: no channel specified", ModuleName))
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
if string.find(message.channel, "^C") then
|
||||
if Heimdall_Data.config.messenger.debug then
|
||||
shared.dumpTable(
|
||||
shared.dump(
|
||||
message,
|
||||
string.format("[%s] Converting channel type from C to CHANNEL", ModuleName)
|
||||
)
|
||||
@@ -101,7 +98,7 @@ shared.Messenger = {
|
||||
message.channel = "CHANNEL"
|
||||
elseif string.find(message.channel, "^W") then
|
||||
if Heimdall_Data.config.messenger.debug then
|
||||
shared.dumpTable(
|
||||
shared.dump(
|
||||
message,
|
||||
string.format("[%s] Converting channel type from W to WHISPER", ModuleName)
|
||||
)
|
||||
@@ -111,12 +108,12 @@ shared.Messenger = {
|
||||
|
||||
if message.channel == "CHANNEL" and message.data and string.match(message.data, "%D") then
|
||||
if Heimdall_Data.config.messenger.debug then
|
||||
shared.dumpTable(message, string.format("[%s] Processing channel message:", ModuleName))
|
||||
shared.dump(message, string.format("[%s] Processing channel message:", ModuleName))
|
||||
end
|
||||
local channelId = GetChannelName(message.data)
|
||||
if channelId == 0 then
|
||||
if Heimdall_Data.config.messenger.debug then
|
||||
shared.dumpTable(message, string.format("[%s] Channel not found, joining:", ModuleName))
|
||||
shared.dump(message, string.format("[%s] Channel not found, joining:", ModuleName))
|
||||
end
|
||||
channelId = FindOrJoinChannel(message.data)
|
||||
if Heimdall_Data.config.messenger.debug then
|
||||
@@ -129,39 +126,36 @@ shared.Messenger = {
|
||||
table.remove(shared.messenger.queue, 1)
|
||||
if not message.message or message.message == "" then
|
||||
if Heimdall_Data.config.messenger.debug then
|
||||
shared.dumpTable(message, string.format("[%s] Skipping empty message", ModuleName))
|
||||
shared.dump(message, string.format("[%s] Skipping empty message", ModuleName))
|
||||
end
|
||||
return
|
||||
end
|
||||
if not message.channel or message.channel == "" then
|
||||
if Heimdall_Data.config.messenger.debug then
|
||||
shared.dumpTable(message, string.format("[%s] Skipping message with no channel", ModuleName))
|
||||
shared.dump(message, string.format("[%s] Skipping message with no channel", ModuleName))
|
||||
end
|
||||
return
|
||||
end
|
||||
if not message.data or message.data == "" then
|
||||
if Heimdall_Data.config.messenger.debug then
|
||||
shared.dumpTable(message, string.format("[%s] Skipping message with no data", ModuleName))
|
||||
shared.dump(message, string.format("[%s] Skipping message with no data", ModuleName))
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
if Heimdall_Data.config.messenger.debug then
|
||||
shared.dumpTable(message, string.format("[%s] Sending message:", ModuleName))
|
||||
shared.dump(message, string.format("[%s] Sending message:", ModuleName))
|
||||
end
|
||||
if string.len(message.message) > 255 then
|
||||
shared.dumpTable(
|
||||
message,
|
||||
string.format("[%s] Message too long!!!!: %s", ModuleName, message.message)
|
||||
)
|
||||
shared.dump(message, string.format("[%s] Message too long!!!!: %s", ModuleName, message.message))
|
||||
return
|
||||
end
|
||||
SendChatMessage(message.message, message.channel, nil, message.data)
|
||||
end
|
||||
local function Tick()
|
||||
if Heimdall_Data.config.messenger.debug then
|
||||
print(string.format("[%s] Tick - Queue size: %d", ModuleName, #shared.messenger.queue:get()))
|
||||
end
|
||||
-- if Heimdall_Data.config.messenger.debug then
|
||||
-- print(string.format("[%s] Tick - Queue size: %d", ModuleName, #shared.messenger.queue:get()))
|
||||
-- end
|
||||
DoMessage()
|
||||
shared.messenger.ticker = C_Timer.NewTimer(Heimdall_Data.config.messenger.interval, Tick, 1)
|
||||
end
|
||||
@@ -177,6 +171,6 @@ shared.Messenger = {
|
||||
)
|
||||
)
|
||||
end
|
||||
print("[Heimdall] Messenger loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -473,7 +473,7 @@ shared.MinimapTagger = {
|
||||
end
|
||||
if Heimdall_Data.config.minimapTagger.debug then
|
||||
print(string.format("[%s] Processing message from master channel: %s", ModuleName, sender))
|
||||
shared.dumpTable(Heimdall_Data.config.minimapTagger)
|
||||
shared.dump(Heimdall_Data.config.minimapTagger)
|
||||
end
|
||||
|
||||
local doTag = true
|
||||
@@ -592,6 +592,6 @@ shared.MinimapTagger = {
|
||||
--endregion
|
||||
end)
|
||||
|
||||
print("[Heimdall] MinimapTagger loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ shared.Network = {
|
||||
end
|
||||
if Heimdall_Data.config.network.debug then
|
||||
print(string.format("[%s] Network nodes:", ModuleName))
|
||||
shared.dumpTable(shared.networkNodes)
|
||||
shared.dump(shared.networkNodes)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -80,6 +80,6 @@ shared.Network = {
|
||||
end
|
||||
|
||||
NetworkTick()
|
||||
print("[Heimdall] Network module loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ local ModuleName = "NetworkMessenger"
|
||||
|
||||
---@class NetworkMessenger
|
||||
shared.NetworkMessenger = {
|
||||
---@param message Message
|
||||
Enqueue = function(message) table.insert(shared.networkMessenger.queue, message) end,
|
||||
Init = function()
|
||||
RegisterAddonMessagePrefix(Heimdall_Data.config.addonPrefix)
|
||||
|
||||
@@ -143,7 +145,7 @@ shared.NetworkMessenger = {
|
||||
local parts = shared.Split(message, "|")
|
||||
if Heimdall_Data.config.networkMessenger.debug then
|
||||
print(string.format("[%s] Received message parts:", ModuleName))
|
||||
shared.dumpTable(parts)
|
||||
shared.dump(parts)
|
||||
end
|
||||
local command = strtrim(parts[1])
|
||||
if command == "message" then
|
||||
@@ -197,6 +199,6 @@ shared.NetworkMessenger = {
|
||||
end
|
||||
end
|
||||
|
||||
print("[Heimdall] NetworkMessenger module loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ shared.Noter = {
|
||||
local indices = shared.Split(range, "..")
|
||||
if Heimdall_Data.config.noter.debug then
|
||||
print(string.format("[%s] Indices for range deletion: %s", ModuleName, table.concat(indices, ", ")))
|
||||
shared.dumpTable(indices)
|
||||
shared.dump(indices)
|
||||
end
|
||||
local start = tonumber(indices[1])
|
||||
local finish = tonumber(indices[2])
|
||||
@@ -98,7 +98,7 @@ shared.Noter = {
|
||||
else
|
||||
if Heimdall_Data.config.noter.debug then
|
||||
print(string.format("[%s] Deleting note %s at index %s", ModuleName, name, i))
|
||||
shared.dumpTable(Heimdall_Data.config.notes[name][i])
|
||||
shared.dump(Heimdall_Data.config.notes[name][i])
|
||||
end
|
||||
Heimdall_Data.config.notes[name][i] = nil
|
||||
end
|
||||
@@ -121,8 +121,11 @@ shared.Noter = {
|
||||
data = channel,
|
||||
message = string.format("[%s][%d] %s: %s", note.source, index, note.date, note.note),
|
||||
}
|
||||
--table.insert(shared.messenger.queue, msg)
|
||||
table.insert(shared.networkMessenger.queue, msg)
|
||||
if Heimdall_Data.config.networkMessenger.enabled then
|
||||
shared.NetworkMessenger.Enqueue(msg)
|
||||
elseif Heimdall_Data.config.messenger.enabled then
|
||||
shared.Messenger.Enqueue(msg)
|
||||
end
|
||||
end
|
||||
---@param name string
|
||||
---@param args string[]
|
||||
@@ -159,7 +162,7 @@ shared.Noter = {
|
||||
local indices = shared.Split(range, "..")
|
||||
if Heimdall_Data.config.noter.debug then
|
||||
print(string.format("[%s] Indices for range printing: %s", ModuleName, table.concat(indices, ", ")))
|
||||
shared.dumpTable(indices)
|
||||
shared.dump(indices)
|
||||
end
|
||||
local start = tonumber(indices[1])
|
||||
local finish = tonumber(indices[2])
|
||||
@@ -185,7 +188,7 @@ shared.Noter = {
|
||||
else
|
||||
if Heimdall_Data.config.noter.debug then
|
||||
print(string.format("[%s] Printing note %s at index %s", ModuleName, name, i))
|
||||
shared.dumpTable(Heimdall_Data.config.notes[name][i])
|
||||
shared.dump(Heimdall_Data.config.notes[name][i])
|
||||
end
|
||||
PrintNote(channel, i, Heimdall_Data.config.notes[name][i])
|
||||
end
|
||||
@@ -200,7 +203,7 @@ shared.Noter = {
|
||||
if not Heimdall_Data.config.notes[name] then Heimdall_Data.config.notes[name] = {} end
|
||||
if Heimdall_Data.config.noter.debug then
|
||||
print(string.format("[%s] Adding note for: %s from: %s", ModuleName, name, sender))
|
||||
shared.dumpTable(args)
|
||||
shared.dump(args)
|
||||
end
|
||||
local msgparts = {}
|
||||
for i = 3, #args do
|
||||
@@ -221,7 +224,7 @@ shared.Noter = {
|
||||
|
||||
if Heimdall_Data.config.noter.debug then
|
||||
print(string.format("[%s] Adding note", ModuleName))
|
||||
shared.dumpTable(note)
|
||||
shared.dump(note)
|
||||
end
|
||||
table.insert(Heimdall_Data.config.notes[name], note)
|
||||
end
|
||||
@@ -239,7 +242,7 @@ shared.Noter = {
|
||||
noterChannelFrame:SetScript("OnEvent", function(self, event, msg, sender, ...)
|
||||
--if Heimdall_Data.config.noter.debug then
|
||||
-- print(string.format("[%s] Event received", ModuleName))
|
||||
-- shared.dumpTable(Heimdall_Data.config.noter)
|
||||
-- shared.dump(Heimdall_Data.config.noter)
|
||||
--end
|
||||
if not Heimdall_Data.config.noter.enabled then
|
||||
--if Heimdall_Data.config.noter.debug then
|
||||
@@ -266,7 +269,7 @@ shared.Noter = {
|
||||
sender = string.match(sender, "^[^-]+")
|
||||
if Heimdall_Data.config.noter.debug then
|
||||
print(string.format("[%s] Message from: %s", ModuleName, sender))
|
||||
shared.dumpTable(Heimdall_Data.config.noter)
|
||||
shared.dump(Heimdall_Data.config.noter)
|
||||
end
|
||||
|
||||
if not msg or msg == "" then
|
||||
@@ -279,7 +282,7 @@ shared.Noter = {
|
||||
local args = { strsplit(" ", msg) }
|
||||
if Heimdall_Data.config.noter.debug then
|
||||
print(string.format("[%s] Arguments received: %s", ModuleName, table.concat(args, ", ")))
|
||||
shared.dumpTable(args)
|
||||
shared.dump(args)
|
||||
end
|
||||
local command = args[1]
|
||||
if command == "note" then
|
||||
@@ -299,6 +302,6 @@ shared.Noter = {
|
||||
end
|
||||
end)
|
||||
|
||||
print("[Heimdall] Commander module loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -483,7 +483,7 @@ local function Init()
|
||||
-- S local clbk = test:onChange(function(value)
|
||||
-- S invocations = invocations + 1
|
||||
-- S print("test changed to")
|
||||
-- S dumpTable(value, 0)
|
||||
-- S dump(value, 0)
|
||||
-- S end)
|
||||
-- S test:set({1, 2, 3, 4})
|
||||
-- S assert(invocations == 1)
|
||||
@@ -516,7 +516,7 @@ local function Init()
|
||||
-- S test:once(function(value)
|
||||
-- S invocations = invocations + 1
|
||||
-- S print("test changed to")
|
||||
-- S dumpTable(value, 0)
|
||||
-- S dump(value, 0)
|
||||
-- S end)
|
||||
-- S test:set({3, 2, 1})
|
||||
-- S assert(invocations == 1)
|
||||
@@ -527,7 +527,7 @@ local function Init()
|
||||
-- S test:onChange(function(value)
|
||||
-- S invocations = invocations + 1
|
||||
-- S print("test changed to")
|
||||
-- S dumpTable(value, 0)
|
||||
-- S dump(value, 0)
|
||||
-- S end)
|
||||
-- S test:onAnyFieldChange(function(field, value)
|
||||
-- S invocations = invocations + 1
|
||||
|
||||
@@ -18,7 +18,7 @@ shared.Sniffer = {
|
||||
local SmellStinky = function(stinky)
|
||||
if Heimdall_Data.config.sniffer.debug then
|
||||
print(string.format("%s: SmellStinky", ModuleName))
|
||||
shared.dumpTable(Heimdall_Data.config.sniffer)
|
||||
shared.dump(Heimdall_Data.config.sniffer)
|
||||
end
|
||||
if not Heimdall_Data.config.sniffer.enabled then return end
|
||||
if Heimdall_Data.config.sniffer.stinky and not shared.IsStinky(stinky) then
|
||||
@@ -44,7 +44,7 @@ shared.Sniffer = {
|
||||
}
|
||||
if Heimdall_Data.config.sniffer.debug then
|
||||
print(string.format("[%s] Queuing sniffer message", ModuleName))
|
||||
shared.dumpTable(msg)
|
||||
shared.dump(msg)
|
||||
end
|
||||
table.insert(shared.messenger.queue, msg)
|
||||
end
|
||||
@@ -87,6 +87,6 @@ shared.Sniffer = {
|
||||
SmellStinky(destination)
|
||||
end)
|
||||
if Heimdall_Data.config.sniffer.debug then print(string.format("[%s] Module initialized", ModuleName)) end
|
||||
print("[Heimdall] Sniffer loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ shared.Spotter = {
|
||||
}
|
||||
if Heimdall_Data.config.spotter.debug then
|
||||
print(string.format("[%s] Queuing spotter message", ModuleName))
|
||||
shared.dumpTable(msg)
|
||||
shared.dump(msg)
|
||||
end
|
||||
table.insert(shared.messenger.queue, msg)
|
||||
end
|
||||
@@ -233,6 +233,6 @@ shared.Spotter = {
|
||||
end)
|
||||
|
||||
if Heimdall_Data.config.spotter.debug then print(string.format("[%s] Module initialized", ModuleName)) end
|
||||
print("[Heimdall] Spotter loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -78,6 +78,6 @@ shared.StinkyCache = {
|
||||
return rawget(self, key)
|
||||
end,
|
||||
})
|
||||
print("[Heimdall] StinkyCache module loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@ shared.StinkyTracker = {
|
||||
stinky.class
|
||||
)
|
||||
)
|
||||
shared.dumpTable(shared.stinkyTracker.ignored:get())
|
||||
shared.dumpTable(shared.stinkyTracker.stinkies:get())
|
||||
shared.dump(shared.stinkyTracker.ignored:get())
|
||||
shared.dump(shared.stinkyTracker.stinkies:get())
|
||||
end
|
||||
return false
|
||||
else
|
||||
@@ -50,8 +50,8 @@ shared.StinkyTracker = {
|
||||
shared.stinkyTracker.stinkies[stinky.name] = stinky
|
||||
if Heimdall_Data.config.stinkyTracker.debug then
|
||||
print(string.format("[%s] Stinky is now tracked: %s (%s)", ModuleName, stinky.name, stinky.class))
|
||||
shared.dumpTable(shared.stinkyTracker.stinkies:get())
|
||||
shared.dumpTable(shared.stinkyTracker.ignored:get())
|
||||
shared.dump(shared.stinkyTracker.stinkies:get())
|
||||
shared.dump(shared.stinkyTracker.ignored:get())
|
||||
end
|
||||
return true
|
||||
end,
|
||||
@@ -66,8 +66,8 @@ shared.StinkyTracker = {
|
||||
shared.stinkyTracker.stinkies[name] = nil
|
||||
if Heimdall_Data.config.stinkyTracker.debug then
|
||||
print(string.format("[%s] Stinky is now ignored: %s", ModuleName, name))
|
||||
shared.dumpTable(shared.stinkyTracker.ignored:get())
|
||||
shared.dumpTable(shared.stinkyTracker.stinkies:get())
|
||||
shared.dump(shared.stinkyTracker.ignored:get())
|
||||
shared.dump(shared.stinkyTracker.stinkies:get())
|
||||
end
|
||||
end,
|
||||
|
||||
@@ -125,7 +125,7 @@ shared.StinkyTracker = {
|
||||
date("%H:%M:%S", time())
|
||||
)
|
||||
)
|
||||
shared.dumpTable(stinkies)
|
||||
shared.dump(stinkies)
|
||||
end
|
||||
end
|
||||
return stinkies
|
||||
@@ -164,7 +164,7 @@ shared.StinkyTracker = {
|
||||
date("%H:%M:%S", time())
|
||||
)
|
||||
)
|
||||
shared.dumpTable(stinkies)
|
||||
shared.dump(stinkies)
|
||||
end
|
||||
return stinkies
|
||||
end
|
||||
@@ -197,7 +197,7 @@ shared.StinkyTracker = {
|
||||
stinkies[name] = stinky
|
||||
if Heimdall_Data.config.stinkyTracker.debug then
|
||||
print(string.format("%s: Found stinky in arrived: %s/%s", ModuleName, name, class))
|
||||
shared.dumpTable(stinkies)
|
||||
shared.dump(stinkies)
|
||||
end
|
||||
return stinkies
|
||||
end
|
||||
@@ -231,7 +231,7 @@ shared.StinkyTracker = {
|
||||
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)
|
||||
shared.dump(Heimdall_Data.config.stinkyTracker)
|
||||
end
|
||||
|
||||
local stinkies = {}
|
||||
@@ -242,7 +242,7 @@ shared.StinkyTracker = {
|
||||
local whoStinkies = ParseWho(msg)
|
||||
if Heimdall_Data.config.stinkyTracker.debug then
|
||||
print(string.format("[%s] Found stinkies in WHO message", ModuleName))
|
||||
shared.dumpTable(whoStinkies)
|
||||
shared.dump(whoStinkies)
|
||||
end
|
||||
for name, stinky in pairs(whoStinkies) do
|
||||
stinkies[name] = stinky
|
||||
@@ -255,7 +255,7 @@ shared.StinkyTracker = {
|
||||
local seeStinkies = ParseSee(msg)
|
||||
if Heimdall_Data.config.stinkyTracker.debug then
|
||||
print(string.format("[%s] Found stinkies in SEE message", ModuleName))
|
||||
shared.dumpTable(seeStinkies)
|
||||
shared.dump(seeStinkies)
|
||||
end
|
||||
for name, stinky in pairs(seeStinkies) do
|
||||
stinkies[name] = stinky
|
||||
@@ -268,7 +268,7 @@ shared.StinkyTracker = {
|
||||
local arrivedStinkies = ParseArrived(msg)
|
||||
if Heimdall_Data.config.stinkyTracker.debug then
|
||||
print(string.format("[%s] Found stinkies in ARRIVED message", ModuleName))
|
||||
shared.dumpTable(arrivedStinkies)
|
||||
shared.dump(arrivedStinkies)
|
||||
end
|
||||
for name, stinky in pairs(arrivedStinkies) do
|
||||
stinkies[name] = stinky
|
||||
@@ -359,6 +359,6 @@ shared.StinkyTracker = {
|
||||
end)
|
||||
|
||||
if Heimdall_Data.config.stinkyTracker.debug then print(string.format("[%s] Module initialized", ModuleName)) end
|
||||
print("[Heimdall] StinkyTracker loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ local ModuleName = "Whoer"
|
||||
---@field updateTicker Timer?
|
||||
---@field whoTicker Timer?
|
||||
|
||||
local whoWaiting = false
|
||||
---@class Whoer
|
||||
shared.Whoer = {
|
||||
Init = function()
|
||||
@@ -175,7 +176,7 @@ shared.Whoer = {
|
||||
if Heimdall_Data.config.who.debug then
|
||||
print(string.format("[%s] WHO query: %s with %d filters", ModuleName, queryParts[1], #filters))
|
||||
end
|
||||
shared.dumpTable(filters)
|
||||
shared.dump(filters)
|
||||
return WHOQuery.new(queryParts[1], filters)
|
||||
end,
|
||||
---@param queryStr string
|
||||
@@ -320,9 +321,13 @@ shared.Whoer = {
|
||||
}
|
||||
if Heimdall_Data.config.who.debug then
|
||||
print(string.format("[%s] Queuing channel notification", ModuleName))
|
||||
shared.dumpTable(msg)
|
||||
shared.dump(msg)
|
||||
end
|
||||
if Heimdall_Data.config.networkMessenger.enabled then
|
||||
shared.NetworkMessenger.Enqueue(msg)
|
||||
elseif Heimdall_Data.config.messenger.enabled then
|
||||
shared.Messenger.Enqueue(msg)
|
||||
end
|
||||
table.insert(shared.networkMessenger.queue, msg)
|
||||
end
|
||||
|
||||
--if Heimdall_Data.config.who.doWhisper then
|
||||
@@ -379,9 +384,13 @@ shared.Whoer = {
|
||||
}
|
||||
if Heimdall_Data.config.who.debug then
|
||||
print(string.format("[%s] Queuing channel notification", ModuleName))
|
||||
shared.dumpTable(msg)
|
||||
shared.dump(msg)
|
||||
end
|
||||
if Heimdall_Data.config.networkMessenger.enabled then
|
||||
shared.NetworkMessenger.Enqueue(msg)
|
||||
elseif Heimdall_Data.config.messenger.enabled then
|
||||
shared.Messenger.Enqueue(msg)
|
||||
end
|
||||
table.insert(shared.networkMessenger.queue, msg)
|
||||
end
|
||||
|
||||
--if Heimdall_Data.config.who.doWhisper then
|
||||
@@ -430,10 +439,13 @@ shared.Whoer = {
|
||||
}
|
||||
if Heimdall_Data.config.who.debug then
|
||||
print(string.format("[%s] Queuing channel notification", ModuleName))
|
||||
shared.dumpTable(msg)
|
||||
shared.dump(msg)
|
||||
end
|
||||
if Heimdall_Data.config.networkMessenger.enabled then
|
||||
shared.NetworkMessenger.Enqueue(msg)
|
||||
elseif Heimdall_Data.config.messenger.enabled then
|
||||
shared.Messenger.Enqueue(msg)
|
||||
end
|
||||
--table.insert(shared.messenger.queue, msg)
|
||||
table.insert(shared.networkMessenger.queue, msg)
|
||||
end
|
||||
|
||||
--if Heimdall_Data.config.who.doWhisper then
|
||||
@@ -646,7 +658,8 @@ shared.Whoer = {
|
||||
end
|
||||
-- Turns out WA cannot do this (
|
||||
-- aura_env.UpdateMacro()
|
||||
_G["FriendsFrameCloseButton"]:Click()
|
||||
-- No longer needed with the hook to friends frame show
|
||||
-- _G["FriendsFrameCloseButton"]:Click()
|
||||
end)
|
||||
|
||||
do
|
||||
@@ -676,6 +689,7 @@ shared.Whoer = {
|
||||
print(
|
||||
string.format("[%s] Error: No WHO query found to run at index %d", ModuleName, whoQueryIdx)
|
||||
)
|
||||
whoQueryIdx = 1
|
||||
end
|
||||
return
|
||||
end
|
||||
@@ -698,8 +712,10 @@ shared.Whoer = {
|
||||
whoQueryIdx = whoQueryIdx + 1
|
||||
if whoQueryIdx > #shared.WhoQueryService.queries then whoQueryIdx = 1 end
|
||||
lastQuery = query
|
||||
whoWaiting = true
|
||||
---@diagnostic disable-next-line: param-type-mismatch
|
||||
SetWhoToUI(1)
|
||||
SetWhoToUI(1)
|
||||
SendWho(query.query)
|
||||
end
|
||||
local function Tick()
|
||||
@@ -708,7 +724,12 @@ shared.Whoer = {
|
||||
end
|
||||
Tick()
|
||||
end
|
||||
local original_FriendsFrame_OnEvent = FriendsFrame_OnEvent
|
||||
local function my_FriendsFrame_OnEvent(self, event, ...)
|
||||
if not (event == "WHO_LIST_UPDATE" and whoWaiting) then original_FriendsFrame_OnEvent(self, event, ...) end
|
||||
end
|
||||
FriendsFrame_OnEvent = my_FriendsFrame_OnEvent
|
||||
|
||||
print("[Heimdall] Whoer loaded")
|
||||
print(string.format("[%s] Module initialized", ModuleName))
|
||||
end,
|
||||
}
|
||||
|
||||
2
_L.lua
2
_L.lua
@@ -90,6 +90,7 @@ shared._Locale = {
|
||||
updateInterval = "Update Interval",
|
||||
networkMessenger = "Network Messenger",
|
||||
queries = "Who queries",
|
||||
chatSniffer = "Chat Sniffer",
|
||||
},
|
||||
ru = {
|
||||
bonkDetected = "%s ударил %s (%s)",
|
||||
@@ -175,6 +176,7 @@ shared._Locale = {
|
||||
updateInterval = "Интервал Обновления",
|
||||
networkMessenger = "Сетевой Мессенджер",
|
||||
queries = "Запросы Who",
|
||||
chatSniffer = "Сниффер Чата",
|
||||
["Orgrimmar"] = "Оргриммар",
|
||||
["Valley of Strength"] = "Долина Силы",
|
||||
["Valley of Trials"] = "Долина Испытаний",
|
||||
|
||||
Reference in New Issue
Block a user