I noticed alot of sources that have been released to public use the accessor method, which was been presented by Hybrid back then. I'm curious which method you personally use, and for what reason. My personal choice is structured packets. Example;
Looking forward to your feedback.
Code:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
struct LoginResponse
{
public PacketHeader Header;
public UInt32 Key;
public UInt32 ID;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
public String IP;
public UInt16 Port;
public UInt16 Blank;
}
public byte[] ToArray()
{
Filler = new PacketFiller(Marshal.SizeOf(Response));
Filler.FillPacket<LoginResponse>(Response);
return Filler.ToArray();
}