Refine who queueing
This commit is contained in:
@@ -2,6 +2,11 @@
|
|||||||
function()
|
function()
|
||||||
for i = 1, GetNumWhoResults() do
|
for i = 1, GetNumWhoResults() do
|
||||||
local name, guild, level, race, class, zone = GetWhoInfo(i)
|
local name, guild, level, race, class, zone = GetWhoInfo(i)
|
||||||
WeakAurasSaved.Cyka.RaceCache[name] = race
|
local player = WeakAurasSaved.Cyka.Players[name] or Player.new(name)
|
||||||
|
player.guild = guild
|
||||||
|
player.race = race
|
||||||
|
WeakAurasSaved.Cyka.Players[name] = player
|
||||||
|
player.whoQueued = false
|
||||||
|
aura_env.whoQueued = false
|
||||||
end
|
end
|
||||||
end
|
end
|
@@ -1,4 +1,5 @@
|
|||||||
local channelname = aura_env.config.channelname or "lAKDJjZfNgobMblAangc"
|
local channelname = aura_env.config.channelname or "lAKDJjZfNgobMblAangc"
|
||||||
|
aura_env.whoQueued = false
|
||||||
|
|
||||||
if not WeakAurasSaved.Cyka then WeakAurasSaved.Cyka = {} end
|
if not WeakAurasSaved.Cyka then WeakAurasSaved.Cyka = {} end
|
||||||
if not WeakAurasSaved.Cyka.RaceCache then WeakAurasSaved.Cyka.RaceCache = {} end
|
if not WeakAurasSaved.Cyka.RaceCache then WeakAurasSaved.Cyka.RaceCache = {} end
|
||||||
@@ -22,8 +23,21 @@ Player = {
|
|||||||
return self
|
return self
|
||||||
end,
|
end,
|
||||||
QueryWho = function(self)
|
QueryWho = function(self)
|
||||||
|
if aura_env.whoQueued then
|
||||||
|
print(string.format("There is already a who query queued, waiting for player %s", self.name))
|
||||||
|
C_Timer.After(0.5, function()
|
||||||
|
self:QueryWho()
|
||||||
|
end)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if self.whoQueued then
|
||||||
|
print(string.format("Player %s is already queued", self.name))
|
||||||
|
return
|
||||||
|
end
|
||||||
local query = string.format("n-\"%s\"", self.name)
|
local query = string.format("n-\"%s\"", self.name)
|
||||||
|
print(string.format("Queueing who query for player %s: %s", self.name, query))
|
||||||
self.whoQueued = true
|
self.whoQueued = true
|
||||||
|
aura_env.whoQueued = true
|
||||||
SendWho(query)
|
SendWho(query)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user