diff --git a/embeds.xml b/embeds.xml
index c3be787..d8f0ea9 100644
--- a/embeds.xml
+++ b/embeds.xml
@@ -13,14 +13,8 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/libs/AceComm-3.0/AceComm-3.0.lua b/libs/AceComm-3.0/AceComm-3.0.lua
deleted file mode 100644
index 242d92c..0000000
--- a/libs/AceComm-3.0/AceComm-3.0.lua
+++ /dev/null
@@ -1,305 +0,0 @@
---- **AceComm-3.0** allows you to send messages of unlimited length over the addon comm channels.
--- It'll automatically split the messages into multiple parts and rebuild them on the receiving end.\\
--- **ChatThrottleLib** is of course being used to avoid being disconnected by the server.
---
--- **AceComm-3.0** can be embeded into your addon, either explicitly by calling AceComm:Embed(MyAddon) or by
--- specifying it as an embeded library in your AceAddon. All functions will be available on your addon object
--- and can be accessed directly, without having to explicitly call AceComm itself.\\
--- It is recommended to embed AceComm, otherwise you'll have to specify a custom `self` on all calls you
--- make into AceComm.
--- @class file
--- @name AceComm-3.0
--- @release $Id: AceComm-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
-
---[[ AceComm-3.0
-
-TODO: Time out old data rotting around from dead senders? Not a HUGE deal since the number of possible sender names is somewhat limited.
-
-]]
-
-local CallbackHandler = LibStub("CallbackHandler-1.0")
-local CTL = assert(ChatThrottleLib, "AceComm-3.0 requires ChatThrottleLib")
-
-local MAJOR, MINOR = "AceComm-3.0", 12
-local AceComm,oldminor = LibStub:NewLibrary(MAJOR, MINOR)
-
-if not AceComm then return end
-
--- Lua APIs
-local type, next, pairs, tostring = type, next, pairs, tostring
-local strsub, strfind = string.sub, string.find
-local match = string.match
-local tinsert, tconcat = table.insert, table.concat
-local error, assert = error, assert
-
--- WoW APIs
-local Ambiguate = Ambiguate
-
--- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
--- List them here for Mikk's FindGlobals script
--- GLOBALS: LibStub, DEFAULT_CHAT_FRAME, geterrorhandler, RegisterAddonMessagePrefix
-
-AceComm.embeds = AceComm.embeds or {}
-
--- for my sanity and yours, let's give the message type bytes some names
-local MSG_MULTI_FIRST = "\001"
-local MSG_MULTI_NEXT = "\002"
-local MSG_MULTI_LAST = "\003"
-local MSG_ESCAPE = "\004"
-
--- remove old structures (pre WoW 4.0)
-AceComm.multipart_origprefixes = nil
-AceComm.multipart_reassemblers = nil
-
--- the multipart message spool: indexed by a combination of sender+distribution+
-AceComm.multipart_spool = AceComm.multipart_spool or {}
-
---- Register for Addon Traffic on a specified prefix
--- @param prefix A printable character (\032-\255) classification of the message (typically AddonName or AddonNameEvent), max 16 characters
--- @param method Callback to call on message reception: Function reference, or method name (string) to call on self. Defaults to "OnCommReceived"
-function AceComm:RegisterComm(prefix, method)
- if method == nil then
- method = "OnCommReceived"
- end
-
- if #prefix > 16 then -- TODO: 15?
- error("AceComm:RegisterComm(prefix,method): prefix length is limited to 16 characters")
- end
- if C_ChatInfo then
- C_ChatInfo.RegisterAddonMessagePrefix(prefix)
- else
- RegisterAddonMessagePrefix(prefix)
- end
-
- return AceComm._RegisterComm(self, prefix, method) -- created by CallbackHandler
-end
-
-local warnedPrefix=false
-
---- Send a message over the Addon Channel
--- @param prefix A printable character (\032-\255) classification of the message (typically AddonName or AddonNameEvent)
--- @param text Data to send, nils (\000) not allowed. Any length.
--- @param distribution Addon channel, e.g. "RAID", "GUILD", etc; see SendAddonMessage API
--- @param target Destination for some distributions; see SendAddonMessage API
--- @param prio OPTIONAL: ChatThrottleLib priority, "BULK", "NORMAL" or "ALERT". Defaults to "NORMAL".
--- @param callbackFn OPTIONAL: callback function to be called as each chunk is sent. receives 3 args: the user supplied arg (see next), the number of bytes sent so far, and the number of bytes total to send.
--- @param callbackArg: OPTIONAL: first arg to the callback function. nil will be passed if not specified.
-function AceComm:SendCommMessage(prefix, text, distribution, target, prio, callbackFn, callbackArg)
- prio = prio or "NORMAL" -- pasta's reference implementation had different prio for singlepart and multipart, but that's a very bad idea since that can easily lead to out-of-sequence delivery!
- if not( type(prefix)=="string" and
- type(text)=="string" and
- type(distribution)=="string" and
- (target==nil or type(target)=="string" or type(target)=="number") and
- (prio=="BULK" or prio=="NORMAL" or prio=="ALERT")
- ) then
- error('Usage: SendCommMessage(addon, "prefix", "text", "distribution"[, "target"[, "prio"[, callbackFn, callbackarg]]])', 2)
- end
-
- local textlen = #text
- local maxtextlen = 255 -- Yes, the max is 255 even if the dev post said 256. I tested. Char 256+ get silently truncated. /Mikk, 20110327
- local queueName = prefix..distribution..(target or "")
-
- local ctlCallback = nil
- if callbackFn then
- ctlCallback = function(sent)
- return callbackFn(callbackArg, sent, textlen)
- end
- end
-
- local forceMultipart
- if match(text, "^[\001-\009]") then -- 4.1+: see if the first character is a control character
- -- we need to escape the first character with a \004
- if textlen+1 > maxtextlen then -- would we go over the size limit?
- forceMultipart = true -- just make it multipart, no escape problems then
- else
- text = "\004" .. text
- end
- end
-
- if not forceMultipart and textlen <= maxtextlen then
- -- fits all in one message
- CTL:SendAddonMessage(prio, prefix, text, distribution, target, queueName, ctlCallback, textlen)
- else
- maxtextlen = maxtextlen - 1 -- 1 extra byte for part indicator in prefix(4.0)/start of message(4.1)
-
- -- first part
- local chunk = strsub(text, 1, maxtextlen)
- CTL:SendAddonMessage(prio, prefix, MSG_MULTI_FIRST..chunk, distribution, target, queueName, ctlCallback, maxtextlen)
-
- -- continuation
- local pos = 1+maxtextlen
-
- while pos+maxtextlen <= textlen do
- chunk = strsub(text, pos, pos+maxtextlen-1)
- CTL:SendAddonMessage(prio, prefix, MSG_MULTI_NEXT..chunk, distribution, target, queueName, ctlCallback, pos+maxtextlen-1)
- pos = pos + maxtextlen
- end
-
- -- final part
- chunk = strsub(text, pos)
- CTL:SendAddonMessage(prio, prefix, MSG_MULTI_LAST..chunk, distribution, target, queueName, ctlCallback, textlen)
- end
-end
-
-
-----------------------------------------
--- Message receiving
-----------------------------------------
-
-do
- local compost = setmetatable({}, {__mode = "k"})
- local function new()
- local t = next(compost)
- if t then
- compost[t]=nil
- for i=#t,3,-1 do -- faster than pairs loop. don't even nil out 1/2 since they'll be overwritten
- t[i]=nil
- end
- return t
- end
-
- return {}
- end
-
- local function lostdatawarning(prefix,sender,where)
- DEFAULT_CHAT_FRAME:AddMessage(MAJOR..": Warning: lost network data regarding '"..tostring(prefix).."' from '"..tostring(sender).."' (in "..where..")")
- end
-
- function AceComm:OnReceiveMultipartFirst(prefix, message, distribution, sender)
- local key = prefix.."\t"..distribution.."\t"..sender -- a unique stream is defined by the prefix + distribution + sender
- local spool = AceComm.multipart_spool
-
- --[[
- if spool[key] then
- lostdatawarning(prefix,sender,"First")
- -- continue and overwrite
- end
- --]]
-
- spool[key] = message -- plain string for now
- end
-
- function AceComm:OnReceiveMultipartNext(prefix, message, distribution, sender)
- local key = prefix.."\t"..distribution.."\t"..sender -- a unique stream is defined by the prefix + distribution + sender
- local spool = AceComm.multipart_spool
- local olddata = spool[key]
-
- if not olddata then
- --lostdatawarning(prefix,sender,"Next")
- return
- end
-
- if type(olddata)~="table" then
- -- ... but what we have is not a table. So make it one. (Pull a composted one if available)
- local t = new()
- t[1] = olddata -- add old data as first string
- t[2] = message -- and new message as second string
- spool[key] = t -- and put the table in the spool instead of the old string
- else
- tinsert(olddata, message)
- end
- end
-
- function AceComm:OnReceiveMultipartLast(prefix, message, distribution, sender)
- local key = prefix.."\t"..distribution.."\t"..sender -- a unique stream is defined by the prefix + distribution + sender
- local spool = AceComm.multipart_spool
- local olddata = spool[key]
-
- if not olddata then
- --lostdatawarning(prefix,sender,"End")
- return
- end
-
- spool[key] = nil
-
- if type(olddata) == "table" then
- -- if we've received a "next", the spooled data will be a table for rapid & garbage-free tconcat
- tinsert(olddata, message)
- AceComm.callbacks:Fire(prefix, tconcat(olddata, ""), distribution, sender)
- compost[olddata] = true
- else
- -- if we've only received a "first", the spooled data will still only be a string
- AceComm.callbacks:Fire(prefix, olddata..message, distribution, sender)
- end
- end
-end
-
-
-
-
-
-
-----------------------------------------
--- Embed CallbackHandler
-----------------------------------------
-
-if not AceComm.callbacks then
- AceComm.callbacks = CallbackHandler:New(AceComm,
- "_RegisterComm",
- "UnregisterComm",
- "UnregisterAllComm")
-end
-
-AceComm.callbacks.OnUsed = nil
-AceComm.callbacks.OnUnused = nil
-
-local function OnEvent(self, event, prefix, message, distribution, sender)
- if event == "CHAT_MSG_ADDON" then
- sender = Ambiguate(sender, "none")
- local control, rest = match(message, "^([\001-\009])(.*)")
- if control then
- if control==MSG_MULTI_FIRST then
- AceComm:OnReceiveMultipartFirst(prefix, rest, distribution, sender)
- elseif control==MSG_MULTI_NEXT then
- AceComm:OnReceiveMultipartNext(prefix, rest, distribution, sender)
- elseif control==MSG_MULTI_LAST then
- AceComm:OnReceiveMultipartLast(prefix, rest, distribution, sender)
- elseif control==MSG_ESCAPE then
- AceComm.callbacks:Fire(prefix, rest, distribution, sender)
- else
- -- unknown control character, ignore SILENTLY (dont warn unnecessarily about future extensions!)
- end
- else
- -- single part: fire it off immediately and let CallbackHandler decide if it's registered or not
- AceComm.callbacks:Fire(prefix, message, distribution, sender)
- end
- else
- assert(false, "Received "..tostring(event).." event?!")
- end
-end
-
-AceComm.frame = AceComm.frame or CreateFrame("Frame", "AceComm30Frame")
-AceComm.frame:SetScript("OnEvent", OnEvent)
-AceComm.frame:UnregisterAllEvents()
-AceComm.frame:RegisterEvent("CHAT_MSG_ADDON")
-
-
-----------------------------------------
--- Base library stuff
-----------------------------------------
-
-local mixins = {
- "RegisterComm",
- "UnregisterComm",
- "UnregisterAllComm",
- "SendCommMessage",
-}
-
--- Embeds AceComm-3.0 into the target object making the functions from the mixins list available on target:..
--- @param target target object to embed AceComm-3.0 in
-function AceComm:Embed(target)
- for k, v in pairs(mixins) do
- target[v] = self[v]
- end
- self.embeds[target] = true
- return target
-end
-
-function AceComm:OnEmbedDisable(target)
- target:UnregisterAllComm()
-end
-
--- Update embeds
-for target, v in pairs(AceComm.embeds) do
- AceComm:Embed(target)
-end
diff --git a/libs/AceComm-3.0/AceComm-3.0.xml b/libs/AceComm-3.0/AceComm-3.0.xml
deleted file mode 100644
index 24fb43b..0000000
--- a/libs/AceComm-3.0/AceComm-3.0.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
diff --git a/libs/AceComm-3.0/ChatThrottleLib.lua b/libs/AceComm-3.0/ChatThrottleLib.lua
deleted file mode 100644
index d1dd8a0..0000000
--- a/libs/AceComm-3.0/ChatThrottleLib.lua
+++ /dev/null
@@ -1,534 +0,0 @@
---
--- ChatThrottleLib by Mikk
---
--- Manages AddOn chat output to keep player from getting kicked off.
---
--- ChatThrottleLib:SendChatMessage/:SendAddonMessage functions that accept
--- a Priority ("BULK", "NORMAL", "ALERT") as well as prefix for SendChatMessage.
---
--- Priorities get an equal share of available bandwidth when fully loaded.
--- Communication channels are separated on extension+chattype+destination and
--- get round-robinned. (Destination only matters for whispers and channels,
--- obviously)
---
--- Will install hooks for SendChatMessage and SendAddonMessage to measure
--- bandwidth bypassing the library and use less bandwidth itself.
---
---
--- Fully embeddable library. Just copy this file into your addon directory,
--- add it to the .toc, and it's done.
---
--- Can run as a standalone addon also, but, really, just embed it! :-)
---
--- LICENSE: ChatThrottleLib is released into the Public Domain
---
-
-local CTL_VERSION = 24
-
-local _G = _G
-
-if _G.ChatThrottleLib then
- if _G.ChatThrottleLib.version >= CTL_VERSION then
- -- There's already a newer (or same) version loaded. Buh-bye.
- return
- elseif not _G.ChatThrottleLib.securelyHooked then
- print("ChatThrottleLib: Warning: There's an ANCIENT ChatThrottleLib.lua (pre-wow 2.0, =v16) in it!")
- -- ATTEMPT to unhook; this'll behave badly if someone else has hooked...
- -- ... and if someone has securehooked, they can kiss that goodbye too... >.<
- _G.SendChatMessage = _G.ChatThrottleLib.ORIG_SendChatMessage
- if _G.ChatThrottleLib.ORIG_SendAddonMessage then
- _G.SendAddonMessage = _G.ChatThrottleLib.ORIG_SendAddonMessage
- end
- end
- _G.ChatThrottleLib.ORIG_SendChatMessage = nil
- _G.ChatThrottleLib.ORIG_SendAddonMessage = nil
-end
-
-if not _G.ChatThrottleLib then
- _G.ChatThrottleLib = {}
-end
-
-ChatThrottleLib = _G.ChatThrottleLib -- in case some addon does "local ChatThrottleLib" above us and we're copypasted (AceComm-2, sigh)
-local ChatThrottleLib = _G.ChatThrottleLib
-
-ChatThrottleLib.version = CTL_VERSION
-
-
-
------------------- TWEAKABLES -----------------
-
-ChatThrottleLib.MAX_CPS = 800 -- 2000 seems to be safe if NOTHING ELSE is happening. let's call it 800.
-ChatThrottleLib.MSG_OVERHEAD = 40 -- Guesstimate overhead for sending a message; source+dest+chattype+protocolstuff
-
-ChatThrottleLib.BURST = 4000 -- WoW's server buffer seems to be about 32KB. 8KB should be safe, but seen disconnects on _some_ servers. Using 4KB now.
-
-ChatThrottleLib.MIN_FPS = 20 -- Reduce output CPS to half (and don't burst) if FPS drops below this value
-
-
-local setmetatable = setmetatable
-local table_remove = table.remove
-local tostring = tostring
-local GetTime = GetTime
-local math_min = math.min
-local math_max = math.max
-local next = next
-local strlen = string.len
-local GetFramerate = GetFramerate
-local strlower = string.lower
-local unpack,type,pairs,wipe = unpack,type,pairs,table.wipe
-local UnitInRaid,UnitInParty = UnitInRaid,UnitInParty
-
-
------------------------------------------------------------------------
--- Double-linked ring implementation
-
-local Ring = {}
-local RingMeta = { __index = Ring }
-
-function Ring:New()
- local ret = {}
- setmetatable(ret, RingMeta)
- return ret
-end
-
-function Ring:Add(obj) -- Append at the "far end" of the ring (aka just before the current position)
- if self.pos then
- obj.prev = self.pos.prev
- obj.prev.next = obj
- obj.next = self.pos
- obj.next.prev = obj
- else
- obj.next = obj
- obj.prev = obj
- self.pos = obj
- end
-end
-
-function Ring:Remove(obj)
- obj.next.prev = obj.prev
- obj.prev.next = obj.next
- if self.pos == obj then
- self.pos = obj.next
- if self.pos == obj then
- self.pos = nil
- end
- end
-end
-
-
-
------------------------------------------------------------------------
--- Recycling bin for pipes
--- A pipe is a plain integer-indexed queue of messages
--- Pipes normally live in Rings of pipes (3 rings total, one per priority)
-
-ChatThrottleLib.PipeBin = nil -- pre-v19, drastically different
-local PipeBin = setmetatable({}, {__mode="k"})
-
-local function DelPipe(pipe)
- PipeBin[pipe] = true
-end
-
-local function NewPipe()
- local pipe = next(PipeBin)
- if pipe then
- wipe(pipe)
- PipeBin[pipe] = nil
- return pipe
- end
- return {}
-end
-
-
-
-
------------------------------------------------------------------------
--- Recycling bin for messages
-
-ChatThrottleLib.MsgBin = nil -- pre-v19, drastically different
-local MsgBin = setmetatable({}, {__mode="k"})
-
-local function DelMsg(msg)
- msg[1] = nil
- -- there's more parameters, but they're very repetetive so the string pool doesn't suffer really, and it's faster to just not delete them.
- MsgBin[msg] = true
-end
-
-local function NewMsg()
- local msg = next(MsgBin)
- if msg then
- MsgBin[msg] = nil
- return msg
- end
- return {}
-end
-
-
------------------------------------------------------------------------
--- ChatThrottleLib:Init
--- Initialize queues, set up frame for OnUpdate, etc
-
-
-function ChatThrottleLib:Init()
-
- -- Set up queues
- if not self.Prio then
- self.Prio = {}
- self.Prio["ALERT"] = { ByName = {}, Ring = Ring:New(), avail = 0 }
- self.Prio["NORMAL"] = { ByName = {}, Ring = Ring:New(), avail = 0 }
- self.Prio["BULK"] = { ByName = {}, Ring = Ring:New(), avail = 0 }
- end
-
- -- v4: total send counters per priority
- for _, Prio in pairs(self.Prio) do
- Prio.nTotalSent = Prio.nTotalSent or 0
- end
-
- if not self.avail then
- self.avail = 0 -- v5
- end
- if not self.nTotalSent then
- self.nTotalSent = 0 -- v5
- end
-
-
- -- Set up a frame to get OnUpdate events
- if not self.Frame then
- self.Frame = CreateFrame("Frame")
- self.Frame:Hide()
- end
- self.Frame:SetScript("OnUpdate", self.OnUpdate)
- self.Frame:SetScript("OnEvent", self.OnEvent) -- v11: Monitor P_E_W so we can throttle hard for a few seconds
- self.Frame:RegisterEvent("PLAYER_ENTERING_WORLD")
- self.OnUpdateDelay = 0
- self.LastAvailUpdate = GetTime()
- self.HardThrottlingBeginTime = GetTime() -- v11: Throttle hard for a few seconds after startup
-
- -- Hook SendChatMessage and SendAddonMessage so we can measure unpiped traffic and avoid overloads (v7)
- if not self.securelyHooked then
- -- Use secure hooks as of v16. Old regular hook support yanked out in v21.
- self.securelyHooked = true
- --SendChatMessage
- hooksecurefunc("SendChatMessage", function(...)
- return ChatThrottleLib.Hook_SendChatMessage(...)
- end)
- --SendAddonMessage
- if _G.C_ChatInfo then
- hooksecurefunc(_G.C_ChatInfo, "SendAddonMessage", function(...)
- return ChatThrottleLib.Hook_SendAddonMessage(...)
- end)
- else
- hooksecurefunc("SendAddonMessage", function(...)
- return ChatThrottleLib.Hook_SendAddonMessage(...)
- end)
- end
- end
- self.nBypass = 0
-end
-
-
------------------------------------------------------------------------
--- ChatThrottleLib.Hook_SendChatMessage / .Hook_SendAddonMessage
-
-local bMyTraffic = false
-
-function ChatThrottleLib.Hook_SendChatMessage(text, chattype, language, destination, ...)
- if bMyTraffic then
- return
- end
- local self = ChatThrottleLib
- local size = strlen(tostring(text or "")) + strlen(tostring(destination or "")) + self.MSG_OVERHEAD
- self.avail = self.avail - size
- self.nBypass = self.nBypass + size -- just a statistic
-end
-function ChatThrottleLib.Hook_SendAddonMessage(prefix, text, chattype, destination, ...)
- if bMyTraffic then
- return
- end
- local self = ChatThrottleLib
- local size = tostring(text or ""):len() + tostring(prefix or ""):len();
- size = size + tostring(destination or ""):len() + self.MSG_OVERHEAD
- self.avail = self.avail - size
- self.nBypass = self.nBypass + size -- just a statistic
-end
-
-
-
------------------------------------------------------------------------
--- ChatThrottleLib:UpdateAvail
--- Update self.avail with how much bandwidth is currently available
-
-function ChatThrottleLib:UpdateAvail()
- local now = GetTime()
- local MAX_CPS = self.MAX_CPS;
- local newavail = MAX_CPS * (now - self.LastAvailUpdate)
- local avail = self.avail
-
- if now - self.HardThrottlingBeginTime < 5 then
- -- First 5 seconds after startup/zoning: VERY hard clamping to avoid irritating the server rate limiter, it seems very cranky then
- avail = math_min(avail + (newavail*0.1), MAX_CPS*0.5)
- self.bChoking = true
- elseif GetFramerate() < self.MIN_FPS then -- GetFrameRate call takes ~0.002 secs
- avail = math_min(MAX_CPS, avail + newavail*0.5)
- self.bChoking = true -- just a statistic
- else
- avail = math_min(self.BURST, avail + newavail)
- self.bChoking = false
- end
-
- avail = math_max(avail, 0-(MAX_CPS*2)) -- Can go negative when someone is eating bandwidth past the lib. but we refuse to stay silent for more than 2 seconds; if they can do it, we can.
-
- self.avail = avail
- self.LastAvailUpdate = now
-
- return avail
-end
-
-
------------------------------------------------------------------------
--- Despooling logic
--- Reminder:
--- - We have 3 Priorities, each containing a "Ring" construct ...
--- - ... made up of N "Pipe"s (1 for each destination/pipename)
--- - and each pipe contains messages
-
-function ChatThrottleLib:Despool(Prio)
- local ring = Prio.Ring
- while ring.pos and Prio.avail > ring.pos[1].nSize do
- local msg = table_remove(ring.pos, 1)
- if not ring.pos[1] then -- did we remove last msg in this pipe?
- local pipe = Prio.Ring.pos
- Prio.Ring:Remove(pipe)
- Prio.ByName[pipe.name] = nil
- DelPipe(pipe)
- else
- Prio.Ring.pos = Prio.Ring.pos.next
- end
- local didSend=false
- local lowerDest = strlower(msg[3] or "")
- if lowerDest == "raid" and not UnitInRaid("player") then
- -- do nothing
- elseif lowerDest == "party" and not UnitInParty("player") then
- -- do nothing
- else
- Prio.avail = Prio.avail - msg.nSize
- bMyTraffic = true
- msg.f(unpack(msg, 1, msg.n))
- bMyTraffic = false
- Prio.nTotalSent = Prio.nTotalSent + msg.nSize
- DelMsg(msg)
- didSend = true
- end
- -- notify caller of delivery (even if we didn't send it)
- if msg.callbackFn then
- msg.callbackFn (msg.callbackArg, didSend)
- end
- -- USER CALLBACK MAY ERROR
- end
-end
-
-
-function ChatThrottleLib.OnEvent(this,event)
- -- v11: We know that the rate limiter is touchy after login. Assume that it's touchy after zoning, too.
- local self = ChatThrottleLib
- if event == "PLAYER_ENTERING_WORLD" then
- self.HardThrottlingBeginTime = GetTime() -- Throttle hard for a few seconds after zoning
- self.avail = 0
- end
-end
-
-
-function ChatThrottleLib.OnUpdate(this,delay)
- local self = ChatThrottleLib
-
- self.OnUpdateDelay = self.OnUpdateDelay + delay
- if self.OnUpdateDelay < 0.08 then
- return
- end
- self.OnUpdateDelay = 0
-
- self:UpdateAvail()
-
- if self.avail < 0 then
- return -- argh. some bastard is spewing stuff past the lib. just bail early to save cpu.
- end
-
- -- See how many of our priorities have queued messages (we only have 3, don't worry about the loop)
- local n = 0
- for prioname,Prio in pairs(self.Prio) do
- if Prio.Ring.pos or Prio.avail < 0 then
- n = n + 1
- end
- end
-
- -- Anything queued still?
- if n<1 then
- -- Nope. Move spillover bandwidth to global availability gauge and clear self.bQueueing
- for prioname, Prio in pairs(self.Prio) do
- self.avail = self.avail + Prio.avail
- Prio.avail = 0
- end
- self.bQueueing = false
- self.Frame:Hide()
- return
- end
-
- -- There's stuff queued. Hand out available bandwidth to priorities as needed and despool their queues
- local avail = self.avail/n
- self.avail = 0
-
- for prioname, Prio in pairs(self.Prio) do
- if Prio.Ring.pos or Prio.avail < 0 then
- Prio.avail = Prio.avail + avail
- if Prio.Ring.pos and Prio.avail > Prio.Ring.pos[1].nSize then
- self:Despool(Prio)
- -- Note: We might not get here if the user-supplied callback function errors out! Take care!
- end
- end
- end
-
-end
-
-
-
-
------------------------------------------------------------------------
--- Spooling logic
-
-function ChatThrottleLib:Enqueue(prioname, pipename, msg)
- local Prio = self.Prio[prioname]
- local pipe = Prio.ByName[pipename]
- if not pipe then
- self.Frame:Show()
- pipe = NewPipe()
- pipe.name = pipename
- Prio.ByName[pipename] = pipe
- Prio.Ring:Add(pipe)
- end
-
- pipe[#pipe + 1] = msg
-
- self.bQueueing = true
-end
-
-function ChatThrottleLib:SendChatMessage(prio, prefix, text, chattype, language, destination, queueName, callbackFn, callbackArg)
- if not self or not prio or not prefix or not text or not self.Prio[prio] then
- error('Usage: ChatThrottleLib:SendChatMessage("{BULK||NORMAL||ALERT}", "prefix", "text"[, "chattype"[, "language"[, "destination"]]]', 2)
- end
- if callbackFn and type(callbackFn)~="function" then
- error('ChatThrottleLib:ChatMessage(): callbackFn: expected function, got '..type(callbackFn), 2)
- end
-
- local nSize = text:len()
-
- if nSize>255 then
- error("ChatThrottleLib:SendChatMessage(): message length cannot exceed 255 bytes", 2)
- end
-
- nSize = nSize + self.MSG_OVERHEAD
-
- -- Check if there's room in the global available bandwidth gauge to send directly
- if not self.bQueueing and nSize < self:UpdateAvail() then
- self.avail = self.avail - nSize
- bMyTraffic = true
- _G.SendChatMessage(text, chattype, language, destination)
- bMyTraffic = false
- self.Prio[prio].nTotalSent = self.Prio[prio].nTotalSent + nSize
- if callbackFn then
- callbackFn (callbackArg, true)
- end
- -- USER CALLBACK MAY ERROR
- return
- end
-
- -- Message needs to be queued
- local msg = NewMsg()
- msg.f = _G.SendChatMessage
- msg[1] = text
- msg[2] = chattype or "SAY"
- msg[3] = language
- msg[4] = destination
- msg.n = 4
- msg.nSize = nSize
- msg.callbackFn = callbackFn
- msg.callbackArg = callbackArg
-
- self:Enqueue(prio, queueName or (prefix..(chattype or "SAY")..(destination or "")), msg)
-end
-
-
-function ChatThrottleLib:SendAddonMessage(prio, prefix, text, chattype, target, queueName, callbackFn, callbackArg)
- if not self or not prio or not prefix or not text or not chattype or not self.Prio[prio] then
- error('Usage: ChatThrottleLib:SendAddonMessage("{BULK||NORMAL||ALERT}", "prefix", "text", "chattype"[, "target"])', 2)
- end
- if callbackFn and type(callbackFn)~="function" then
- error('ChatThrottleLib:SendAddonMessage(): callbackFn: expected function, got '..type(callbackFn), 2)
- end
-
- local nSize = text:len();
-
- if C_ChatInfo or RegisterAddonMessagePrefix then
- if nSize>255 then
- error("ChatThrottleLib:SendAddonMessage(): message length cannot exceed 255 bytes", 2)
- end
- else
- nSize = nSize + prefix:len() + 1
- if nSize>255 then
- error("ChatThrottleLib:SendAddonMessage(): prefix + message length cannot exceed 254 bytes", 2)
- end
- end
-
- nSize = nSize + self.MSG_OVERHEAD;
-
- -- Check if there's room in the global available bandwidth gauge to send directly
- if not self.bQueueing and nSize < self:UpdateAvail() then
- self.avail = self.avail - nSize
- bMyTraffic = true
- if _G.C_ChatInfo then
- _G.C_ChatInfo.SendAddonMessage(prefix, text, chattype, target)
- else
- _G.SendAddonMessage(prefix, text, chattype, target)
- end
- bMyTraffic = false
- self.Prio[prio].nTotalSent = self.Prio[prio].nTotalSent + nSize
- if callbackFn then
- callbackFn (callbackArg, true)
- end
- -- USER CALLBACK MAY ERROR
- return
- end
-
- -- Message needs to be queued
- local msg = NewMsg()
- msg.f = _G.C_ChatInfo and _G.C_ChatInfo.SendAddonMessage or _G.SendAddonMessage
- msg[1] = prefix
- msg[2] = text
- msg[3] = chattype
- msg[4] = target
- msg.n = (target~=nil) and 4 or 3;
- msg.nSize = nSize
- msg.callbackFn = callbackFn
- msg.callbackArg = callbackArg
-
- self:Enqueue(prio, queueName or (prefix..chattype..(target or "")), msg)
-end
-
-
-
-
------------------------------------------------------------------------
--- Get the ball rolling!
-
-ChatThrottleLib:Init()
-
---[[ WoWBench debugging snippet
-if(WOWB_VER) then
- local function SayTimer()
- print("SAY: "..GetTime().." "..arg1)
- end
- ChatThrottleLib.Frame:SetScript("OnEvent", SayTimer)
- ChatThrottleLib.Frame:RegisterEvent("CHAT_MSG_SAY")
-end
-]]
-
-
diff --git a/libs/AceEvent-3.0/AceEvent-3.0.lua b/libs/AceEvent-3.0/AceEvent-3.0.lua
deleted file mode 100644
index 7ccd880..0000000
--- a/libs/AceEvent-3.0/AceEvent-3.0.lua
+++ /dev/null
@@ -1,126 +0,0 @@
---- AceEvent-3.0 provides event registration and secure dispatching.
--- All dispatching is done using **CallbackHandler-1.0**. AceEvent is a simple wrapper around
--- CallbackHandler, and dispatches all game events or addon message to the registrees.
---
--- **AceEvent-3.0** can be embeded into your addon, either explicitly by calling AceEvent:Embed(MyAddon) or by
--- specifying it as an embeded library in your AceAddon. All functions will be available on your addon object
--- and can be accessed directly, without having to explicitly call AceEvent itself.\\
--- It is recommended to embed AceEvent, otherwise you'll have to specify a custom `self` on all calls you
--- make into AceEvent.
--- @class file
--- @name AceEvent-3.0
--- @release $Id: AceEvent-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
-local CallbackHandler = LibStub("CallbackHandler-1.0")
-
-local MAJOR, MINOR = "AceEvent-3.0", 4
-local AceEvent = LibStub:NewLibrary(MAJOR, MINOR)
-
-if not AceEvent then return end
-
--- Lua APIs
-local pairs = pairs
-
-AceEvent.frame = AceEvent.frame or CreateFrame("Frame", "AceEvent30Frame") -- our event frame
-AceEvent.embeds = AceEvent.embeds or {} -- what objects embed this lib
-
--- APIs and registry for blizzard events, using CallbackHandler lib
-if not AceEvent.events then
- AceEvent.events = CallbackHandler:New(AceEvent,
- "RegisterEvent", "UnregisterEvent", "UnregisterAllEvents")
-end
-
-function AceEvent.events:OnUsed(target, eventname)
- AceEvent.frame:RegisterEvent(eventname)
-end
-
-function AceEvent.events:OnUnused(target, eventname)
- AceEvent.frame:UnregisterEvent(eventname)
-end
-
-
--- APIs and registry for IPC messages, using CallbackHandler lib
-if not AceEvent.messages then
- AceEvent.messages = CallbackHandler:New(AceEvent,
- "RegisterMessage", "UnregisterMessage", "UnregisterAllMessages"
- )
- AceEvent.SendMessage = AceEvent.messages.Fire
-end
-
---- embedding and embed handling
-local mixins = {
- "RegisterEvent", "UnregisterEvent",
- "RegisterMessage", "UnregisterMessage",
- "SendMessage",
- "UnregisterAllEvents", "UnregisterAllMessages",
-}
-
---- Register for a Blizzard Event.
--- The callback will be called with the optional `arg` as the first argument (if supplied), and the event name as the second (or first, if no arg was supplied)
--- Any arguments to the event will be passed on after that.
--- @name AceEvent:RegisterEvent
--- @class function
--- @paramsig event[, callback [, arg]]
--- @param event The event to register for
--- @param callback The callback function to call when the event is triggered (funcref or method, defaults to a method with the event name)
--- @param arg An optional argument to pass to the callback function
-
---- Unregister an event.
--- @name AceEvent:UnregisterEvent
--- @class function
--- @paramsig event
--- @param event The event to unregister
-
---- Register for a custom AceEvent-internal message.
--- The callback will be called with the optional `arg` as the first argument (if supplied), and the event name as the second (or first, if no arg was supplied)
--- Any arguments to the event will be passed on after that.
--- @name AceEvent:RegisterMessage
--- @class function
--- @paramsig message[, callback [, arg]]
--- @param message The message to register for
--- @param callback The callback function to call when the message is triggered (funcref or method, defaults to a method with the event name)
--- @param arg An optional argument to pass to the callback function
-
---- Unregister a message
--- @name AceEvent:UnregisterMessage
--- @class function
--- @paramsig message
--- @param message The message to unregister
-
---- Send a message over the AceEvent-3.0 internal message system to other addons registered for this message.
--- @name AceEvent:SendMessage
--- @class function
--- @paramsig message, ...
--- @param message The message to send
--- @param ... Any arguments to the message
-
-
--- Embeds AceEvent into the target object making the functions from the mixins list available on target:..
--- @param target target object to embed AceEvent in
-function AceEvent:Embed(target)
- for k, v in pairs(mixins) do
- target[v] = self[v]
- end
- self.embeds[target] = true
- return target
-end
-
--- AceEvent:OnEmbedDisable( target )
--- target (object) - target object that is being disabled
---
--- Unregister all events messages etc when the target disables.
--- this method should be called by the target manually or by an addon framework
-function AceEvent:OnEmbedDisable(target)
- target:UnregisterAllEvents()
- target:UnregisterAllMessages()
-end
-
--- Script to fire blizzard events into the event listeners
-local events = AceEvent.events
-AceEvent.frame:SetScript("OnEvent", function(this, event, ...)
- events:Fire(event, ...)
-end)
-
---- Finally: upgrade our old embeds
-for target, v in pairs(AceEvent.embeds) do
- AceEvent:Embed(target)
-end
diff --git a/libs/AceEvent-3.0/AceEvent-3.0.xml b/libs/AceEvent-3.0/AceEvent-3.0.xml
deleted file mode 100644
index 41ef791..0000000
--- a/libs/AceEvent-3.0/AceEvent-3.0.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
diff --git a/libs/AceHook-3.0/AceHook-3.0.lua b/libs/AceHook-3.0/AceHook-3.0.lua
deleted file mode 100644
index af6a265..0000000
--- a/libs/AceHook-3.0/AceHook-3.0.lua
+++ /dev/null
@@ -1,511 +0,0 @@
---- **AceHook-3.0** offers safe Hooking/Unhooking of functions, methods and frame scripts.
--- Using AceHook-3.0 is recommended when you need to unhook your hooks again, so the hook chain isn't broken
--- when you manually restore the original function.
---
--- **AceHook-3.0** can be embeded into your addon, either explicitly by calling AceHook:Embed(MyAddon) or by
--- specifying it as an embeded library in your AceAddon. All functions will be available on your addon object
--- and can be accessed directly, without having to explicitly call AceHook itself.\\
--- It is recommended to embed AceHook, otherwise you'll have to specify a custom `self` on all calls you
--- make into AceHook.
--- @class file
--- @name AceHook-3.0
--- @release $Id: AceHook-3.0.lua 1243 2020-10-18 00:00:19Z nevcairiel $
-local ACEHOOK_MAJOR, ACEHOOK_MINOR = "AceHook-3.0", 9
-local AceHook, oldminor = LibStub:NewLibrary(ACEHOOK_MAJOR, ACEHOOK_MINOR)
-
-if not AceHook then return end -- No upgrade needed
-
-AceHook.embeded = AceHook.embeded or {}
-AceHook.registry = AceHook.registry or setmetatable({}, {__index = function(tbl, key) tbl[key] = {} return tbl[key] end })
-AceHook.handlers = AceHook.handlers or {}
-AceHook.actives = AceHook.actives or {}
-AceHook.scripts = AceHook.scripts or {}
-AceHook.onceSecure = AceHook.onceSecure or {}
-AceHook.hooks = AceHook.hooks or {}
-
--- local upvalues
-local registry = AceHook.registry
-local handlers = AceHook.handlers
-local actives = AceHook.actives
-local scripts = AceHook.scripts
-local onceSecure = AceHook.onceSecure
-
--- Lua APIs
-local pairs, next, type = pairs, next, type
-local format = string.format
-local assert, error = assert, error
-
--- WoW APIs
-local issecurevariable, hooksecurefunc = issecurevariable, hooksecurefunc
-local _G = _G
-
--- functions for later definition
-local donothing, createHook, hook
-
-local protectedScripts = {
- OnClick = true,
-}
-
--- upgrading of embeded is done at the bottom of the file
-
-local mixins = {
- "Hook", "SecureHook",
- "HookScript", "SecureHookScript",
- "Unhook", "UnhookAll",
- "IsHooked",
- "RawHook", "RawHookScript"
-}
-
--- AceHook:Embed( target )
--- target (object) - target object to embed AceHook in
---
--- Embeds AceEevent into the target object making the functions from the mixins list available on target:..
-function AceHook:Embed( target )
- for k, v in pairs( mixins ) do
- target[v] = self[v]
- end
- self.embeded[target] = true
- -- inject the hooks table safely
- target.hooks = target.hooks or {}
- return target
-end
-
--- AceHook:OnEmbedDisable( target )
--- target (object) - target object that is being disabled
---
--- Unhooks all hooks when the target disables.
--- this method should be called by the target manually or by an addon framework
-function AceHook:OnEmbedDisable( target )
- target:UnhookAll()
-end
-
-function createHook(self, handler, orig, secure, failsafe)
- local uid
- local method = type(handler) == "string"
- if failsafe and not secure then
- -- failsafe hook creation
- uid = function(...)
- if actives[uid] then
- if method then
- self[handler](self, ...)
- else
- handler(...)
- end
- end
- return orig(...)
- end
- -- /failsafe hook
- else
- -- all other hooks
- uid = function(...)
- if actives[uid] then
- if method then
- return self[handler](self, ...)
- else
- return handler(...)
- end
- elseif not secure then -- backup on non secure
- return orig(...)
- end
- end
- -- /hook
- end
- return uid
-end
-
-function donothing() end
-
-function hook(self, obj, method, handler, script, secure, raw, forceSecure, usage)
- if not handler then handler = method end
-
- -- These asserts make sure AceHooks's devs play by the rules.
- assert(not script or type(script) == "boolean")
- assert(not secure or type(secure) == "boolean")
- assert(not raw or type(raw) == "boolean")
- assert(not forceSecure or type(forceSecure) == "boolean")
- assert(usage)
-
- -- Error checking Battery!
- if obj and type(obj) ~= "table" then
- error(format("%s: 'object' - nil or table expected got %s", usage, type(obj)), 3)
- end
- if type(method) ~= "string" then
- error(format("%s: 'method' - string expected got %s", usage, type(method)), 3)
- end
- if type(handler) ~= "string" and type(handler) ~= "function" then
- error(format("%s: 'handler' - nil, string, or function expected got %s", usage, type(handler)), 3)
- end
- if type(handler) == "string" and type(self[handler]) ~= "function" then
- error(format("%s: 'handler' - Handler specified does not exist at self[handler]", usage), 3)
- end
- if script then
- if not obj or not obj.GetScript or not obj:HasScript(method) then
- error(format("%s: You can only hook a script on a frame object", usage), 3)
- end
- if not secure and obj.IsProtected and obj:IsProtected() and protectedScripts[method] then
- error(format("Cannot hook secure script %q; Use SecureHookScript(obj, method, [handler]) instead.", method), 3)
- end
- else
- local issecure
- if obj then
- issecure = onceSecure[obj] and onceSecure[obj][method] or issecurevariable(obj, method)
- else
- issecure = onceSecure[method] or issecurevariable(method)
- end
- if issecure then
- if forceSecure then
- if obj then
- onceSecure[obj] = onceSecure[obj] or {}
- onceSecure[obj][method] = true
- else
- onceSecure[method] = true
- end
- elseif not secure then
- error(format("%s: Attempt to hook secure function %s. Use `SecureHook' or add `true' to the argument list to override.", usage, method), 3)
- end
- end
- end
-
- local uid
- if obj then
- uid = registry[self][obj] and registry[self][obj][method]
- else
- uid = registry[self][method]
- end
-
- if uid then
- if actives[uid] then
- -- Only two sane choices exist here. We either a) error 100% of the time or b) always unhook and then hook
- -- choice b would likely lead to odd debuging conditions or other mysteries so we're going with a.
- error(format("Attempting to rehook already active hook %s.", method))
- end
-
- if handlers[uid] == handler then -- turn on a decative hook, note enclosures break this ability, small memory leak
- actives[uid] = true
- return
- elseif obj then -- is there any reason not to call unhook instead of doing the following several lines?
- if self.hooks and self.hooks[obj] then
- self.hooks[obj][method] = nil
- end
- registry[self][obj][method] = nil
- else
- if self.hooks then
- self.hooks[method] = nil
- end
- registry[self][method] = nil
- end
- handlers[uid], actives[uid], scripts[uid] = nil, nil, nil
- uid = nil
- end
-
- local orig
- if script then
- orig = obj:GetScript(method) or donothing
- elseif obj then
- orig = obj[method]
- else
- orig = _G[method]
- end
-
- if not orig then
- error(format("%s: Attempting to hook a non existing target", usage), 3)
- end
-
- uid = createHook(self, handler, orig, secure, not (raw or secure))
-
- if obj then
- self.hooks[obj] = self.hooks[obj] or {}
- registry[self][obj] = registry[self][obj] or {}
- registry[self][obj][method] = uid
-
- if not secure then
- self.hooks[obj][method] = orig
- end
-
- if script then
- if not secure then
- obj:SetScript(method, uid)
- else
- obj:HookScript(method, uid)
- end
- else
- if not secure then
- obj[method] = uid
- else
- hooksecurefunc(obj, method, uid)
- end
- end
- else
- registry[self][method] = uid
-
- if not secure then
- _G[method] = uid
- self.hooks[method] = orig
- else
- hooksecurefunc(method, uid)
- end
- end
-
- actives[uid], handlers[uid], scripts[uid] = true, handler, script and true or nil
-end
-
---- Hook a function or a method on an object.
--- The hook created will be a "safe hook", that means that your handler will be called
--- before the hooked function ("Pre-Hook"), and you don't have to call the original function yourself,
--- however you cannot stop the execution of the function, or modify any of the arguments/return values.\\
--- This type of hook is typically used if you need to know if some function got called, and don't want to modify it.
--- @paramsig [object], method, [handler], [hookSecure]
--- @param object The object to hook a method from
--- @param method If object was specified, the name of the method, or the name of the function to hook.
--- @param handler The handler for the hook, a funcref or a method name. (Defaults to the name of the hooked function)
--- @param hookSecure If true, AceHook will allow hooking of secure functions.
--- @usage
--- -- create an addon with AceHook embeded
--- MyAddon = LibStub("AceAddon-3.0"):NewAddon("HookDemo", "AceHook-3.0")
---
--- function MyAddon:OnEnable()
--- -- Hook ActionButton_UpdateHotkeys, overwriting the secure status
--- self:Hook("ActionButton_UpdateHotkeys", true)
--- end
---
--- function MyAddon:ActionButton_UpdateHotkeys(button, type)
--- print(button:GetName() .. " is updating its HotKey")
--- end
-function AceHook:Hook(object, method, handler, hookSecure)
- if type(object) == "string" then
- method, handler, hookSecure, object = object, method, handler, nil
- end
-
- if handler == true then
- handler, hookSecure = nil, true
- end
-
- hook(self, object, method, handler, false, false, false, hookSecure or false, "Usage: Hook([object], method, [handler], [hookSecure])")
-end
-
---- RawHook a function or a method on an object.
--- The hook created will be a "raw hook", that means that your handler will completly replace
--- the original function, and your handler has to call the original function (or not, depending on your intentions).\\
--- The original function will be stored in `self.hooks[object][method]` or `self.hooks[functionName]` respectively.\\
--- This type of hook can be used for all purposes, and is usually the most common case when you need to modify arguments
--- or want to control execution of the original function.
--- @paramsig [object], method, [handler], [hookSecure]
--- @param object The object to hook a method from
--- @param method If object was specified, the name of the method, or the name of the function to hook.
--- @param handler The handler for the hook, a funcref or a method name. (Defaults to the name of the hooked function)
--- @param hookSecure If true, AceHook will allow hooking of secure functions.
--- @usage
--- -- create an addon with AceHook embeded
--- MyAddon = LibStub("AceAddon-3.0"):NewAddon("HookDemo", "AceHook-3.0")
---
--- function MyAddon:OnEnable()
--- -- Hook ActionButton_UpdateHotkeys, overwriting the secure status
--- self:RawHook("ActionButton_UpdateHotkeys", true)
--- end
---
--- function MyAddon:ActionButton_UpdateHotkeys(button, type)
--- if button:GetName() == "MyButton" then
--- -- do stuff here
--- else
--- self.hooks.ActionButton_UpdateHotkeys(button, type)
--- end
--- end
-function AceHook:RawHook(object, method, handler, hookSecure)
- if type(object) == "string" then
- method, handler, hookSecure, object = object, method, handler, nil
- end
-
- if handler == true then
- handler, hookSecure = nil, true
- end
-
- hook(self, object, method, handler, false, false, true, hookSecure or false, "Usage: RawHook([object], method, [handler], [hookSecure])")
-end
-
---- SecureHook a function or a method on an object.
--- This function is a wrapper around the `hooksecurefunc` function in the WoW API. Using AceHook
--- extends the functionality of secure hooks, and adds the ability to unhook once the hook isn't
--- required anymore, or the addon is being disabled.\\
--- Secure Hooks should be used if the secure-status of the function is vital to its function,
--- and taint would block execution. Secure Hooks are always called after the original function was called
--- ("Post Hook"), and you cannot modify the arguments, return values or control the execution.
--- @paramsig [object], method, [handler]
--- @param object The object to hook a method from
--- @param method If object was specified, the name of the method, or the name of the function to hook.
--- @param handler The handler for the hook, a funcref or a method name. (Defaults to the name of the hooked function)
-function AceHook:SecureHook(object, method, handler)
- if type(object) == "string" then
- method, handler, object = object, method, nil
- end
-
- hook(self, object, method, handler, false, true, false, false, "Usage: SecureHook([object], method, [handler])")
-end
-
---- Hook a script handler on a frame.
--- The hook created will be a "safe hook", that means that your handler will be called
--- before the hooked script ("Pre-Hook"), and you don't have to call the original function yourself,
--- however you cannot stop the execution of the function, or modify any of the arguments/return values.\\
--- This is the frame script equivalent of the :Hook safe-hook. It would typically be used to be notified
--- when a certain event happens to a frame.
--- @paramsig frame, script, [handler]
--- @param frame The Frame to hook the script on
--- @param script The script to hook
--- @param handler The handler for the hook, a funcref or a method name. (Defaults to the name of the hooked script)
--- @usage
--- -- create an addon with AceHook embeded
--- MyAddon = LibStub("AceAddon-3.0"):NewAddon("HookDemo", "AceHook-3.0")
---
--- function MyAddon:OnEnable()
--- -- Hook the OnShow of FriendsFrame
--- self:HookScript(FriendsFrame, "OnShow", "FriendsFrameOnShow")
--- end
---
--- function MyAddon:FriendsFrameOnShow(frame)
--- print("The FriendsFrame was shown!")
--- end
-function AceHook:HookScript(frame, script, handler)
- hook(self, frame, script, handler, true, false, false, false, "Usage: HookScript(object, method, [handler])")
-end
-
---- RawHook a script handler on a frame.
--- The hook created will be a "raw hook", that means that your handler will completly replace
--- the original script, and your handler has to call the original script (or not, depending on your intentions).\\
--- The original script will be stored in `self.hooks[frame][script]`.\\
--- This type of hook can be used for all purposes, and is usually the most common case when you need to modify arguments
--- or want to control execution of the original script.
--- @paramsig frame, script, [handler]
--- @param frame The Frame to hook the script on
--- @param script The script to hook
--- @param handler The handler for the hook, a funcref or a method name. (Defaults to the name of the hooked script)
--- @usage
--- -- create an addon with AceHook embeded
--- MyAddon = LibStub("AceAddon-3.0"):NewAddon("HookDemo", "AceHook-3.0")
---
--- function MyAddon:OnEnable()
--- -- Hook the OnShow of FriendsFrame
--- self:RawHookScript(FriendsFrame, "OnShow", "FriendsFrameOnShow")
--- end
---
--- function MyAddon:FriendsFrameOnShow(frame)
--- -- Call the original function
--- self.hooks[frame].OnShow(frame)
--- -- Do our processing
--- -- .. stuff
--- end
-function AceHook:RawHookScript(frame, script, handler)
- hook(self, frame, script, handler, true, false, true, false, "Usage: RawHookScript(object, method, [handler])")
-end
-
---- SecureHook a script handler on a frame.
--- This function is a wrapper around the `frame:HookScript` function in the WoW API. Using AceHook
--- extends the functionality of secure hooks, and adds the ability to unhook once the hook isn't
--- required anymore, or the addon is being disabled.\\
--- Secure Hooks should be used if the secure-status of the function is vital to its function,
--- and taint would block execution. Secure Hooks are always called after the original function was called
--- ("Post Hook"), and you cannot modify the arguments, return values or control the execution.
--- @paramsig frame, script, [handler]
--- @param frame The Frame to hook the script on
--- @param script The script to hook
--- @param handler The handler for the hook, a funcref or a method name. (Defaults to the name of the hooked script)
-function AceHook:SecureHookScript(frame, script, handler)
- hook(self, frame, script, handler, true, true, false, false, "Usage: SecureHookScript(object, method, [handler])")
-end
-
---- Unhook from the specified function, method or script.
--- @paramsig [obj], method
--- @param obj The object or frame to unhook from
--- @param method The name of the method, function or script to unhook from.
-function AceHook:Unhook(obj, method)
- local usage = "Usage: Unhook([obj], method)"
- if type(obj) == "string" then
- method, obj = obj, nil
- end
-
- if obj and type(obj) ~= "table" then
- error(format("%s: 'obj' - expecting nil or table got %s", usage, type(obj)), 2)
- end
- if type(method) ~= "string" then
- error(format("%s: 'method' - expeting string got %s", usage, type(method)), 2)
- end
-
- local uid
- if obj then
- uid = registry[self][obj] and registry[self][obj][method]
- else
- uid = registry[self][method]
- end
-
- if not uid or not actives[uid] then
- -- Declining to error on an unneeded unhook since the end effect is the same and this would just be annoying.
- return false
- end
-
- actives[uid], handlers[uid] = nil, nil
-
- if obj then
- registry[self][obj][method] = nil
- registry[self][obj] = next(registry[self][obj]) and registry[self][obj] or nil
-
- -- if the hook reference doesnt exist, then its a secure hook, just bail out and dont do any unhooking
- if not self.hooks[obj] or not self.hooks[obj][method] then return true end
-
- if scripts[uid] and obj:GetScript(method) == uid then -- unhooks scripts
- obj:SetScript(method, self.hooks[obj][method] ~= donothing and self.hooks[obj][method] or nil)
- scripts[uid] = nil
- elseif obj and self.hooks[obj] and self.hooks[obj][method] and obj[method] == uid then -- unhooks methods
- obj[method] = self.hooks[obj][method]
- end
-
- self.hooks[obj][method] = nil
- self.hooks[obj] = next(self.hooks[obj]) and self.hooks[obj] or nil
- else
- registry[self][method] = nil
-
- -- if self.hooks[method] doesn't exist, then this is a SecureHook, just bail out
- if not self.hooks[method] then return true end
-
- if self.hooks[method] and _G[method] == uid then -- unhooks functions
- _G[method] = self.hooks[method]
- end
-
- self.hooks[method] = nil
- end
- return true
-end
-
---- Unhook all existing hooks for this addon.
-function AceHook:UnhookAll()
- for key, value in pairs(registry[self]) do
- if type(key) == "table" then
- for method in pairs(value) do
- AceHook.Unhook(self, key, method)
- end
- else
- AceHook.Unhook(self, key)
- end
- end
-end
-
---- Check if the specific function, method or script is already hooked.
--- @paramsig [obj], method
--- @param obj The object or frame to unhook from
--- @param method The name of the method, function or script to unhook from.
-function AceHook:IsHooked(obj, method)
- -- we don't check if registry[self] exists, this is done by evil magicks in the metatable
- if type(obj) == "string" then
- if registry[self][obj] and actives[registry[self][obj]] then
- return true, handlers[registry[self][obj]]
- end
- else
- if registry[self][obj] and registry[self][obj][method] and actives[registry[self][obj][method]] then
- return true, handlers[registry[self][obj][method]]
- end
- end
-
- return false, nil
-end
-
---- Upgrade our old embeded
-for target, v in pairs( AceHook.embeded ) do
- AceHook:Embed( target )
-end
diff --git a/libs/AceHook-3.0/AceHook-3.0.xml b/libs/AceHook-3.0/AceHook-3.0.xml
deleted file mode 100644
index fe51336..0000000
--- a/libs/AceHook-3.0/AceHook-3.0.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
diff --git a/libs/AceSerializer-3.0/AceSerializer-3.0.lua b/libs/AceSerializer-3.0/AceSerializer-3.0.lua
deleted file mode 100644
index 2a4c5ef..0000000
--- a/libs/AceSerializer-3.0/AceSerializer-3.0.lua
+++ /dev/null
@@ -1,287 +0,0 @@
---- **AceSerializer-3.0** can serialize any variable (except functions or userdata) into a string format,
--- that can be send over the addon comm channel. AceSerializer was designed to keep all data intact, especially
--- very large numbers or floating point numbers, and table structures. The only caveat currently is, that multiple
--- references to the same table will be send individually.
---
--- **AceSerializer-3.0** can be embeded into your addon, either explicitly by calling AceSerializer:Embed(MyAddon) or by
--- specifying it as an embeded library in your AceAddon. All functions will be available on your addon object
--- and can be accessed directly, without having to explicitly call AceSerializer itself.\\
--- It is recommended to embed AceSerializer, otherwise you'll have to specify a custom `self` on all calls you
--- make into AceSerializer.
--- @class file
--- @name AceSerializer-3.0
--- @release $Id: AceSerializer-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
-local MAJOR,MINOR = "AceSerializer-3.0", 5
-local AceSerializer, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
-
-if not AceSerializer then return end
-
--- Lua APIs
-local strbyte, strchar, gsub, gmatch, format = string.byte, string.char, string.gsub, string.gmatch, string.format
-local assert, error, pcall = assert, error, pcall
-local type, tostring, tonumber = type, tostring, tonumber
-local pairs, select, frexp = pairs, select, math.frexp
-local tconcat = table.concat
-
--- quick copies of string representations of wonky numbers
-local inf = math.huge
-
-local serNaN -- can't do this in 4.3, see ace3 ticket 268
-local serInf, serInfMac = "1.#INF", "inf"
-local serNegInf, serNegInfMac = "-1.#INF", "-inf"
-
-
--- Serialization functions
-
-local function SerializeStringHelper(ch) -- Used by SerializeValue for strings
- -- We use \126 ("~") as an escape character for all nonprints plus a few more
- local n = strbyte(ch)
- if n==30 then -- v3 / ticket 115: catch a nonprint that ends up being "~^" when encoded... DOH
- return "\126\122"
- elseif n<=32 then -- nonprint + space
- return "\126"..strchar(n+64)
- elseif n==94 then -- value separator
- return "\126\125"
- elseif n==126 then -- our own escape character
- return "\126\124"
- elseif n==127 then -- nonprint (DEL)
- return "\126\123"
- else
- assert(false) -- can't be reached if caller uses a sane regex
- end
-end
-
-local function SerializeValue(v, res, nres)
- -- We use "^" as a value separator, followed by one byte for type indicator
- local t=type(v)
-
- if t=="string" then -- ^S = string (escaped to remove nonprints, "^"s, etc)
- res[nres+1] = "^S"
- res[nres+2] = gsub(v,"[%c \94\126\127]", SerializeStringHelper)
- nres=nres+2
-
- elseif t=="number" then -- ^N = number (just tostring()ed) or ^F (float components)
- local str = tostring(v)
- if tonumber(str)==v --[[not in 4.3 or str==serNaN]] then
- -- translates just fine, transmit as-is
- res[nres+1] = "^N"
- res[nres+2] = str
- nres=nres+2
- elseif v == inf or v == -inf then
- res[nres+1] = "^N"
- res[nres+2] = v == inf and serInf or serNegInf
- nres=nres+2
- else
- local m,e = frexp(v)
- res[nres+1] = "^F"
- res[nres+2] = format("%.0f",m*2^53) -- force mantissa to become integer (it's originally 0.5--0.9999)
- res[nres+3] = "^f"
- res[nres+4] = tostring(e-53) -- adjust exponent to counteract mantissa manipulation
- nres=nres+4
- end
-
- elseif t=="table" then -- ^T...^t = table (list of key,value pairs)
- nres=nres+1
- res[nres] = "^T"
- for k,v in pairs(v) do
- nres = SerializeValue(k, res, nres)
- nres = SerializeValue(v, res, nres)
- end
- nres=nres+1
- res[nres] = "^t"
-
- elseif t=="boolean" then -- ^B = true, ^b = false
- nres=nres+1
- if v then
- res[nres] = "^B" -- true
- else
- res[nres] = "^b" -- false
- end
-
- elseif t=="nil" then -- ^Z = nil (zero, "N" was taken :P)
- nres=nres+1
- res[nres] = "^Z"
-
- else
- error(MAJOR..": Cannot serialize a value of type '"..t.."'") -- can't produce error on right level, this is wildly recursive
- end
-
- return nres
-end
-
-
-
-local serializeTbl = { "^1" } -- "^1" = Hi, I'm data serialized by AceSerializer protocol rev 1
-
---- Serialize the data passed into the function.
--- Takes a list of values (strings, numbers, booleans, nils, tables)
--- and returns it in serialized form (a string).\\
--- May throw errors on invalid data types.
--- @param ... List of values to serialize
--- @return The data in its serialized form (string)
-function AceSerializer:Serialize(...)
- local nres = 1
-
- for i=1,select("#", ...) do
- local v = select(i, ...)
- nres = SerializeValue(v, serializeTbl, nres)
- end
-
- serializeTbl[nres+1] = "^^" -- "^^" = End of serialized data
-
- return tconcat(serializeTbl, "", 1, nres+1)
-end
-
--- Deserialization functions
-local function DeserializeStringHelper(escape)
- if escape<"~\122" then
- return strchar(strbyte(escape,2,2)-64)
- elseif escape=="~\122" then -- v3 / ticket 115: special case encode since 30+64=94 ("^") - OOPS.
- return "\030"
- elseif escape=="~\123" then
- return "\127"
- elseif escape=="~\124" then
- return "\126"
- elseif escape=="~\125" then
- return "\94"
- end
- error("DeserializeStringHelper got called for '"..escape.."'?!?") -- can't be reached unless regex is screwed up
-end
-
-local function DeserializeNumberHelper(number)
- --[[ not in 4.3 if number == serNaN then
- return 0/0
- else]]if number == serNegInf or number == serNegInfMac then
- return -inf
- elseif number == serInf or number == serInfMac then
- return inf
- else
- return tonumber(number)
- end
-end
-
--- DeserializeValue: worker function for :Deserialize()
--- It works in two modes:
--- Main (top-level) mode: Deserialize a list of values and return them all
--- Recursive (table) mode: Deserialize only a single value (_may_ of course be another table with lots of subvalues in it)
---
--- The function _always_ works recursively due to having to build a list of values to return
---
--- Callers are expected to pcall(DeserializeValue) to trap errors
-
-local function DeserializeValue(iter,single,ctl,data)
-
- if not single then
- ctl,data = iter()
- end
-
- if not ctl then
- error("Supplied data misses AceSerializer terminator ('^^')")
- end
-
- if ctl=="^^" then
- -- ignore extraneous data
- return
- end
-
- local res
-
- if ctl=="^S" then
- res = gsub(data, "~.", DeserializeStringHelper)
- elseif ctl=="^N" then
- res = DeserializeNumberHelper(data)
- if not res then
- error("Invalid serialized number: '"..tostring(data).."'")
- end
- elseif ctl=="^F" then -- ^F^f
- local ctl2,e = iter()
- if ctl2~="^f" then
- error("Invalid serialized floating-point number, expected '^f', not '"..tostring(ctl2).."'")
- end
- local m=tonumber(data)
- e=tonumber(e)
- if not (m and e) then
- error("Invalid serialized floating-point number, expected mantissa and exponent, got '"..tostring(m).."' and '"..tostring(e).."'")
- end
- res = m*(2^e)
- elseif ctl=="^B" then -- yeah yeah ignore data portion
- res = true
- elseif ctl=="^b" then -- yeah yeah ignore data portion
- res = false
- elseif ctl=="^Z" then -- yeah yeah ignore data portion
- res = nil
- elseif ctl=="^T" then
- -- ignore ^T's data, future extensibility?
- res = {}
- local k,v
- while true do
- ctl,data = iter()
- if ctl=="^t" then break end -- ignore ^t's data
- k = DeserializeValue(iter,true,ctl,data)
- if k==nil then
- error("Invalid AceSerializer table format (no table end marker)")
- end
- ctl,data = iter()
- v = DeserializeValue(iter,true,ctl,data)
- if v==nil then
- error("Invalid AceSerializer table format (no table end marker)")
- end
- res[k]=v
- end
- else
- error("Invalid AceSerializer control code '"..ctl.."'")
- end
-
- if not single then
- return res,DeserializeValue(iter)
- else
- return res
- end
-end
-
---- Deserializes the data into its original values.
--- Accepts serialized data, ignoring all control characters and whitespace.
--- @param str The serialized data (from :Serialize)
--- @return true followed by a list of values, OR false followed by an error message
-function AceSerializer:Deserialize(str)
- str = gsub(str, "[%c ]", "") -- ignore all control characters; nice for embedding in email and stuff
-
- local iter = gmatch(str, "(^.)([^^]*)") -- Any ^x followed by string of non-^
- local ctl,data = iter()
- if not ctl or ctl~="^1" then
- -- we purposefully ignore the data portion of the start code, it can be used as an extension mechanism
- return false, "Supplied data is not AceSerializer data (rev 1)"
- end
-
- return pcall(DeserializeValue, iter)
-end
-
-
-----------------------------------------
--- Base library stuff
-----------------------------------------
-
-AceSerializer.internals = { -- for test scripts
- SerializeValue = SerializeValue,
- SerializeStringHelper = SerializeStringHelper,
-}
-
-local mixins = {
- "Serialize",
- "Deserialize",
-}
-
-AceSerializer.embeds = AceSerializer.embeds or {}
-
-function AceSerializer:Embed(target)
- for k, v in pairs(mixins) do
- target[v] = self[v]
- end
- self.embeds[target] = true
- return target
-end
-
--- Update embeds
-for target, v in pairs(AceSerializer.embeds) do
- AceSerializer:Embed(target)
-end
diff --git a/libs/AceSerializer-3.0/AceSerializer-3.0.xml b/libs/AceSerializer-3.0/AceSerializer-3.0.xml
deleted file mode 100644
index 677d08e..0000000
--- a/libs/AceSerializer-3.0/AceSerializer-3.0.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
diff --git a/libs/AceTimer-3.0/AceTimer-3.0.lua b/libs/AceTimer-3.0/AceTimer-3.0.lua
deleted file mode 100644
index 33b4da4..0000000
--- a/libs/AceTimer-3.0/AceTimer-3.0.lua
+++ /dev/null
@@ -1,278 +0,0 @@
---- **AceTimer-3.0** provides a central facility for registering timers.
--- AceTimer supports one-shot timers and repeating timers. All timers are stored in an efficient
--- data structure that allows easy dispatching and fast rescheduling. Timers can be registered
--- or canceled at any time, even from within a running timer, without conflict or large overhead.\\
--- AceTimer is currently limited to firing timers at a frequency of 0.01s as this is what the WoW timer API
--- restricts us to.
---
--- All `:Schedule` functions will return a handle to the current timer, which you will need to store if you
--- need to cancel the timer you just registered.
---
--- **AceTimer-3.0** can be embeded into your addon, either explicitly by calling AceTimer:Embed(MyAddon) or by
--- specifying it as an embeded library in your AceAddon. All functions will be available on your addon object
--- and can be accessed directly, without having to explicitly call AceTimer itself.\\
--- It is recommended to embed AceTimer, otherwise you'll have to specify a custom `self` on all calls you
--- make into AceTimer.
--- @class file
--- @name AceTimer-3.0
--- @release $Id: AceTimer-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
-
-local MAJOR, MINOR = "AceTimer-3.0", 17 -- Bump minor on changes
-local AceTimer, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
-
-if not AceTimer then return end -- No upgrade needed
-AceTimer.activeTimers = AceTimer.activeTimers or {} -- Active timer list
-local activeTimers = AceTimer.activeTimers -- Upvalue our private data
-
--- Lua APIs
-local type, unpack, next, error, select = type, unpack, next, error, select
--- WoW APIs
-local GetTime, C_TimerAfter = GetTime, C_Timer.After
-
-local function new(self, loop, func, delay, ...)
- if delay < 0.01 then
- delay = 0.01 -- Restrict to the lowest time that the C_Timer API allows us
- end
-
- local timer = {
- object = self,
- func = func,
- looping = loop,
- argsCount = select("#", ...),
- delay = delay,
- ends = GetTime() + delay,
- ...
- }
-
- activeTimers[timer] = timer
-
- -- Create new timer closure to wrap the "timer" object
- timer.callback = function()
- if not timer.cancelled then
- if type(timer.func) == "string" then
- -- We manually set the unpack count to prevent issues with an arg set that contains nil and ends with nil
- -- e.g. local t = {1, 2, nil, 3, nil} print(#t) will result in 2, instead of 5. This fixes said issue.
- timer.object[timer.func](timer.object, unpack(timer, 1, timer.argsCount))
- else
- timer.func(unpack(timer, 1, timer.argsCount))
- end
-
- if timer.looping and not timer.cancelled then
- -- Compensate delay to get a perfect average delay, even if individual times don't match up perfectly
- -- due to fps differences
- local time = GetTime()
- local delay = timer.delay - (time - timer.ends)
- -- Ensure the delay doesn't go below the threshold
- if delay < 0.01 then delay = 0.01 end
- C_TimerAfter(delay, timer.callback)
- timer.ends = time + delay
- else
- activeTimers[timer.handle or timer] = nil
- end
- end
- end
-
- C_TimerAfter(delay, timer.callback)
- return timer
-end
-
---- Schedule a new one-shot timer.
--- The timer will fire once in `delay` seconds, unless canceled before.
--- @param callback Callback function for the timer pulse (funcref or method name).
--- @param delay Delay for the timer, in seconds.
--- @param ... An optional, unlimited amount of arguments to pass to the callback function.
--- @usage
--- MyAddOn = LibStub("AceAddon-3.0"):NewAddon("MyAddOn", "AceTimer-3.0")
---
--- function MyAddOn:OnEnable()
--- self:ScheduleTimer("TimerFeedback", 5)
--- end
---
--- function MyAddOn:TimerFeedback()
--- print("5 seconds passed")
--- end
-function AceTimer:ScheduleTimer(func, delay, ...)
- if not func or not delay then
- error(MAJOR..": ScheduleTimer(callback, delay, args...): 'callback' and 'delay' must have set values.", 2)
- end
- if type(func) == "string" then
- if type(self) ~= "table" then
- error(MAJOR..": ScheduleTimer(callback, delay, args...): 'self' - must be a table.", 2)
- elseif not self[func] then
- error(MAJOR..": ScheduleTimer(callback, delay, args...): Tried to register '"..func.."' as the callback, but it doesn't exist in the module.", 2)
- end
- end
- return new(self, nil, func, delay, ...)
-end
-
---- Schedule a repeating timer.
--- The timer will fire every `delay` seconds, until canceled.
--- @param callback Callback function for the timer pulse (funcref or method name).
--- @param delay Delay for the timer, in seconds.
--- @param ... An optional, unlimited amount of arguments to pass to the callback function.
--- @usage
--- MyAddOn = LibStub("AceAddon-3.0"):NewAddon("MyAddOn", "AceTimer-3.0")
---
--- function MyAddOn:OnEnable()
--- self.timerCount = 0
--- self.testTimer = self:ScheduleRepeatingTimer("TimerFeedback", 5)
--- end
---
--- function MyAddOn:TimerFeedback()
--- self.timerCount = self.timerCount + 1
--- print(("%d seconds passed"):format(5 * self.timerCount))
--- -- run 30 seconds in total
--- if self.timerCount == 6 then
--- self:CancelTimer(self.testTimer)
--- end
--- end
-function AceTimer:ScheduleRepeatingTimer(func, delay, ...)
- if not func or not delay then
- error(MAJOR..": ScheduleRepeatingTimer(callback, delay, args...): 'callback' and 'delay' must have set values.", 2)
- end
- if type(func) == "string" then
- if type(self) ~= "table" then
- error(MAJOR..": ScheduleRepeatingTimer(callback, delay, args...): 'self' - must be a table.", 2)
- elseif not self[func] then
- error(MAJOR..": ScheduleRepeatingTimer(callback, delay, args...): Tried to register '"..func.."' as the callback, but it doesn't exist in the module.", 2)
- end
- end
- return new(self, true, func, delay, ...)
-end
-
---- Cancels a timer with the given id, registered by the same addon object as used for `:ScheduleTimer`
--- Both one-shot and repeating timers can be canceled with this function, as long as the `id` is valid
--- and the timer has not fired yet or was canceled before.
--- @param id The id of the timer, as returned by `:ScheduleTimer` or `:ScheduleRepeatingTimer`
-function AceTimer:CancelTimer(id)
- local timer = activeTimers[id]
-
- if not timer then
- return false
- else
- timer.cancelled = true
- activeTimers[id] = nil
- return true
- end
-end
-
---- Cancels all timers registered to the current addon object ('self')
-function AceTimer:CancelAllTimers()
- for k,v in next, activeTimers do
- if v.object == self then
- AceTimer.CancelTimer(self, k)
- end
- end
-end
-
---- Returns the time left for a timer with the given id, registered by the current addon object ('self').
--- This function will return 0 when the id is invalid.
--- @param id The id of the timer, as returned by `:ScheduleTimer` or `:ScheduleRepeatingTimer`
--- @return The time left on the timer.
-function AceTimer:TimeLeft(id)
- local timer = activeTimers[id]
- if not timer then
- return 0
- else
- return timer.ends - GetTime()
- end
-end
-
-
--- ---------------------------------------------------------------------
--- Upgrading
-
--- Upgrade from old hash-bucket based timers to C_Timer.After timers.
-if oldminor and oldminor < 10 then
- -- disable old timer logic
- AceTimer.frame:SetScript("OnUpdate", nil)
- AceTimer.frame:SetScript("OnEvent", nil)
- AceTimer.frame:UnregisterAllEvents()
- -- convert timers
- for object,timers in next, AceTimer.selfs do
- for handle,timer in next, timers do
- if type(timer) == "table" and timer.callback then
- local newTimer
- if timer.delay then
- newTimer = AceTimer.ScheduleRepeatingTimer(timer.object, timer.callback, timer.delay, timer.arg)
- else
- newTimer = AceTimer.ScheduleTimer(timer.object, timer.callback, timer.when - GetTime(), timer.arg)
- end
- -- Use the old handle for old timers
- activeTimers[newTimer] = nil
- activeTimers[handle] = newTimer
- newTimer.handle = handle
- end
- end
- end
- AceTimer.selfs = nil
- AceTimer.hash = nil
- AceTimer.debug = nil
-elseif oldminor and oldminor < 17 then
- -- Upgrade from old animation based timers to C_Timer.After timers.
- AceTimer.inactiveTimers = nil
- AceTimer.frame = nil
- local oldTimers = AceTimer.activeTimers
- -- Clear old timer table and update upvalue
- AceTimer.activeTimers = {}
- activeTimers = AceTimer.activeTimers
- for handle, timer in next, oldTimers do
- local newTimer
- -- Stop the old timer animation
- local duration, elapsed = timer:GetDuration(), timer:GetElapsed()
- timer:GetParent():Stop()
- if timer.looping then
- newTimer = AceTimer.ScheduleRepeatingTimer(timer.object, timer.func, duration, unpack(timer.args, 1, timer.argsCount))
- else
- newTimer = AceTimer.ScheduleTimer(timer.object, timer.func, duration - elapsed, unpack(timer.args, 1, timer.argsCount))
- end
- -- Use the old handle for old timers
- activeTimers[newTimer] = nil
- activeTimers[handle] = newTimer
- newTimer.handle = handle
- end
-
- -- Migrate transitional handles
- if oldminor < 13 and AceTimer.hashCompatTable then
- for handle, id in next, AceTimer.hashCompatTable do
- local t = activeTimers[id]
- if t then
- activeTimers[id] = nil
- activeTimers[handle] = t
- t.handle = handle
- end
- end
- AceTimer.hashCompatTable = nil
- end
-end
-
--- ---------------------------------------------------------------------
--- Embed handling
-
-AceTimer.embeds = AceTimer.embeds or {}
-
-local mixins = {
- "ScheduleTimer", "ScheduleRepeatingTimer",
- "CancelTimer", "CancelAllTimers",
- "TimeLeft"
-}
-
-function AceTimer:Embed(target)
- AceTimer.embeds[target] = true
- for _,v in next, mixins do
- target[v] = AceTimer[v]
- end
- return target
-end
-
--- AceTimer:OnEmbedDisable(target)
--- target (object) - target object that AceTimer is embedded in.
---
--- cancel all timers registered for the object
-function AceTimer:OnEmbedDisable(target)
- target:CancelAllTimers()
-end
-
-for addon in next, AceTimer.embeds do
- AceTimer:Embed(addon)
-end
diff --git a/libs/AceTimer-3.0/AceTimer-3.0.xml b/libs/AceTimer-3.0/AceTimer-3.0.xml
deleted file mode 100644
index d5aee81..0000000
--- a/libs/AceTimer-3.0/AceTimer-3.0.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-