• Welcome to Valhalla Legends Archive.
 

Packet 0x50 Question

Started by gotcha_ass, January 28, 2003, 06:52 PM

Previous topic - Next topic

gotcha_ass

Ok I have a question about sending the packet 0x50.
The Format is:

(DWORD)             Protocol ID (0)
(DWORD)             Platform ID
(STRING)       Program ID
(DWORD)             Version
(DWORD)             Product language
(DWORD)             Local IP for NAT compatibility*
(DWORD)             Time zone bias*
(DWORD)             Locale ID*
(DWORD)             Language ID*
(STRING)       Country abreviation
(STRING)       Country

Ok, my question is how should I send all the data?? Jus send the PlatformID as IX86, the ProgramID as STAR, the version as 1.09, etc etc. Or should I convert all the values to hex before I send them, because they are all supposed to be Dwords. Oh ya, all the ones w/ stars by them I am sending as (0).

Also, what is Country Abbreviation and Country?

Thanks and reply quick please.

Moonshine

#1
How do you convert a DWORD to hex? Hex is just a representation of the data.

soccerist

All the things you send are in hex.  

DWORDS and other formats are just a way to break the hex up into parts so that it can be easily assembled to create the packet.  

Does that make sense?

If you get a packet logger and log some TCP packets, it will be much clearer.  

Check your packet logs to see what country abreviation and country are.  ;)



(btw, I don't believe that by asking to reply quickly, there will be an incentive for someone to post a reply quicker.)  ;)

gotcha_ass

#3
Ok, I see what you mean but I was jus wondering b/c when I was lookin at the PacketBuffer code after you call InsertDWORD, it calls MakeDWORD which calls ToHex.

So does the code take a string turn it into hex then send it?? I am asking b/c I need to know how to send the data to the InsertDWORD function.

Quote(btw, I don't believe that by asking to reply quickly, there will be an incentive for someone to post a reply quicker.)  ;)

I know, it was jus a shot in the dark ;-)

gotcha_ass

#4
ok, i got the Country Abbreviation (USA) and Country (United States)

But my packet editor did not show me the Version or Product Language.

Also I noticed when it sent my platform and product ids it sent them as 68XIRATS, whent it should be IX86STAR why is it sending them backwards??

Arta

#5
it sends them backwards because they're not strings, they're DWORDs. They look like strings, but in actual fact, they aren't. You can find the current version byte for whichever game you're using from this page on BnetDocs:

http://www.valhallalegends.com/arta/bnetdocs/page.php?id=5

gotcha_ass

#6
ok, thanks. I finally get it now(after going over the code a hundred times)

But I am still confused a little. My platformID is IX86, but thats not a DWORD is it??

Also what should I send for ProductLanguage and why did you call it a version byte, should it be a dword??

UserLoser

#7
No IX86 is not a DWORD, that is a string, You could make that a DWORD by putting it into hex

gotcha_ass

#8
I know that "IX86" is a string, but the packet info on BnetDocs, says that it is supposed to be sent as a DWORD.

Skywing

QuoteI know that "IX86" is a string, but the packet info on BnetDocs, says that it is supposed to be sent as a DWORD.
Actually, the clients treat it as a DWORD internally.  Blizzard games are compiled with Visual C++, which has an extension that allows you to expand the 'c' character notation to 32 bits.  The Blizzard programmers did things like this:

req.platformId = 'IX86';
req.productId = 'SEXP';

gotcha_ass

#10
so I should send it as a string??

UserLoser

You can just use it as like this instead of using a DWORD(Example for Starcraft):

*insert a NonNTString like "68XIRATS"

gotcha_ass

oh ok thanks, last thing what do I send for the ProductLanguage??

shouldnt it be "68XIRATS"

UserLoser

#13
       .InsertDWORD &H0
        .InsertNonNTString "68XIRATS"
        .InsertDWORD &HC5
        .InsertDWORD &H0    ' This can be left as 0
        .InsertDWORD &H0    ' This can be left as 0
        .InsertDWORD &H480  ' This can be left as 0
        .InsertDWORD &H1033 ' This can be left as 0
        .InsertDWORD &H1033 ' This can be left as 0
        .InsertNTString "USA"
        .InsertNTString "United States"
        .SendPacket &H50

Try that, if you need a packet buffer, go on AIM and ill send it to you

gotcha_ass

#14
thanks SOO much