RakNet

RakNet.remove_receive_hook

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

ไวยากรณ์

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

Arguments

ชื่อชนิดคำอธิบาย
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.

เรียกด้วย parameter 1 ค่า: callback ตาราง arguments อธิบายค่าที่จำเป็นและค่าที่ปรับพฤติกรรม

ไม่ส่งคืนข้อมูล ให้มอง call นี้เป็น action และจัดการ error รอบจุดที่เรียกเมื่อจำเป็น

ตัวอย่าง

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