import { WritableStreamBuffer } from 'stream-buffers' ; import { OutPacketBase } from 'packets/out/packet' ; import { PacketId } from 'packets/definitions' ; class export class OutUserStartPacket extends OutPacketBase { constructor ( userId , loginName , userName , holepunchPort ) { super ( PacketId . UserStart ) ; this . outStream = new WritableStreamBuffer ( { initialSize : 20 , incrementAmount : 4 } ) ; this . buildHeader ( ) ; this . writeUInt32 ( userId ) ; this . writeString ( loginName ) ; this . writeString ( userName ) ; this . writeUInt8 ( 1 ) ; this . writeUInt16 ( holepunchPort ) ; } }