RakNet

RakNet.remove_receive_hook

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

構文

RakNet.remove_receive_hook(callback: function)
エイリアス raknet.remove_receive_hook

引数

名前説明
callbackfunctionThe callback closure to remove from incoming packet hooks.

説明

Removes a receive 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 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