ReferenceRakNet

RakNetPacket:Block

Prevents the current outgoing packet from being sent.

Syntax

packet:Block() -> ()

Also available as

RakNetPacket:DropRakNetPacket:Ignore

Description

This method is valid only during an outgoing hook. Drop and Ignore are alternate names for the same operation. Received snapshots cannot be blocked after delivery. Blocking protocol traffic can disconnect a session; use this only in controlled tests.

Example

local function makeFilter(shouldBlock)
    return function(packet)
        if shouldBlock(packet) then packet:Block() end
    end
end

Notes

These are Game executor contracts. Check build requirements and session lifetimes before using them.