import { WritableStreamBuffer } from 'stream-buffers' ; import { PacketId } from 'packets/definitions' ; import { OutPacketBase } from 'packets/out/packet' ; import { ChannelServer } from 'channel/channelserver' ; import { OutChannelServerItem } from 'packets/out/serverlist/serveritem' ; class export class OutServerListPacket extends OutPacketBase { constructor ( channelServers ) { super ( PacketId . ServerList ) ; this . outStream = new WritableStreamBuffer ( { initialSize : 60 , incrementAmount : 12 } ) ; this . buildHeader ( ) ; this . writeUInt8 ( channelServers . length ) ; for ( const server of channelServers ) { new OutChannelServerItem ( server ) . build ( this ) ; } } }