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