RakNet

RakNet.remove_receive_hook

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

Cú pháp

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

Đối số

TênKiểuMô tả
callbackfunctionThe callback closure to remove from incoming packet hooks.

Mô tả

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

Goi voi 1 parameter: callback. Bang arguments giai thich gia tri nao bat buoc va gia tri nao chi tinh chinh hanh vi.

Khong tra ve du lieu. Xem call nhu mot action va xu ly loi quanh vi tri goi khi can.

Ví dụ

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