Packet.onSend

Called before the packet is sent over the network.

This function can be defined by derived classes to transform the data before it is sent; this can be used for compression, encryption, etc.

The function must return an array of the modified data, with a length of the number of bytes to send. The default implementation provides the packet's data without transforming it.

class Packet
const(void)[]
onSend
()

Return Value

Type: const(void)[]

Array of bytes to send.

Meta