#region Usings... using System; using System.Collections.Generic; using System.Text; using Cell.Core; using LoginEngine.Packets; using LoginEngine.QueryBase; using LoginEngine; using System.IO; using System.Net; #endregion namespace LoginEngine.Packets { public class CharacterEntry { private static byte[] s_firstRandomSegment; private static byte[] s_secondRandomSegment; private static byte[] s_thirdRandomSegment; private static byte[] s_fourthRandomSegment; private static byte[] s_fifthRandomSegment; private static byte[] s_sixthRandomSegment; private byte[] m_rawCharacterData; static CharacterEntry() { s_firstRandomSegment = new byte[] { 0xDF, 0xDF, 0x00, 0x01, 0x00, 0x01, 0x00, 0x90, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x61, 0x5B, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04 }; s_secondRandomSegment = new byte[] { 0x61, 0x00, 0x00, 0xC7, 0x9D }; s_thirdRandomSegment = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0x50, 0x00, 0x67, 0x77, 0x6C, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04 }; s_fourthRandomSegment = new byte[] { 0x00, 0x00, 0x00, 0x0B }; s_fifthRandomSegment = new byte[] { 0x00, 0x00, 0x00, 0x03 }; s_sixthRandomSegment = new byte[] { 0x00, 0x00, 0x00, 0x0C, 0x61, 0x72, 0x65, 0x61, 0x20, 0x75, 0x6E, 0x6B, 0x6E, 0x6F, 0x77, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x64, 0x37, 0x38 }; } public CharacterEntry() { } public string Name { get; set; } public uint ID { get; set; } public uint Level { get; set; } public uint Profession { get; set; } public uint Breed { get; set; } public uint ZoneID { get; set; } public byte[] RawData { get { if (m_rawCharacterData == null) { GenerateCharacterData(); } return m_rawCharacterData; } } private void GenerateCharacterData() { MemoryStream memStream = new MemoryStream(149); using (BinaryWriter writer = new BinaryWriter(memStream)) { writer.Write(s_firstRandomSegment); //This is a Random Acoount Seed ID... writer.Write(IPAddress.HostToNetworkOrder(ID)); writer.Write(s_secondRandomSegment); //This Tells the Client the Zone ID where you are at.. writer.Write(IPAddress.HostToNetworkOrder(ZoneID)); writer.Write(s_thirdRandomSegment); //this is a Random Seed ID Again... its the same as the first one... writer.Write(IPAddress.HostToNetworkOrder(ID)); writer.Write(s_fourthRandomSegment); //Character Name send to the Client... writer.Write(Encoding.ASCII.GetBytes(Name)); //Character Breed send to the Client... writer.Write(IPAddress.HostToNetworkOrder(Breed)); writer.Write(s_fifthRandomSegment); //Character Profession send to the Client... writer.Write(IPAddress.HostToNetworkOrder(Profession)); //Character Level send to the Client... writer.Write(IPAddress.HostToNetworkOrder(Level)); writer.Write(s_sixthRandomSegment); m_rawCharacterData = memStream.ToArray(); } } } }