Skip to main content
Registers a callback for observed incoming RakNet packets. The callback receives one RakNetPacket while the packet is valid. Registering the same closure again replaces its stored reference. The function returns the callback it was given.

Syntax

Aliases

  • raknet.add_receive_hook

Arguments

Returns

Types

RakNetPacket

Live packet object passed to RakNet hooks and packet signal callbacks. It is only valid during the callback that receives it.

Example

Observe incoming packets with a callback and remove the same callback later.