public static void SendPacket(this AsyncConnection con, IServerPacket pkt) { byte opcode = OpcodeManager.Instance.GetOpcode(pkt.GetType().Name); uint packetid = OpcodeManager.Instance.GetPacketID(pkt.GetType().Name); if (packetid == 0) { TORLog.Error("ERROR: No PacketID defined for " + pkt.GetType().Name); return; } ByteBuffer packet = new ByteBuffer(ByteOrder.LittleEndian); packet.WriteByte(opcode); packet.WriteInt(0); // Length packet.WriteByte(0); // ChkByte packet.WriteUInt(packetid); pkt.WritePacket(con, packet); con.SendTORPacket(packet); TORLog.Network("PktSend @ " + con.GetHashCode() + " >> " + pkt.GetType().Name); }