Help - Search - Members - Calendar
Full Version: Total xp storage and delayed OnLogon
AC Tools Everything Macro > Other Scripting Tools > Skunkworks
spud
the other is probably me somehow, even tho I really don't think I changed anything, which is ultimately why I'm here.

First, and hopefully easiest to answer,

CODE
Private Sub skev_OnStatTotalXp(ByVal xp As Double)
        'actions.XpCalc(xp)     'skunkworks double storage bug, getting 4294967295 math errors
        actions.XpCalc(skapi.expTotal)
    End Sub


probably sums it up best. Can this be verified or can I clarify this further?


The second conundrum is just really wierd. Of course it happens after I have a client crash. On patch day. To summarize: the OnLogon event does not seem to fire for just one character, it gets delayed until I log in any other character on the account, then I have two instances of character vars etc. I have also tried using the Sub subname (subparms) Handles skev.OnLogon instead of using AddHandler. I was happily running on a non-development machine (.exe only) and everything was hunky dory just like usual. Blam, Don't Send, restart things, no program on that character.

Can you think of any way I can narrow down this problem? Or maybe we can theorize why it might be happening? If I had to guess I would say I didn't set a flag or something in the Turbine DB's, but the event ultimately does fire, just when any other character logs in, so I don't feel comfortable about any theories really.

Thanks once again for any insight you can provide.
GKusnick
OnStatTotalExp seems to be working for me in VBScript, but then I don't have any characters with more than 4 billion XP. I'm not sure exactly what you mean by "getting 4294967295 math errors". If you're getting an error message, please post the full text of the message. If you're getting unexpected results with no error message, post the expected result along with the actual result. I notice you've named your handler skev_OnStatTotalXp instead of skev_OnStatTotalExp, so I'm wondering it that has something to do with it. You also seem to be coding in VB.Net, so conceivably something's getting lost in the interops. My advice would be to turn on Px Events (under Configure > Diagnostics) to see if the event is firing with the correct argument. If so, then the problem is somewhere downstream, in the interops or in your code.

If SkunkWorks crashes during logon, but the game keeps running, then the logon event could still be there in the message queue when you restart SkunkWorks, so that could explain the delay. The real question is why it's crashing in the first place. Again, I'd suggest using the built-in diagnostics to monitor the message and event traffic to see if you can narrow down the point at which it's crashing.
spud
The character in question had greater than 4b in total xp. I had meant that during some calculations of xp per hour, I determined that the numbers I was expecting were off by a factor of 0x FFFF FFFF, eg. I earn 1 xp, my xp total reported earned was 1 + 4294967295. I believe that this is due to the starting value being based off skapi.expTotal and the first calculation used when 1xp was earned was based off the xp parameter in the OnStatTotalExp function event. If you ask me to further detail the example using hex math, I'm sure to screw it up. Do you think it is possible the variable used to pass data to the parameter for said function is defined too small to handle total experience past 4b? I will rename the handler just to eliminate that concern.


As for the OnLogin event missing and in regards to your suggestion to activate Debug logging, I was not able to test until today when the auth servers were returned to service. I am in the process of trying to upgrade some programs to VS 2008 so in that vein committed a new development machine by installing AC, Decal, and Skunkworks - all fresh and updated.

The skapi.log file created records OnLogon for some characters now. I have 2 characters now that I do not see the event, originally one, but now the second one since I started earning xp on it. This is not using anything authored by me, just the SWConsole and Decal. I hope below is relevant to our discussion.

OnStart3D()
OnControlEvent("SkunkWorks", "lboxHotkey", dictSzValue)
********************************************************************************
*
* mtyLoginCharacter: Object variable or With block variable not set (Error 91) *
********************************************************************************
*
OnSpellFailSelf(1309)

The log proceeds to record the motd, created objects in inventory, etc etc. Since seeing this specific error message, I would like to also offer that I have seen this specific error in dialog boxes when my program and AC don't quite cooperate on startup. I used to think it had something to do with dynamic dns, active directory, two domains on my LAN, browser elections and NetBIOS lists but since being able to repro the above with two characters on three machines now I am starting to convince myself my network might not be the cause.
GKusnick
I'm still not entirely sure I follow your description of the total XP issue. Have you tried the experiment I suggested of using Px Events to monitor OnStatTotalExp? Are the numbers reported by that diagnostic correct or incorrect? If OnStatTotalExp disagrees with skapi.expTotal, which one has the correct value? If you think there's a bug, the best way to isolate it is to boil it down to the simplest possible repro case, such as a short VBScript or JScript program that does nothing but receive OnStatTotalExp events and print out the values.

The login issue looks like a problem parsing the login message for certain characters. Best way to resolve this is probably to send me a capture file as outlined in the Support section of the SkunkWorks docs. Again, the idea is to boil it down to the minimal repro case: without running any scripts, just set up the capture, log in one of the problematic characters, log all the way back out to Windows, and email me the zipped capture file.

Also, are you sure these are really separate problems? Does the total XP problem happen only on characters that have login issues? If so, that could explain it, if the login info for that character is not being parsed correctly.
spud
Modifying Pacifist.vbs,

CODE
Option Explicit

Public Const evidOnStatTotalExp = 5

Class HandlerCls
    Public Function OnStatTotalExp(xp)
        Call skapi.OutputLine("xp: " & xp & ", skapi.expTotal: " & skapi.expTotal)
        fQuit = True  
    End Function
End Class

Dim handler : Set handler = New HandlerCls

Dim fQuit : fQuit = False

Sub Main
    Call skapi.AddHandler(evidOnStatTotalExp, handler)
    Do Until fQuit
        Call skapi.WaitEvent(100)
    Loop
    Call skapi.RemoveHandler(evidOnStatTotalExp, handler)
End Sub


produced the following result for earning xp casting bd6 on a weapon:

xp: 16219500340, skapi.expTotal: 20514467624
Script exited normally.

skapi.expTotal has the correct value.


I have zipped a capture file and will email to you after I post this. Thank you very much for taking a look at this.


I do believe they are separate problems. The 2nd character to not login correctly has less than 4b total xp. I also have a third character with more xp than the first one (ie, > 4b total xp) and the program runs fine when that one is logged in.
GKusnick
The login issue appears to be solved by regenerating message crackers with the newest Messages.xml. I'll post an updated DLL with the fix when I get a chance.

I'm not seeing any obvious culprit in the XP issue. All the relevant variables are Doubles as far as I can see. If you want send me a capture file of that issue, I can try to step through it to see where it's going wrong.
spud
Yes, I would very much appreciate that and will send you a capture after I post this.

I'm glad you have confidence in the regenerating solving the login mystery, and thank you for that update.
GKusnick
See the sticky post for the fix to these issues.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.