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="."]
|
[node name="Client" type="Node" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
process_mode = 3
|
process_mode = 3
|
||||||
|
process_thread_group = 2
|
||||||
|
process_thread_group_order = 0
|
||||||
|
process_thread_messages = 0
|
||||||
script = ExtResource("2_8hxcx")
|
script = ExtResource("2_8hxcx")
|
||||||
|
|
||||||
[node name="Ping" type="Node" parent="Client"]
|
[node name="Ping" type="Node" parent="Client"]
|
||||||
@ -98,6 +101,9 @@ script = ExtResource("10_y3len")
|
|||||||
packet_type = 20
|
packet_type = 20
|
||||||
|
|
||||||
[node name="Statistics" type="Timer" parent="Client"]
|
[node name="Statistics" type="Timer" parent="Client"]
|
||||||
|
process_thread_group = 1
|
||||||
|
process_thread_group_order = 0
|
||||||
|
process_thread_messages = 0
|
||||||
autostart = true
|
autostart = true
|
||||||
|
|
||||||
[node name="World" type="Node3D" parent="."]
|
[node name="World" type="Node3D" parent="."]
|
||||||
|
@ -10,5 +10,8 @@ func _ready():
|
|||||||
enemy = owner
|
enemy = owner
|
||||||
|
|
||||||
func _process(_delta):
|
func _process(_delta):
|
||||||
|
if !Global.player:
|
||||||
|
return
|
||||||
|
|
||||||
var direction := (Global.player.global_position - enemy.global_position).normalized()
|
var direction := (Global.player.global_position - enemy.global_position).normalized()
|
||||||
direction_changed.emit(direction)
|
direction_changed.emit(direction)
|
||||||
|
@ -21,5 +21,5 @@ func handle_packet(packet: PackedByteArray):
|
|||||||
push_warning("Unknown packet type %d" % type)
|
push_warning("Unknown packet type %d" % type)
|
||||||
return
|
return
|
||||||
|
|
||||||
handler.handle_packet(packet.slice(1))
|
handler.handle_packet.call_deferred(packet.slice(1))
|
||||||
download += packet.size()
|
download += packet.size()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user