[Help] Messaging packet version 5630+

02/09/2013 22:18 _DreadNought_#31
Wasted time and effort making sure you type it right and then checking you did +8 as its an easy mistake to miss where as a a seal method just seems fool proof :P
02/09/2013 22:32 Super Aids#32
I never had to make sure about that, because I made it right from the start. Derp.
02/10/2013 10:20 JobvdH#33
Alright, I've fixed the TQServer string, now I disconnect when sending the packet instead of freezing.

Heres my packet
Length: 34 + From.Length + To.Length + Message.Length
Type: 1004
Code:
            WriteUInt((uint)Color.White.ToArgb(), 4);
            WriteUInt(Type, 8);
            WriteUInt(EntityID, 12);
            WriteUInt(client.Mesh, 20);
            WriteByte(4, 24);
            WriteStringWithLength(From, 25);
            WriteStringWithLength(To, 26 + From.Length);
            WriteStringWithLength(Message, 28 + From.Length + To.Length);
And when sending it to the socket system:
Code:
            byte[] _buffer = new byte[buffer.Length + 8];
            Buffer.BlockCopy(buffer, 0, _buffer, 0, buffer.Length);
            Writer.WriteString("TQServer", _buffer.Length - 8, _buffer);
            Console.WriteLine(Server.Dump(_buffer));
            Cipher.Encrypt(ref _buffer);
            if (_socket.Connected)
            {
                _socket.Send(_buffer);
            }
Does anyone have an idea why I disconnect?
02/10/2013 14:26 Super Aids#34
You only write the mesh on whisper if I am correct, because it's used to show the avatars of the players.

I don't think that's the problem though.
Could you make a dump of your current packet by any chance
02/10/2013 17:20 JobvdH#35
The mesh is 0 since it doesn't set character data before sending NEW_ROLE or ANSWER_OK, so I don't think that could hurt.
Anyways here is the dump:
[Only registered and activated users can see links. Click Here To Register...]
02/10/2013 17:36 Super Aids#36
The size of your packet is invalid. There is 6 offsets from your message to TQServer which should be 0.

Your written size should be 51 and your final size (after TQServer) should be 59.
02/10/2013 17:42 JobvdH#37
Alright I reduced the packet size to 0 bytes between TQServer and the last character of the message. Now I still get disconnected.

My packet:
Code:
            WriteUInt((uint)Color.White.ToArgb(), 4);
            WriteUInt(Type, 8);
            WriteUInt(EntityID, 12);
            WriteUInt(client.Mesh, 20);
            WriteByte(4, 24);
            WriteStringWithLength(From, 25);
            WriteStringWithLength(To, 26 + From.Length);
            WriteStringWithLength(Message, 28 + From.Length + To.Length);
Dump:
[Only registered and activated users can see links. Click Here To Register...]
02/10/2013 17:53 Super Aids#38
One thing that is not related to this.
Lock your crypto-

Uhmm regarding your packet.

Your dump is the first, mine is the next. I have marked a specific area in your dump and in my dump that I want you to compare.
[Only registered and activated users can see links. Click Here To Register...]

Can you see what you are missing?
That empty byte between "to" and "message".
02/10/2013 18:04 JobvdH#39
Added that still didn't solve the problem
[Only registered and activated users can see links. Click Here To Register...]