Added thread safe packet handlers
This commit is contained in:
@ -21,9 +21,5 @@ func handle_packet(packet: PackedByteArray):
|
||||
push_warning("Unknown packet type %d" % type)
|
||||
return
|
||||
|
||||
if handler.thread_safe:
|
||||
handler.handle_packet(packet.slice(1))
|
||||
else:
|
||||
handler.handle_packet.call_deferred(packet.slice(1))
|
||||
|
||||
handler.handle_packet(packet.slice(1))
|
||||
download += packet.size()
|
||||
|
@ -16,7 +16,5 @@ enum Packet {
|
||||
|
||||
@export var packet_type: Packet
|
||||
|
||||
var thread_safe: bool
|
||||
|
||||
func handle_packet(_data: PackedByteArray):
|
||||
pass
|
Reference in New Issue
Block a user