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