summaryrefslogtreecommitdiff
path: root/network/character_server.gd
diff options
context:
space:
mode:
Diffstat (limited to 'network/character_server.gd')
-rw-r--r--network/character_server.gd15
1 files changed, 15 insertions, 0 deletions
diff --git a/network/character_server.gd b/network/character_server.gd
index 4831b36..ec0aadb 100644
--- a/network/character_server.gd
+++ b/network/character_server.gd
@@ -56,3 +56,18 @@ func select_character(slot: int):
if packet is CharacterSelectionSuccessPacket:
print(inst_to_dict(packet))
selected_character.emit(packet)
+
+
+func get_keep_alive_timer() -> Timer:
+ var character_server_keep_alive_timer = Timer.new()
+ character_server_keep_alive_timer.name = "CharacterServerKeepAliveTimer"
+ character_server_keep_alive_timer.autostart = true
+ character_server_keep_alive_timer.one_shot = false
+ character_server_keep_alive_timer.wait_time = 12.0
+
+ character_server_keep_alive_timer.timeout.connect(func():
+ var character_server_keep_alive_packet := CharacterServerKeepAlivePacket.new()
+ send(character_server_keep_alive_packet)
+ )
+
+ return character_server_keep_alive_timer