RakNet

RakNet.remove_receive_hook

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

Syntaxe

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

Arguments

NomTypeDescription
callbackfunctionThe callback closure to remove from incoming packet hooks.

Description

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

Appelle le avec 1 parametre(s): callback. La table des arguments indique les valeurs requises et celles qui affinent le comportement.

Il ne renvoie pas de donnees. Traite l appel comme une action et gere les erreurs autour du point d appel.

Exemple

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