internal void parsePacket(Detrav.Sniffer.Tera.TeraPacket teraPacket) { lock (packets) { packets.Add(new DataPacket(packets.Count, teraPacket)); } }
public TeraPacketParser(TeraPacket packet) : base(packet.data, packet.type) { //ms = new MemoryStream(packet.data); //br = new BinaryReader(ms); elements = new List <PacketElement>(); readUInt16(0, "size"); readUInt16(2, "opcode"); }
public static TeraPacketParser create(TeraPacket packet) { switch (Instance.version) { case OpCodeVersion.P2805: Type p; if (Instance.opCodes2805.TryGetValue(packet.opCode, out p)) { return((TeraPacketParser)Activator.CreateInstance(p, packet)); } return(new TeraPacketParser(packet)); } return(null); }