It's a mix between both actually, because I'm dealing with calendar events (realm time) and cooldowns, raid timers, etc.. (local time), so it definitely needs testing :)
I wish I could try this on US realms, it would help debugging :)
r29 worked fine. I was not on 2 hours early to see what happened then, but I did get the warnings starting 15mins before my raid.
Not sure if that has anything to do with Altoholic, but my system clock was a few minutes faster than the in-game clock (when looking at minutes, obviously). I re-synced my system clock but the realm was still behind. Perhaps WoW servers are not quite on time, I don't know. Either way, it made Altoholic's warning come up 13 mins before raid instead of 15 according to my system clock, and 16 mins before raid instead of 15, according to the in-game clock. If I remember correctly anyway.
Confusing, I know, and not a huge deal, just be aware of the differences in minutes when you try to find the difference between realm time and local time in your code. Might be worth you adding an option to Altoholic where people set their time zone offset from realm time. Now if people don't configure the addon right or don't keep their system time reasonably accurate... well lol.
Another thing you can try is to move the Altoholic:UnregisterEvent("TRADE_SKILL_SHOW") line into the function Altoholic:PLAYER_LOGOUT(), around line 2250, it may be called a bit sooner than disable()
I tried to move it to the logout event and it worked perfectly! I tested it both when logging out and when exiting and it solves the bug nicely.
Maybe you can put this in the next release. Thanks! :)
@Shadoweric: yes, it seems that all servers do not have the exact same hour. I don't know if their data centers use a timesync server (they should :p), but I still suspect that there might be a bug across realms. I mean, if a player has characters on realms that are in different time zones. That's a situation I could not reproduce, so I'll live with the current implementation for now.
I'm having a problem with the new calendar function. When I try to view it I get the following error:
[2009/06/17 20:45:00-1373-x888]: Altoholic-v3.1.003b\Frames\Calendar.lua:566: attempt to concatenate field '?' (a nil value)
Altoholic-v3.1.003b\Frames\Calendar.lua:165: in function `func'
Altoholic-v3.1.003b\Tasks.lua:17: in function `OnUpdate'
Altoholic-v3.1.003b\Altoholic.lua:273: in function <Interface\AddOns\Altoholic\Altoholic.lua:273>
I admit I haven't cleaned my saved variables but I'd rather not do that if possible (I hate to lose all character data).
[2009/06/18 19:33:53-3804-x1]: Altoholic-v3.1.003c\Altoholic.lua:2261: attempt to call method 'IsFuBarMinimapAttached' (a nil value)
CallbackHandler-1.0-3 (Ace3):146: in function <...Ons\Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:146>
<string>:"safecall Dispatcher[3]":4: in function <[string "safecall Dispatcher[3]"]:4>
<in C code>: ?
<string>:"safecall Dispatcher[3]":13: in function `?'
CallbackHandler-1.0-3 (Ace3):91: in function `Fire'
AceEvent-3.0-3 (Ace3):119: in function <Interface\AddOns\Ace3\AceEvent-3.0\AceEvent-3.0.lua:118>
---
Altoholic-v3.1.003c\Frames\TabAchievements.lua:39: bad argument #1 to 'pairs' (table expected, got nil)
Altoholic-v3.1.003c\Frames\TabAchievements.lua:39: in function `updateFunction'
Interface\FrameXML\UIPanelTemplates.lua:241: in function `FauxScrollFrame_OnVerticalScroll':
<string>:"*:OnVerticalScroll":1: in function <[string "*:OnVerticalScroll"]:1>
<in C code>: in function `SetVerticalScroll'
<string>:"*:OnValueChanged":1: in function <[string "*:OnValueChanged"]:1>
<in C code>: in function `SetValue'
Interface\FrameXML\UIPanelTemplates.lua:163: in function `ScrollFrameTemplate_OnMouseWheel':
<string>:"*:OnMouseWheel":1: in function <[string "*:OnMouseWheel"]:1>
I typed something in the Guild Skills window where it says Search Containers and I get this:
Altoholic-v3.1.004\Frames\Search.lua:678: attempt to index local 'v' (a number value)
Altoholic-v3.1.004\Tasks.lua:17: in function `OnUpdate'
Altoholic-v3.1.004\Altoholic.lua:272: in function <Interface\AddOns\Altoholic\Altoholic.lua:272>
Hmm.. a number value at that point is quite weird. Would you mind sending me your altoholic.lua ? It would really help me fixing the cause rather than fixing just the problem.
Did you try with the latest version on svn ? r29 iirc.
Yes, I just tested it again with r31 and still get the same error when clicking on the "Calendar" menu item in Altoholic. It also seems to happen at certain time intervals even if I don't open Altoholic. Here's the error again:
[2009/06/23 11:49:42-1408-x1]: Altoholic-v3.1.004\Frames\Calendar.lua:615: attempt to concatenate field '?' (a nil value)
Altoholic-v3.1.004\Frames\Calendar.lua:549: in function `Update'
Altoholic-v3.1.004\Frames\Calendar.lua:313: in function `Update'
Altoholic-v3.1.004\Frames\TabSummary.lua:96: in function `MenuItem_OnClick'
<string>:"*:OnClick":1: in function <[string "*:OnClick"]:1>
I'm afraid that the error I reported about earlier is still present in the latest version of Altoholic. It seems that it does not always happen, so I guess it is a matter of how much time it takes for certain events to happen during logout/exiting of the game.
I have a small conflict with Altoholic and the profiler addon for Azeroth Advisor. When I logout/exit the game the profiler addon scans the current skills. This triggers Altoholics own tradeskill scan as well (not sure why though).
However, during logout time GetTradeSkillInfo() returns nil which causes an error in your scan routine.
How about changing my previously suggested fix to not set the bScanFailed flag and simply break the loop? I have patched my Skills.lua file at line 505 to include the following:
if not skillName then
break
end
Without analyzing your code that much, I believe this wouldn't cause any harm? At least it solves the bug for me...
I guess the real culprit here is the Azeroth Advisor addon that scans everything on logout/exit. It scans tradeskills by doing CastSpellByName() on all 13 tradeskills! So that is why your hook is triggered...
I don't know why he does that, but scanning data at logout is never a good idea. Most of the time, it would invalidate the content of your DB. Weird imo :)
I wish I could try this on US realms, it would help debugging :)
Not sure if that has anything to do with Altoholic, but my system clock was a few minutes faster than the in-game clock (when looking at minutes, obviously). I re-synced my system clock but the realm was still behind. Perhaps WoW servers are not quite on time, I don't know. Either way, it made Altoholic's warning come up 13 mins before raid instead of 15 according to my system clock, and 16 mins before raid instead of 15, according to the in-game clock. If I remember correctly anyway.
Confusing, I know, and not a huge deal, just be aware of the differences in minutes when you try to find the difference between realm time and local time in your code. Might be worth you adding an option to Altoholic where people set their time zone offset from realm time. Now if people don't configure the addon right or don't keep their system time reasonably accurate... well lol.
I tried to move it to the logout event and it worked perfectly! I tested it both when logging out and when exiting and it solves the bug nicely.
Maybe you can put this in the next release. Thanks! :)
@Shadoweric: yes, it seems that all servers do not have the exact same hour. I don't know if their data centers use a timesync server (they should :p), but I still suspect that there might be a bug across realms. I mean, if a player has characters on realms that are in different time zones. That's a situation I could not reproduce, so I'll live with the current implementation for now.
[2009/06/17 20:45:00-1373-x888]: Altoholic-v3.1.003b\Frames\Calendar.lua:566: attempt to concatenate field '?' (a nil value)
Altoholic-v3.1.003b\Frames\Calendar.lua:165: in function `func'
Altoholic-v3.1.003b\Tasks.lua:17: in function `OnUpdate'
Altoholic-v3.1.003b\Altoholic.lua:273: in function <Interface\AddOns\Altoholic\Altoholic.lua:273>
I admit I haven't cleaned my saved variables but I'd rather not do that if possible (I hate to lose all character data).
@Shadoweric: already fixed in my version, I should update svn later today.
I typed something in the Guild Skills window where it says Search Containers and I get this:
Keeps happening (using r31).
Keep up the good work.
Yes, I just tested it again with r31 and still get the same error when clicking on the "Calendar" menu item in Altoholic. It also seems to happen at certain time intervals even if I don't open Altoholic. Here's the error again:
@Nightowl: you can use the curse localization tool now:
http://wow.curseforge.com/projects/altoholic/localization/
Apparently, someone already helped completing zhTW :)
Description of the problem:
How about changing my previously suggested fix to not set the bScanFailed flag and simply break the loop? I have patched my Skills.lua file at line 505 to include the following:
Without analyzing your code that much, I believe this wouldn't cause any harm? At least it solves the bug for me...
I guess the real culprit here is the Azeroth Advisor addon that scans everything on logout/exit. It scans tradeskills by doing CastSpellByName() on all 13 tradeskills! So that is why your hook is triggered...
Yeah, and many of my translations done becomes another translator's work.