Added network sub threads
This commit is contained in:
parent
54f2b9c686
commit
f7209d2164
@ -46,6 +46,9 @@ ui = NodePath("UI")
|
||||
[node name="Client" type="Node" parent="."]
|
||||
unique_name_in_owner = true
|
||||
process_mode = 3
|
||||
process_thread_group = 2
|
||||
process_thread_group_order = 0
|
||||
process_thread_messages = 0
|
||||
script = ExtResource("2_8hxcx")
|
||||
|
||||
[node name="Ping" type="Node" parent="Client"]
|
||||
@ -98,6 +101,9 @@ script = ExtResource("10_y3len")
|
||||
packet_type = 20
|
||||
|
||||
[node name="Statistics" type="Timer" parent="Client"]
|
||||
process_thread_group = 1
|
||||
process_thread_group_order = 0
|
||||
process_thread_messages = 0
|
||||
autostart = true
|
||||
|
||||
[node name="World" type="Node3D" parent="."]
|
||||
|
@ -10,5 +10,8 @@ func _ready():
|
||||
enemy = owner
|
||||
|
||||
func _process(_delta):
|
||||
if !Global.player:
|
||||
return
|
||||
|
||||
var direction := (Global.player.global_position - enemy.global_position).normalized()
|
||||
direction_changed.emit(direction)
|
||||
|
@ -21,5 +21,5 @@ func handle_packet(packet: PackedByteArray):
|
||||
push_warning("Unknown packet type %d" % type)
|
||||
return
|
||||
|
||||
handler.handle_packet(packet.slice(1))
|
||||
handler.handle_packet.call_deferred(packet.slice(1))
|
||||
download += packet.size()
|
||||
|
Loading…
Reference in New Issue
Block a user