mirror of
https://github.com/kristoferssolo/FuncIt.git
synced 2025-10-21 19:30:35 +00:00
Updated timeout timer
This commit is contained in:
parent
3dbe7fd5dd
commit
8d6a4acb8a
@ -19,7 +19,7 @@ onready var client_connection_timeout_timer = Timer.new()
|
|||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
add_child(client_connection_timeout_timer)
|
add_child(client_connection_timeout_timer)
|
||||||
client_connection_timeout_timer.wait_time = 10
|
client_connection_timeout_timer.wait_time = 600 # 10 min
|
||||||
client_connection_timeout_timer.one_shot = true
|
client_connection_timeout_timer.one_shot = true
|
||||||
|
|
||||||
client_connection_timeout_timer.connect("timeout", self, "_client_connection_timeout")
|
client_connection_timeout_timer.connect("timeout", self, "_client_connection_timeout")
|
||||||
@ -79,6 +79,10 @@ func _server_disconnected() -> void:
|
|||||||
func _client_connection_timeout():
|
func _client_connection_timeout():
|
||||||
if client_connected_to_server == false:
|
if client_connected_to_server == false:
|
||||||
print("Client has been timed out")
|
print("Client has been timed out")
|
||||||
|
|
||||||
|
for child in PersistentNodes.get_children():
|
||||||
|
if child.is_in_group("Net"):
|
||||||
|
child.queue_free()
|
||||||
reset_network_connection()
|
reset_network_connection()
|
||||||
|
|
||||||
var connection_timeout_prompt = Global.instance_node(load("res://source/scenes/OVERLAY/elements/simple_prompt.tscn"), get_tree().current_scene)
|
var connection_timeout_prompt = Global.instance_node(load("res://source/scenes/OVERLAY/elements/simple_prompt.tscn"), get_tree().current_scene)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user