Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions layering.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ addonTable.activeLayerChannel = nil

-- Channel list - will be populated after all addons load
local LAYER_CHANNELS = {}
local channelJoinRetries = 0

-- Generate dynamic channel names based on server date and realm name
local function GenerateLayerChannels()
Expand Down Expand Up @@ -620,6 +621,24 @@ function JoinLayerChannel()
-- Join ALL channels to prevent griefing (so griefers can't become admin in empty channels)
-- Only try each channel once - if it fails (e.g. password protected), don't retry

-- Wait for default channels (General, Trade) to be joined first
-- This prevents our layer channels from taking up low-numbered slots
-- After 2 retries (6 seconds total), proceed anyway for players without default channels
local channelCount = 0
for i = 1, MAX_WOW_CHAT_CHANNELS or 20 do
local _, name = GetChannelName(i)
if name and name ~= "" then
channelCount = channelCount + 1
end
end

if channelCount < 2 and channelJoinRetries < 2 then
channelJoinRetries = channelJoinRetries + 1
AutoLayer:DebugPrint("Waiting for default channels to load... (currently " .. channelCount .. " channels, retry " .. channelJoinRetries .. "/2)")
C_Timer.After(2, JoinLayerChannel)
return
end

-- Step 1: Attempt to join all channels that are not marked as failed
for _, channelName in ipairs(LAYER_CHANNELS) do
if not failedChannels[channelName] then
Expand Down