NEW_ROLE packet length

06/10/2014 15:32 EdP#1
Hi all, I'm making a source of my own mostly for academic purposes but I would like to make it a functional source.

I'm working with 5065 patch and I'm trying to get to the character creation screen.

I got the 1052(Auth Message Packet) from the client and then I send a Chat Packet from "SYSTEM" to "ALLUSERS" with the message "NEW_ROLE", but the client hangs.

Since all strings have a fixes length I would like to know what this specific packet length should be and that may help me fix the issue.

Here's what I send to the client after receiving the Auth Message Packet from the client:
Code:
Length:59 Type:1004	
3b 00 ec 03 ff ff ff 00 34 08 00 00 01 00 00 00 00 00 00 00 	; . . . . . . . 4 . . . . . . . . . . . 
00 00 00 00 04 06 53 59 53 54 45 4d 08 41 4c 4c 55 53 45 52 	. . . . . . S Y S T E M . A L L U S E R 
53 00 08 4e 45 57 5f 52 4f 4c 45 54 51 53 65 72 76 65 72    	S . . N E W _ R O L E T Q S e r v e r
06/10/2014 15:43 jackpotsvr#2
[Only registered and activated users can see links. Click Here To Register...] is how new role packet should look like on 5017, and I think the packet structure [Only registered and activated users can see links. Click Here To Register...]

Isn't the packet length 59 a bit to long (for 'new_role' message obviously)?

-EDIT

Quote:
Originally Posted by EdP View Post
Code:
Length:59 Type:1004	
3b 00 ec 03 ff ff ff 00 34 08 00 00 01 00 00 00 00 00 00 00 	; . . . . . . . 4 . . . . . . . . . . . 
00 00 00 00 04 06 53 59 53 54 45 4d 08 41 4c 4c 55 53 45 52 	. . . . . . S Y S T E M . A L L U S E R 
53 00 08 4e 45 57 5f 52 4f 4c 45 54 51 53 65 72 76 65 72    	S . . N E W _ R O L E T Q S e r v e r
Also if I am not mistaken you sent the packet with [Only registered and activated users can see links. Click Here To Register...](2100) decimal which is Chat Type dialog. Try sent it with [Only registered and activated users can see links. Click Here To Register...](2101) which is Login Information.
06/10/2014 15:52 EdP#3
Thanks jackpotsvr, I'll give it a try! Does that mean that [Only registered and activated users can see links. Click Here To Register...] is inaccurate for this packet?
You seem to write shorts where it says is should be ints
Or am I seeing it wrong?
06/10/2014 15:55 jackpotsvr#4
Quote:
Originally Posted by EdP View Post
Thanks jackpotsvr, I'll give it a try! Does that mean that [Only registered and activated users can see links. Click Here To Register...] is inaccurate for this packet?
You seem to write shorts where it says is should be ints
Or am I seeing it wrong?
I am doing the opposite but you can ignore it long as you program in C# or C++ which most of this community seem to do :>. It's because Java doesn't know unsigned values (for instane unsigned short 0-65536 where a Java short can only go from -32,768 to 32,767.)

So we always used Java Type int for what are shorts in reality et cetera and had to do some magic to write them good to the packets ;)
06/10/2014 16:02 EdP#5
I got that! what I meant was that you are "writing" two zeros in positions 12 and 14, each one two bytes, making them a short or a ushort. In the wiki starting in position 12 is shows 3 ints (4 byte Numbers)

Edit: After the server sends the NEW_ROLE packet the client should display the character creation screen right away?

Edit2: Changed the chat type to 2101 still no luck, client hangs

Edit3:
I got it to the character selection screen, here's what I was doing wrong.
When writing in the packet the own packet length I included the "TQServer" length.

So I removed it and it seems to work now
06/10/2014 17:12 jackpotsvr#6
Quote:
Originally Posted by EdP View Post
I got that! what I meant was that you are "writing" two zeros in positions 12 and 14, each one two bytes, making them a short or a ushort. In the wiki starting in position 12 is shows 3 ints (4 byte Numbers)

Edit: After the server sends the NEW_ROLE packet the client should display the character creation screen right away?

Edit2: Changed the chat type to 2101 still no luck, client hangs

Edit3:
I got it to the character selection screen, here's what I was doing wrong.
When writing in the packet the own packet length I included the "TQServer" length.

So I removed it and it seems to work now
Haha, well done.

I found the packet length quite long already.

Good luck with your project.
06/10/2014 17:25 EdP#7
Thanks, don't know if I'll ever have a finished project but I'm developing while I'm enjoying discovering new things.

I'm working in Java too.