Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Gandalf on February 07, 2004, 09:48 PM

Title: Profile Stuff..
Post by: Gandalf on February 07, 2004, 09:48 PM
And what about the Created Account date, it shows: "29475313 2842110102" What i have to do to show me the normal date?
Title: Re:Profile Stuff..
Post by: Newby on February 07, 2004, 09:54 PM
Create a sub to parse it.
Title: Re:Profile Stuff..
Post by: UserLoser. on February 07, 2004, 09:56 PM
It's a filetime, one part is lowdatetime, other is highdate time... Look into the SYSTEMTIME and FILETIME structs, along with FileTimeToSystemTime()
Title: Re:Profile Stuff..
Post by: Gandalf on February 07, 2004, 10:21 PM
Whats wrong with this:
Private Function ReturnDHMS(iSec1 As Single) As String
   
   Dim iMin As Single
   Dim iHrs As Single
   Dim iDay As Single
   Dim iSec As Single
   
   iSec = iSec1
   
   iHrs = (iMin \ 60)
   iMin = (iSec \ 60)
   iSec = (iSec Mod 60)
   
   If iHrs >= 24 Then
       iDay = iHrs \ 24
       iHrs = iHrs Mod 24
   End If
   
   ReturnDHMS = "Day:" & Str(iDay) & "  Hrs:" & Str(iHrs) & "  Min: " & Str(iMin) & "  Sec: " & Str(iSec)
   
End Function
Title: Re:Profile Stuff..
Post by: Lenny on February 07, 2004, 10:21 PM
Well the other profile keys are sent as unsigned dwords in the form of Filetimes...not seconds


Bnet sends you it in
HIGHdate
LOWdate
order.

You need to also convert it using FileTimeToLocalFileTime() before using FileTimeToSystemTime()
Title: Re:Profile Stuff..
Post by: UserLoser. on February 07, 2004, 10:34 PM
Quote from: Lenny on February 07, 2004, 10:21 PM
You need to also convert it using FileTimeToLocalFileTime() before using FileTimeToSystemTime()

That's not true
Title: Re:Profile Stuff..
Post by: Lenny on February 07, 2004, 10:50 PM
Well I assume most people would want the local time they created the account, not the time a bnet server recorded it.....
Title: Re:Profile Stuff..
Post by: Spht on February 07, 2004, 10:52 PM
Quote from: Lenny on February 07, 2004, 10:50 PM
Well I assume most people would want the local time they created the account, not the time a bnet server recorded it.....

If you sent Battle.net proper location information, it'll return the time in your timezone.
Title: Re:Profile Stuff..
Post by: Eric on February 08, 2004, 12:02 AM
QuoteIf you sent Battle.net proper location information, it'll return the time in your timezone.

That's not true for profile keys.
Title: Re:Profile Stuff..
Post by: UserLoser. on February 08, 2004, 12:10 AM
TimeZone is either sent in the 7th DWORD of 0x50 (SID_AUTH_INFO), or the 5th DWORD of 0x12 (SID_LOCALEINFO)...

Correct information to send is the Bias + StandardBias from TIME_ZONE_INFORMATION struct, which can be retrieved using GetTimeZoneInformation()

Note: 0x12 is only used by either W2BN/JSTR/DRTL/DSHR, while 0x50 can be used for any product
Title: Re:Profile Stuff..
Post by: Spht on February 08, 2004, 01:13 PM
Quote from: LoRd[nK] on February 08, 2004, 12:02 AM
QuoteIf you sent Battle.net proper location information, it'll return the time in your timezone.

That's not true for profile keys.

Probably because profiles contain no time information? I'm referring to the system times stored on the Battle.net server for things like last game, last logon, etcetera.
Title: Re:Profile Stuff..
Post by: Eric on February 08, 2004, 01:54 PM
Quote
From BnetDocs:

SID_READUSERDATA (0x26)
Packet ID: 0x26
Direction: Server -> Client (Received)
Format:
Help (DWORD)       Number of accounts
(DWORD)       Number of keys
(DWORD)       Request ID
(STRING[])    Requested Key Values

I feel the term "profile keys" fits quite well with the information you'd put into the string array of a user data request, if you see it differently, so be it.

Aside from that, when the information returned from 0x26 is in FileTime format, the FileTime is sent in Battle.net Time, not Local Time, no matter if the information you send in 0x50 is accurate or not.

