AcediaDocumentation

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

MemberType / signatureMeaning
PacketIdnumberPacket identifier byte.
SizenumberByte length.
PrioritynumberSend priority when available.
ReliabilitynumberReliability value when available.
OrderingChannelnumberOrdering channel when available.
AsStringstringPacket bytes.
AsArray{number}Byte values.
AsBufferbuffer?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.

On this page