RakNet

RakNet.remove_send_hook

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

语法

RakNet.remove_send_hook(callback: function)
别名 raknet.remove_send_hook

参数

名称类型描述
callbackfunctionThe callback closure to remove from outgoing packet hooks.

说明

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

使用 1 个参数调用: callback。参数表会说明哪些值必填,哪些值只用于细化行为。

不返回数据。将调用视为一个动作,并在调用点附近处理错误。

示例

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

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

if raknet.is_enabled then
    raknet.add_send_hook(onSend)
    raknet.remove_send_hook(onSend)
end