From a22381eff3bf2286ee27f4d15ddf4c431ea063be Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Thu, 12 Dec 2024 02:12:52 +0100 Subject: next commit --- network/character_server.gd | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'network/character_server.gd') 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 -- cgit v1.2.3