Returns an array of recent packet records, newest capture last. This is a snapshot of a ring buffer, so it is the cheap way to look at traffic without installing a listener.
RakNet is off by default. The library exists only when the RakNet feature is enabled in the Athena loader, and it is published on getgenv() rather than as a plain global. Guard your code with if getgenv().raknet then ... end, or read raknet.is_enabled.

Parameters

number
default:"128"
How many records to return. Values below 1 are raised to 1 and values above 512 are lowered to 512.

Returns

table
An array of packet records. See the record fields.

Behavior

  • Payloads may be truncated. Large packets are captured up to a limit; check the truncated field and compare #data against size.
  • It is a copy. Mutating the returned tables affects nothing.

Example