Documentación de Real

RakNet

RakNet.remove_receive_hook

Removes a receive hook previously registered with the same callback closure.

Sintaxis

RakNet.remove_receive_hook(callback: function)
Alias raknet.remove_receive_hook

Argumentos

NombreTipoDescripción
callbackfunctionThe callback closure to remove from incoming packet hooks.

Descripción

Removes a receive hook previously registered with the same callback closure. The function returns no values whether or not a matching hook was present.

Llamalo con 1 parametro(s): callback. La tabla de argumentos explica que valores son obligatorios y cuales refinan el comportamiento.

No devuelve datos. Trata la llamada como una accion y maneja errores cerca del punto de llamada.

Ejemplo

Remove a receive hook by passing the same callback closure that was registered.

local function onReceive(packet)
    print(packet.Size)
end

if raknet.is_enabled then
    raknet.add_receive_hook(onReceive)
    raknet.remove_receive_hook(onReceive)
end