Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: l2k-Shadow on February 23, 2007, 06:36 PM

Title: 0x26 last game key
Post by: l2k-Shadow on February 23, 2007, 06:36 PM
For the record\game\0\last game key, the server sends back:

9817155 3780018076


Starcraft outputs: 10/26/2006 14:15 for the time last game was played, does anyone know how to convert the value into that time?
Title: Re: 0x26 last game key
Post by: Hdx on February 23, 2007, 06:42 PM
It's jsut a Filetime structure like in 0x50.
1st is the Hi, 2nd is the low. I think, it might be the other way around.
Same goes for Last Login, Account created, Last Logoff, etc...
Its just cuz they send them as strings.
~Hdx
Title: Re: 0x26 last game key
Post by: l2k-Shadow on February 23, 2007, 07:09 PM
Oh that makes sense, I tried that prior to posting but made a coding mistake so I thought it could be something else since I was receiving crap results. thx.
Title: Re: 0x26 last game key
Post by: brew on February 23, 2007, 08:59 PM
Uh... HDX how would you extract the date from the second filetime? The only one I (really) got so far, is the account logged. (it's in seconds). I already tried parsing the filetimes by using my system uptime function and it returned a far-off value. help :(
Title: Re: 0x26 last game key
Post by: l2k-Shadow on February 23, 2007, 09:13 PM
Quote from: brew on February 23, 2007, 08:59 PM
Uh... HDX how would you extract the date from the second filetime? The only one I (really) got so far, is the account logged. (it's in seconds). I already tried parsing the filetimes by using my system uptime function and it returned a far-off value. help :(

Put the data into a FILETIME struct then call FileTimeToSystemTime(FILETIME, SYSTEMTIME), look FileTimeToSystemTime up on MSDN.
Title: Re: 0x26 last game key
Post by: brew on February 23, 2007, 10:05 PM
This will work for converting a filetime to a date too, correct? (the first filetime)
Title: Re: 0x26 last game key
Post by: l2k-Shadow on February 23, 2007, 10:16 PM
Quote from: brew on February 23, 2007, 10:05 PM
This will work for converting a filetime to a date too, correct? (the first filetime)

Look into the SYSTEMTIME struct, http://msdn2.microsoft.com/en-us/library/ms724950.aspx (http://msdn2.microsoft.com/en-us/library/ms724950.aspx)
Title: Re: 0x26 last game key
Post by: brew on February 23, 2007, 10:35 PM
Ah. Thanks, shadow.