0
---------------------------------------------------------------------------]]
0
local major = "Dongle-1.0"
0
-local minor = tonumber(string.match("$Revision: 6
12 $", "(%d+)") or 1) + 500
0
+local minor = tonumber(string.match("$Revision: 6
46 $", "(%d+)") or 1) + 500
0
-- ** IMPORTANT NOTE **
0
-- Due to some issues we had previously with Dongle revision numbers
0
-- we need to artificially inflate the minor revision number, to ensure
0
@@ -884,17 +884,30 @@ function Dongle.SetProfile(db, name)
0
Dongle:TriggerMessage("DONGLE_PROFILE_CHANGED", db, db.parent, db.sv_name, db.keys.profile)
0
-function Dongle.GetProfiles(db, t
)
0
+function Dongle.GetProfiles(db, t
bl)
0
assert(3, databases[db], string.format(L["MUST_CALLFROM_DBOBJECT"], "GetProfiles"))
0
argcheck(t, 2, "table", "nil")
0
- for profileKey in pairs(db.sv.profiles) do
0
+ -- Clear the container table
0
+ for k,v in pairs(tbl) do tbl[k] = nil end
0
+ for profileKey in pairs(db.profiles) do
0
+ -- Add the current profile, if it hasn't been created yet
0
+ if rawget(db, "profile") == nil then
0
+ tbl[i] = db.keys.profile
0
function Dongle.GetCurrentProfile(db)
0
function Dongle.RegisterNamespace(db, name, defaults)
0
assert(3, databases[db], string.format(L["MUST_CALLFROM_DBOBJECT"], "RegisterNamespace"))
0
- argcheck(name, 2, "string")
0
- argcheck(defaults, 3, "nil", "string")
0
+ argcheck(name, 2, "string")
0
+ argcheck(defaults, 3, "nil", "table")
0
if not sv.namespaces then sv.namespaces = {} end
0
@@ -1147,44 +1160,41 @@ local function PLAYER_LOGOUT(event)
0
-local function PLAYER_LOGIN()
0
- Dongle.initialized = true
0
- for i=1, #loadorder do
0
- local obj = loadorder[i]
0
- if type(obj.Enable) == "function" then
0
- safecall(obj.Enable, obj)
0
+ local lockPlayerLogin = false
0
+ function PLAYER_LOGIN()
0
+ if lockPlayerLogin then return end
0
+ lockPlayerLogin = true
0
+ local obj = table.remove(loadorder, 1)
0
+ if type(obj.Enable) == "function" then
0
+ safecall(obj.Enable, obj)
0
+ obj = table.remove(loadorder, 1)
0
+ lockPlayerLogin = false
0
local function ADDON_LOADED(event, ...)
0
- for i=1, #loadqueue do
0
- local obj = loadqueue[i]
0
+ local obj = table.remove(loadqueue, 1)
0
table.insert(loadorder, obj)
0
if type(obj.Initialize) == "function" then
0
safecall(obj.Initialize, obj)
0
- if not Dongle.initialized then
0
- if type(IsLoggedIn) == "function" then
0
- Dongle.initialized = IsLoggedIn()
0
- Dongle.initialized = ChatFrame1.defaultLanguage
0
+ obj = table.remove(loadqueue, 1)
0
- if Dongle.initialized then
0
- for i=1, #loadorder do
0
- local obj = loadorder[i]
0
- if type(obj.Enable) == "function" then
0
- safecall(obj.Enable, obj)
Comments
No one has commented yet.