diff --git a/FreshShit/SpySatellite/event3.lua b/FreshShit/SpySatellite/event3.lua index 8fb1c1b..38353d2 100644 --- a/FreshShit/SpySatellite/event3.lua +++ b/FreshShit/SpySatellite/event3.lua @@ -2,6 +2,11 @@ function() for i = 1, GetNumWhoResults() do 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 \ No newline at end of file diff --git a/FreshShit/SpySatellite/init.lua b/FreshShit/SpySatellite/init.lua index 5000667..51e7a79 100644 --- a/FreshShit/SpySatellite/init.lua +++ b/FreshShit/SpySatellite/init.lua @@ -1,4 +1,5 @@ local channelname = aura_env.config.channelname or "lAKDJjZfNgobMblAangc" +aura_env.whoQueued = false if not WeakAurasSaved.Cyka then WeakAurasSaved.Cyka = {} end if not WeakAurasSaved.Cyka.RaceCache then WeakAurasSaved.Cyka.RaceCache = {} end @@ -22,8 +23,21 @@ Player = { return self end, 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) + print(string.format("Queueing who query for player %s: %s", self.name, query)) self.whoQueued = true + aura_env.whoQueued = true SendWho(query) end }