Sintaks
RakNet.remove_receive_hook(callback: function)Alias
raknet.remove_receive_hookArgumen
| Nama | Tipe | Deskripsi |
|---|---|---|
callback | function | The callback closure to remove from incoming packet hooks. |
Deskripsi
Removes a receive 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 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