public
Description: WoW Powerleveling addon
Homepage: http://www.tekkub.net/
Clone URL: git://github.com/tekkub/tourguide.git
Click here to lend your support to: tourguide and make a donation at www.pledgie.com !
Dongle update (should fix weird errors some people have seen on load)
tekkub (author)
Sun Aug 17 15:19:14 -0700 2008
commit  96f85abbde48a1b255c5e1144a0b8f0056cb702e
tree    49d75e209dd69e6c3c5f494c88f0f11479e0cf84
parent  a00681a34cd50662ec4cfc76d919d1d240a5a817
...
155
156
157
158
 
159
160
161
...
884
885
886
887
 
888
889
890
891
892
893
894
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
895
 
896
897
 
 
898
899
900
...
966
967
968
969
970
 
 
971
972
973
...
1147
1148
1149
1150
1151
1152
1153
1154
1155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1156
1157
 
 
1158
1159
1160
1161
1162
1163
 
 
1164
1165
 
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
 
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
 
 
1188
1189
1190
...
155
156
157
 
158
159
160
161
...
884
885
886
 
887
888
889
890
 
 
 
 
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
 
909
910
911
912
913
...
979
980
981
 
 
982
983
984
985
986
...
1160
1161
1162
 
 
 
 
 
 
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
 
1179
1180
1181
1182
1183
1184
 
 
1185
1186
1187
 
1188
1189
1190
1191
 
 
1192
 
 
 
 
 
 
1193
1194
1195
 
 
 
 
 
 
 
 
1196
1197
1198
1199
1200
0
@@ -155,7 +155,7 @@ end
0
 ---------------------------------------------------------------------------]]
0
 
0
 local major = "Dongle-1.0"
0
-local minor = tonumber(string.match("$Revision: 612 $", "(%d+)") or 1) + 500
0
+local minor = tonumber(string.match("$Revision: 646 $", "(%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
 end
0
 
0
-function Dongle.GetProfiles(db, t)
0
+function Dongle.GetProfiles(db, tbl)
0
   assert(3, databases[db], string.format(L["MUST_CALLFROM_DBOBJECT"], "GetProfiles"))
0
   argcheck(t, 2, "table", "nil")
0
 
0
- t = t or {}
0
- local i = 1
0
- for profileKey in pairs(db.sv.profiles) do
0
- t[i] = profileKey
0
+ -- Clear the container table
0
+ if tbl then
0
+ for k,v in pairs(tbl) do tbl[k] = nil end
0
+ else
0
+ tbl = {}
0
+ end
0
+
0
+ local i = 0
0
+ for profileKey in pairs(db.profiles) do
0
+ i = i + 1
0
+ tbl[i] = profileKey
0
+ end
0
+
0
+ -- Add the current profile, if it hasn't been created yet
0
+ if rawget(db, "profile") == nil then
0
     i = i + 1
0
+ tbl[i] = db.keys.profile
0
   end
0
- return t, i - 1
0
+
0
+ return tbl, i
0
 end
0
 
0
 function Dongle.GetCurrentProfile(db)
0
@@ -966,8 +979,8 @@ end
0
 
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
 
0
   local sv = db.sv
0
   if not sv.namespaces then sv.namespaces = {} end
0
@@ -1147,44 +1160,41 @@ local function PLAYER_LOGOUT(event)
0
   end
0
 end
0
 
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 PLAYER_LOGIN
0
+do
0
+ local lockPlayerLogin = false
0
+
0
+ function PLAYER_LOGIN()
0
+ if lockPlayerLogin then return end
0
+
0
+ lockPlayerLogin = true
0
+
0
+ local obj = table.remove(loadorder, 1)
0
+ while obj do
0
+ if type(obj.Enable) == "function" then
0
+ safecall(obj.Enable, obj)
0
+ end
0
+ obj = table.remove(loadorder, 1)
0
     end
0
- loadorder[i] = nil
0
+
0
+ lockPlayerLogin = false
0
   end
0
 end
0
 
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
+ while obj do
0
     table.insert(loadorder, obj)
0
-
0
+
0
     if type(obj.Initialize) == "function" then
0
       safecall(obj.Initialize, obj)
0
     end
0
- loadqueue[i] = nil
0
- end
0
 
0
- if not Dongle.initialized then
0
- if type(IsLoggedIn) == "function" then
0
- Dongle.initialized = IsLoggedIn()
0
- else
0
- Dongle.initialized = ChatFrame1.defaultLanguage
0
- end
0
+ obj = table.remove(loadqueue, 1)
0
   end
0
 
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)
0
- end
0
- loadorder[i] = nil
0
- end
0
+ if IsLoggedIn() then
0
+ PLAYER_LOGIN()
0
   end
0
 end
0
 

Comments

    No one has commented yet.