Code format
This commit is contained in:
@@ -135,21 +135,21 @@ function shared.Whoer.Init()
|
||||
if Heimdall_Data.config.who.debug then
|
||||
print(string.format("[%s] Processing notification for player: %s", ModuleName, player.name))
|
||||
end
|
||||
|
||||
if not Heimdall_Data.config.who.enabled then
|
||||
|
||||
if not Heimdall_Data.config.who.enabled then
|
||||
if Heimdall_Data.config.who.debug then
|
||||
print(string.format("[%s] Module disabled, skipping notification", ModuleName))
|
||||
end
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
if not player then
|
||||
|
||||
if not player then
|
||||
if Heimdall_Data.config.who.debug then
|
||||
print(string.format("[%s] Error: Cannot notify for nil player", ModuleName))
|
||||
end
|
||||
return string.format("Cannot notify for nil player %s", tostring(player))
|
||||
return string.format("Cannot notify for nil player %s", tostring(player))
|
||||
end
|
||||
|
||||
|
||||
if not Heimdall_Data.config.who.zoneNotifyFor[player.zone] then
|
||||
if Heimdall_Data.config.who.debug then
|
||||
print(string.format("[%s] Skipping notification - Zone '%s' not in notify list", ModuleName, player.zone))
|
||||
@@ -161,7 +161,7 @@ function shared.Whoer.Init()
|
||||
if Heimdall_Data.config.who.debug then
|
||||
print(string.format("[%s] Queuing channel notification: '%s'", ModuleName, text))
|
||||
end
|
||||
|
||||
|
||||
---@type Message
|
||||
local msg = {
|
||||
channel = "CHANNEL",
|
||||
@@ -172,7 +172,8 @@ function shared.Whoer.Init()
|
||||
|
||||
if Heimdall_Data.config.who.doWhisper then
|
||||
if Heimdall_Data.config.who.debug then
|
||||
print(string.format("[%s] Processing whisper notifications for %d recipients", ModuleName, #Heimdall_Data.config.whisperNotify))
|
||||
print(string.format("[%s] Processing whisper notifications for %d recipients", ModuleName,
|
||||
#Heimdall_Data.config.whisperNotify))
|
||||
end
|
||||
for _, name in pairs(Heimdall_Data.config.whisperNotify) do
|
||||
---@type Message
|
||||
@@ -275,14 +276,14 @@ function shared.Whoer.Init()
|
||||
if Heimdall_Data.config.who.debug then
|
||||
print(string.format("[%s] WHO list update received", ModuleName))
|
||||
end
|
||||
|
||||
if not Heimdall_Data.config.who.enabled then
|
||||
|
||||
if not Heimdall_Data.config.who.enabled then
|
||||
if Heimdall_Data.config.who.debug then
|
||||
print(string.format("[%s] Module disabled, ignoring WHO update", ModuleName))
|
||||
end
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
---@type WHOQuery?
|
||||
local query = lastQuery
|
||||
if not query then
|
||||
@@ -302,7 +303,7 @@ function shared.Whoer.Init()
|
||||
if Heimdall_Data.config.who.debug then
|
||||
print(string.format("[%s] Processing result %d/%d: %s/%s/%s", ModuleName, i, results, name, class, zone))
|
||||
end
|
||||
|
||||
|
||||
local continue = false
|
||||
---@type WHOFilter[]
|
||||
local filters = query.filters
|
||||
@@ -315,12 +316,12 @@ function shared.Whoer.Init()
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if Heimdall_Data.config.who.ignored[name] then
|
||||
|
||||
if Heimdall_Data.config.who.ignored[name] then
|
||||
if Heimdall_Data.config.who.debug then
|
||||
print(string.format("[%s] Ignoring blacklisted player: %s", ModuleName, name))
|
||||
end
|
||||
continue = true
|
||||
continue = true
|
||||
end
|
||||
|
||||
if not continue then
|
||||
@@ -330,7 +331,7 @@ function shared.Whoer.Init()
|
||||
if Heimdall_Data.config.who.debug then
|
||||
print(string.format("[%s] New player detected: %s (%s) in %s", ModuleName, name, class, zone))
|
||||
end
|
||||
|
||||
|
||||
player = Player.new(name, guild, race, class, zone)
|
||||
if not Heimdall_Data.who then Heimdall_Data.who = {} end
|
||||
if not Heimdall_Data.who.data then Heimdall_Data.who.data = {} end
|
||||
@@ -338,14 +339,14 @@ function shared.Whoer.Init()
|
||||
|
||||
if existing then
|
||||
if Heimdall_Data.config.who.debug then
|
||||
print(string.format("[%s] Found existing data for %s - Last seen: %s, Count: %d",
|
||||
print(string.format("[%s] Found existing data for %s - Last seen: %s, Count: %d",
|
||||
ModuleName, name, existing.lastSeen or "never", existing.seenCount or 0))
|
||||
end
|
||||
player.lastSeen = existing.lastSeen or "never"
|
||||
player.firstSeen = existing.firstSeen or "never"
|
||||
player.seenCount = existing.seenCount or 0
|
||||
end
|
||||
|
||||
|
||||
if player.firstSeen == "never" then
|
||||
player.firstSeen = timestamp
|
||||
if Heimdall_Data.config.who.debug then
|
||||
@@ -359,6 +360,9 @@ function shared.Whoer.Init()
|
||||
print(string.format("[%s] Player %s marked as stinky!", ModuleName, name))
|
||||
end
|
||||
player.stinky = true
|
||||
--PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master")
|
||||
else
|
||||
--PlaySoundFile("Interface\\Sounds\\Cloak.ogg", "Master")
|
||||
end
|
||||
|
||||
local err = Notify(player)
|
||||
@@ -432,4 +436,3 @@ function shared.Whoer.Init()
|
||||
|
||||
print("Heimdall - Whoer loaded")
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user