Mercurial > wow > ouroloot
comparison core.lua @ 41:d6b8858c1b64
Fix 'alsolog' toggling during raids when log table already restored. Correct log message when triggering start of an cache animation group. Disable ML/DKP module for now.
| author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
|---|---|
| date | Thu, 12 Jan 2012 02:24:15 +0000 |
| parents | dc3a66688e50 |
| children | 4f1e71f62776 |
comparison
equal
deleted
inserted
replaced
| 40:dc3a66688e50 | 41:d6b8858c1b64 |
|---|---|
| 173 | 173 |
| 174 local pairs, ipairs, tinsert, tremove, tonumber = pairs, ipairs, table.insert, table.remove, tonumber | 174 local pairs, ipairs, tinsert, tremove, tonumber = pairs, ipairs, table.insert, table.remove, tonumber |
| 175 local pprint, tabledump = addon.pprint, flib.tabledump | 175 local pprint, tabledump = addon.pprint, flib.tabledump |
| 176 local GetNumRaidMembers = GetNumRaidMembers | 176 local GetNumRaidMembers = GetNumRaidMembers |
| 177 -- En masse forward decls of symbols defined inside local blocks | 177 -- En masse forward decls of symbols defined inside local blocks |
| 178 local _register_bossmod | 178 local _register_bossmod, makedate, create_new_cache, _init, _log |
| 179 local makedate, create_new_cache, _init | |
| 180 | 179 |
| 181 -- Try to extract numbers from the .toc "Version" and munge them into an | 180 -- Try to extract numbers from the .toc "Version" and munge them into an |
| 182 -- integral form for comparison. The result doesn't need to be meaningful as | 181 -- integral form for comparison. The result doesn't need to be meaningful as |
| 183 -- long as we can reliably feed two of them to "<" and get useful answers. | 182 -- long as we can reliably feed two of them to "<" and get useful answers. |
| 184 -- | 183 -- |
| 325 local function _add (cache, x) | 324 local function _add (cache, x) |
| 326 local datum = { t=time(), m=x } | 325 local datum = { t=time(), m=x } |
| 327 cache.hash[x] = datum | 326 cache.hash[x] = datum |
| 328 tinsert (cache.fifo, datum) | 327 tinsert (cache.fifo, datum) |
| 329 if not cleanup_group:IsPlaying() then | 328 if not cleanup_group:IsPlaying() then |
| 330 addon.dprint('cache', cache.name, "with entry", datum.t, "<", datum.x, "> STARTING animation group") | 329 addon.dprint('cache', cache.name, "with entry", datum.t, "<", datum.m, "> STARTING animation group") |
| 331 cache.cleanup:SetDuration(1) -- hmmm | 330 cache.cleanup:SetDuration(1) -- hmmm |
| 332 cleanup_group:Play() | 331 cleanup_group:Play() |
| 333 end | 332 end |
| 334 end | 333 end |
| 335 local function _test (cache, x) | 334 local function _test (cache, x) |
| 359 end | 358 end |
| 360 | 359 |
| 361 | 360 |
| 362 ------ Ace3 framework stuff | 361 ------ Ace3 framework stuff |
| 363 function addon:OnInitialize() | 362 function addon:OnInitialize() |
| 363 _log = OuroLootSV_log | |
| 364 | |
| 364 -- VARIABLES_LOADED has fired by this point; test if we're doing something like | 365 -- VARIABLES_LOADED has fired by this point; test if we're doing something like |
| 365 -- relogging during a raid and already have collected loot data | 366 -- relogging during a raid and already have collected loot data |
| 366 g_restore_p = OuroLootSV ~= nil | 367 g_restore_p = OuroLootSV ~= nil |
| 367 self.dprint('flow', "oninit sets restore as", g_restore_p) | 368 self.dprint('flow', "oninit sets restore as", g_restore_p) |
| 368 | 369 |
| 658 return | 659 return |
| 659 end | 660 end |
| 660 | 661 |
| 661 local inside,whatkind = IsInInstance() | 662 local inside,whatkind = IsInInstance() |
| 662 if inside and (whatkind == "pvp" or whatkind == "arena") then | 663 if inside and (whatkind == "pvp" or whatkind == "arena") then |
| 663 return self.dprint('flow', "got RRU event but in pvp zone, bailing") | 664 self.dprint('flow', "got RRU event but in pvp zone, bailing") |
| 665 return | |
| 664 end | 666 end |
| 665 | 667 |
| 666 local docheck = self.enabled | 668 local docheck = self.enabled |
| 667 if event == "Activate" then | 669 if event == "Activate" then |
| 668 -- dispatched manually from Activate | 670 -- dispatched manually from Activate |
| 1030 | 1032 |
| 1031 | 1033 |
| 1032 ------ Behind the scenes routines | 1034 ------ Behind the scenes routines |
| 1033 -- Semi-experimental debugging aid. | 1035 -- Semi-experimental debugging aid. |
| 1034 do | 1036 do |
| 1037 -- Putting _log local to here can result in this sequence: | |
| 1038 -- 1) logging happens, followed by reload or logout/login | |
| 1039 -- 2) _log points to SV_log | |
| 1040 -- 3) VARIABLES_LOADED replaces SV_log pointer with restored version | |
| 1041 -- 4) logging happens to _log table (now with no other references) | |
| 1042 -- 5) at logout, nothing new has been entered in the table being saved | |
| 1035 local date = _G.date | 1043 local date = _G.date |
| 1036 local log = OuroLootSV_log | |
| 1037 function addon:log_with_timestamp (msg) | 1044 function addon:log_with_timestamp (msg) |
| 1038 tinsert (log, date('%m:%d %H:%M:%S ')..msg) | 1045 tinsert (_log, date('%m:%d %H:%M:%S ')..msg) |
| 1039 end | 1046 end |
| 1040 end | 1047 end |
| 1041 | 1048 |
| 1042 -- Adds indices to traverse the tables in a nice sorted order. | 1049 -- Adds indices to traverse the tables in a nice sorted order. |
| 1043 do | 1050 do |
| 1432 function addon:format_timestamp (fmt_opt, day_entry, time_entry_opt) | 1439 function addon:format_timestamp (fmt_opt, day_entry, time_entry_opt) |
| 1433 if not time_entry_opt then | 1440 if not time_entry_opt then |
| 1434 if type(fmt_opt) == 'table' then -- Two entries, default format | 1441 if type(fmt_opt) == 'table' then -- Two entries, default format |
| 1435 time_entry_opt, day_entry = day_entry, fmt_opt | 1442 time_entry_opt, day_entry = day_entry, fmt_opt |
| 1436 fmt_opt = "$Y/$M/$D $h:$m" | 1443 fmt_opt = "$Y/$M/$D $h:$m" |
| 1437 --elseif type(fmt_opt) == "string" then -- Day entry only, specified format | 1444 --elseif type(fmt_opt) == "string" then -- Day entry only, caller-specified format |
| 1438 end | 1445 end |
| 1439 end | 1446 end |
| 1440 --format_timestamp_values.Y = point2dee:format (day_entry.startday.year % 100) | 1447 --format_timestamp_values.Y = point2dee:format (day_entry.startday.year % 100) |
| 1441 format_timestamp_values.Y = ("%.4d"):format (day_entry.startday.year) | 1448 format_timestamp_values.Y = ("%.4d"):format (day_entry.startday.year) |
| 1442 format_timestamp_values.M = point2dee:format (day_entry.startday.month) | 1449 format_timestamp_values.M = point2dee:format (day_entry.startday.month) |
