[Question]New Role String Packet

11/16/2011 05:02 12k#1
Version: 5017

Problem:
After I sent the "NEW_ROLE" message packet to the client to allow it to create a new character, the client is sent to the char creation screen just fine. But after the client goes to create a character, the server doesn't receive any packets back.

Current Packet:
Quote:
int Length = 32 + From.Length + To.Length + Message.Length + 1;
using (PacketWriter PWR = new PacketWriter(Length))
{
PWR.Fill((ushort)Length, 0);
PWR.Fill((ushort)1004, 2);
PWR.Fill((uint)0xFFFFFF, 4);
PWR.Fill((uint)2101, 8);
PWR.Fill((byte)4, 24);
PWR.Fill((byte)From.Length, 25);
PWR.Fill(From, 26);
PWR.Fill((byte)To.Length, 26 + From.Length);
PWR.Fill(To, 27 + From.Length);
PWR.Fill((byte)Message.Length, 28 + From.Length + To.Length);
PWR.Fill(Message, 29 + From.Length + To.Length);
return PWR.Bytes;
}
Any ideas on some things to try to get the client to respond?
11/16/2011 05:06 Spirited#2
You're probably disconnecting the client after sending "NEW_ROLE". The fact that the string packet brought up the character creation screen means that it worked.
11/16/2011 05:09 12k#3
Nope, im 100% sure its not being disconnected. It freezes at "Registering with the server... One moment..." and when I close the game server after like 5 minutes, the client then disconnects. (By popping up with the error message)
11/16/2011 05:10 CptSky#4
If the client is disconnected after NEW_ROLE, you'll get the disconnection only when you'll try to create the character. On the server, you'll never receive anything. So, as Fang said, you probably disconnect the client after sending the NEW_ROLE.
11/16/2011 05:12 12k#5
Not sure if you read my last post. If you didnt, then simply ignore this message. But if you did, how does that explain why the client pops up with the disc message after i close the server after waiting a while without receiving a packet?

Edit: It acts as if its waiting for another packet to be sent to it :s which is very odd. Considering im not getting a packet from it.
11/16/2011 05:20 CptSky#6
Quote:
Originally Posted by 12k View Post
Not sure if you read my last post. If you didnt, then simply ignore this message. But if you did, how does that explain why the client pops up with the disc message after i close the server after waiting a while without receiving a packet?

Edit: It acts as if its waiting for another packet to be sent to it :s which is very odd. Considering im not getting a packet from it.
I was writing my message when you posted your. I really don't see. Sorry.
11/16/2011 05:23 12k#7
No biggy. And just so you guys can kinda see that its not being disconnected:

Quote:
private static void GameServer_AnnounceReceive(byte[] Data, Wrapper obj)
{
new Cryptographer().Decrypt(ref Data);
ushort PacketLength = BitConverter.ToUInt16(Data, 0);
ushort PacketID = BitConverter.ToUInt16(Data, 2);
switch ((Enums.ReceivedPacket)PacketID)
{
case Enums.ReceivedPacket.GameConnect:
{
(obj.connector as Character).UID = BitConverter.ToUInt32(Data, 8);
(obj.connector as Character).Send(PacketBuilder.MessagePacket("NEW_R OLE", "SYSTEM", "ALLUSERS", 0xFFFFFF, Enums.ChatType.LoginInformation));
break;
}
default:
{
GameWriteLine("Missing Packet ID: " + PacketID);
break;
}
}
}
Quote:
private Socket Connection;
public void Send(byte[] Data)
{
new Cryptographer().Encrypt(ref Data);
Connection.Send(Data);
}
11/16/2011 05:35 CptSky#8
Quote:
Originally Posted by 12k View Post
No biggy. And just so you guys can kinda see that its not being disconnected:
Seems that you create a new crypto each time you send/receive a packet... The cryptographer should be created on the connection of the client. And it's always the same that is used for this client.
11/16/2011 05:49 12k#9
well, assuming i changed that right. I set the crypto keys, and use a crypto with the game client. And its still doing the same thing. :\

#Edit: 5017 doesn't need "TQServer" at the end of every packet does it?
11/16/2011 06:04 Spirited#10
Quote:
Originally Posted by 12k View Post
well, assuming i changed that right. I set the crypto keys, and use a crypto with the game client. And its still doing the same thing. :\

#Edit: 5017 doesn't need "TQServer" at the end of every packet does it?
No. It doesn't.
11/16/2011 09:19 Korvacs#11
Is this typo in your source? "NEW_R OLE"
11/16/2011 09:38 Arco.#12
Quote:
Originally Posted by Korvacs View Post
Is this typo in your source? "NEW_R OLE"
If it was then he wouldn't even be getting to the character creation screen right?
11/16/2011 10:56 Korvacs#13
Quote:
Originally Posted by Arco. View Post
If it was then he wouldn't even be getting to the character creation screen right?
TQ wrote the client, who knows :rolleyes:
11/16/2011 12:53 nTL3fTy#14
Quote:
Originally Posted by Korvacs View Post
Is this typo in your source? "NEW_R OLE"
It's just something vBulletin (and other forums probably) do to minimize having an enormous width..

For example, a sequence of w's:
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

If you bother counting, it adds a space every 50 chars there isn't a space.
11/16/2011 13:01 Korvacs#15
Well if ever there was an argument for
Code:
This Tag...........................................................................................................................................................................................