RakNet

RakNet.remove_send_hook

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

Sintaks

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

Argumen

NamaTipeDeskripsi
callbackfunctionThe callback closure to remove from outgoing packet hooks.

Deskripsi

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

Panggil dengan 1 parameter: callback. Tabel argumen menjelaskan nilai wajib dan nilai yang hanya menyempurnakan perilaku.

Tidak mengembalikan data. Perlakukan panggilan sebagai aksi dan tangani error di sekitar titik panggilan.

Contoh

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