import { WritableStreamBuffer } from 'stream-buffers' ; import { OutPacketBase } from 'packets/out/packet' ; import { PacketId } from 'packets/definitions' ; class export class OutVersionPacket extends OutPacketBase { constructor ( isBadHash , hash ) { super ( PacketId . Version ) ; this . outStream = new WritableStreamBuffer ( { initialSize : 40 , incrementAmount : 12 } ) ; this . buildHeader ( ) ; this . writeUInt8 ( isBadHash ? 1 : 0 ) ; this . writeString ( hash ) ; } }