Now, I'm done arguing about something that I know is right.
Title: Re:Profile Stuff..
Post by: Spht on February 08, 2004, 01:57 PM
Quote from: LoRd[nK] on February 08, 2004, 01:54 PM
Quote
From BnetDocs:

SID_READUSERDATA (0x26)
Packet ID: 0x26
Direction: Server -> Client (Received)
Format:
Help (DWORD)       Number of accounts
(DWORD)       Number of keys
(DWORD)       Request ID
(STRING[])    Requested Key Values

I feel the term "profile keys" fits quite well with the information you'd put into the string array of a user data request, if you see it differently, so be it.

Aside from that, when the information returned from 0x26 is in FileTime format, the FileTime is sent in Battle.net Time, not Local Time, no matter if the information you send in 0x50 is accurate or not.

Now, I'm done arguing about something that I know is right.

Yes, I was referring to whoever said using FileTimeToLocalFileTime to convert it to your local time would be a valid solution.
Title: Re:Profile Stuff..
Post by: Eric on February 08, 2004, 01:58 PM
Quote
If you sent Battle.net proper location information, it'll return the time in your timezone.

Yes, I was referring to whoever said using FileTimeToLocalFileTime to convert it to your local time would be a valid solution.
It is, but after that you'd still have to convert it to SystemTime to get the "real" date/time.
Title: Re:Profile Stuff..
Post by: Spht on February 08, 2004, 02:03 PM
Quote from: LoRd[nK] on February 08, 2004, 01:58 PM
Quote
Yes, I was referring to whoever said using FileTimeToLocalFileTime to convert it to your local time would be a valid solution.
It is, but after that you'd still have to convert it to SystemTime to get the "real" date/time.

Assuming you want the time as a SYSTEMTIME structure, which isn't a requirement.
Title: Re:Profile Stuff..
Post by: Gandalf on February 08, 2004, 03:23 PM
Can u give me the source, is just this is so confusing, i have been trying for 3 days now.
Title: Re:Profile Stuff..
Post by: Kp on February 08, 2004, 03:31 PM
Quote from: Gandalf on February 08, 2004, 03:23 PM
Can u give me the source, is just this is so confusing, i have been trying for 3 days now.

Parse the two numbers into unsigned longs.  Store those into a FILETIME structure.  Call FileTimeToSystemTime on the resulting structure.  Display the result.  It's really not that hard...
Title: Re:Profile Stuff..
Post by: hismajesty on February 08, 2004, 04:07 PM
Quote from: Gandalf on February 08, 2004, 03:23 PM
Can u give me the source, is just this is so confusing, i have been trying for 3 days now.

try harder
Title: Re:Profile Stuff..
Post by: o.OV on February 08, 2004, 07:46 PM
Currency
Title: Re:Profile Stuff..
Post by: Spht on February 08, 2004, 08:05 PM
Quote from: o.OV on February 08, 2004, 07:46 PM
Currency

In keeping with standards, the FILETIME structure should be used.
Title: Re:Profile Stuff..
Post by: Gandalf on February 09, 2004, 10:17 PM
Hey, and someone know the Profile Request Values?
Like:
"Profile\Sex"
"System\Last Logon"
I need all of them, i need some fun :O.
Title: Re:Profile Stuff..
Post by: Kp on February 10, 2004, 09:10 AM
Quote from: Gandalf on February 09, 2004, 10:17 PMHey, and someone know the Profile Request Values?
Like:
"Profile\Sex"
"System\Last Logon"
I need all of them, i need some fun :O.

Check a packet log.  It's all requested automatically when you log on.
Title: Re:Profile Stuff..
Post by: UserLoser. on February 10, 2004, 06:32 PM
Quote from: Kp on February 10, 2004, 09:10 AM
Quote from: Gandalf on February 09, 2004, 10:17 PMHey, and someone know the Profile Request Values?
Like:
"Profile\Sex"
"System\Last Logon"
I need all of them, i need some fun :O.

Check a packet log.  It's all requested automatically when you log on.

System keys are not - Who first knew of these and how?
Title: More profile stuff...
Post by: UserLoser. on February 10, 2004, 07:57 PM
To expand this topic, what's the max length you can set Description, Location, and Sex to?