RakNetPacket
Packet snapshots and callback-scoped mutation methods.
local function inspect(packet)
print(packet.PacketId, packet.Size)
end
raknet.add_receive_hook(inspect)
raknet.remove_receive_hook(inspect)Snapshot fields
| Member | Type / signature | Meaning |
|---|---|---|
PacketId | number | Packet identifier byte. |
Size | number | Byte length. |
Priority | number | Send priority when available. |
Reliability | number | Reliability value when available. |
OrderingChannel | number | Ordering channel when available. |
AsString | string | Packet bytes. |
AsArray | {number} | Byte values. |
AsBuffer | buffer? | Luau buffer when the engine buffer constructor is available. |
Mutation methods
Block(): () blocks the current packet. SetData(data) replaces its bytes using a supported string, byte array or buffer. The replacement must fit the 4 KiB packet limit.
These methods refer to the live packet only while the callback is running. Retaining the table does not retain permission to mutate a future packet. The snapshot fields describe the data captured when the record was built.
