Implement replying to "who" on channel

This commit is contained in:
2024-11-28 16:35:25 +01:00
parent cfa3228ca5
commit 775f6ae076
2 changed files with 24 additions and 5 deletions

View File

@@ -0,0 +1,22 @@
-- CHAT_MSG_CHANNEL
---@type event string
---@type msg string
---@type sender string
function(event, msg, sender, ...)
local channelId = select(6, ...)
if channelId ~= aura_env.channelId then
return
end
if msg == "who" then
for _, player in pairs(aura_env.stinkies) do
local msg = aura_env.MakeNotifyMessage(player)
local message = {
channel = "CHANNEL",
data = channelId,
message = msg
}
table.insert(aura_env.messageQueue, message)
end
end
end

View File

@@ -299,6 +299,7 @@ if not channelId then
JoinPermanentChannel(channel)
end
channelId = GetChannelId(channel)
aura_env.channelId = channelId
print(string.format("channel %s resolved to id %d", channel, channelId))
---@param msg string
@@ -328,7 +329,3 @@ aura_env.NotifyChannelGone = function(player)
player.zone)
NotifyChannel(msg)
end
local foo = Player.new("foo", "bar", "Human", "Warrior", "Orgrimmar")
aura_env.NotifyChannel(foo)