diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-12-12 02:12:52 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-12-12 02:12:52 +0100 |
commit | a22381eff3bf2286ee27f4d15ddf4c431ea063be (patch) | |
tree | 965bdcf12e5e0cf63c88cbba1bd5a52ba474f81f /network/character_server.gd | |
parent | e3c185e05823e30eccd7728ceda2ee57cc66fd4d (diff) |
next commit
Diffstat (limited to 'network/character_server.gd')
-rw-r--r-- | network/character_server.gd | 15 |
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 |