im not sure if you entirely understand the concept of packets, so ill explain it briefly
a packet is a byte[] with a constant structure for the first 4 bytes and last 8 bytes (talking about conquer packets)
first ushort is length, second ushort is type, and last string is the sealing
if you are trying to send a packet as a structure it should end up sending a byte[] (atleast that's what it did on c++ last time i tried)
let me explain what it really does at the example you gave us
lets just stick with the fact that packet is a byte[] with structure for every type
it first switch on the type of the packet with something like
Code:
switch (BitConverter.ToUInt16(Packet, 2))
{
case 1052:
{
}
}
and then it creates a new instance of the class Connect which it then calls a function inside calls "Deserialize" which mainly assign the byte[]/packet you pass as parameter to another byte[]/packet inside this class
which let the other properties read and write to it
i don't currently have any of trinity bases to get code snippet but it's basically something like
Code:
public class Connect
{
public byte[] packet
//ctor
public uint Identifier
{
get { return ReadUInt32(4); }
set { WriteUInt32(value, 4); }
}
public Deserialize (byte[] _packet)
{
packet = _packet
}
//dtor
}
back to what you really want
conquer login sequence is a bit complicated if you don't really understand the crypto behind it, but lets put the crypto away
all you need is to auth the player which requires on packet sending the username and password
then you can either follow tq logic of having 2 instances with 2 connections, one of each for login/auth and the other for the game, where you are not allowed to login to the game server without first passing the login/auth server
or you may use a simpler logic of having just one connection with one instance with a bool property indicating the verification status, that being set by matching the account and password from the database to true and to false whenever it doesn't or the account disconnect
which will decide later to forward packets and analyise it from this connection or just drop the connection
so all in all, packet is a byte[] and i've mentioned above how it works