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/login_server.gd | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'network/login_server.gd') diff --git a/network/login_server.gd b/network/login_server.gd index 238a183..a78f750 100644 --- a/network/login_server.gd +++ b/network/login_server.gd @@ -21,3 +21,19 @@ func login(username: String, password: String): if packet is LoginServerLoginSuccessPacket: print(inst_to_dict(packet)) logged_in.emit(packet) + + +func get_keep_alive_timer() -> Timer: + var login_server_keep_alive_timer = Timer.new() + login_server_keep_alive_timer.name = "LoginServerKeepAliveTimer" + login_server_keep_alive_timer.autostart = true + login_server_keep_alive_timer.one_shot = false + login_server_keep_alive_timer.wait_time = 30.0 # 60.0 + + login_server_keep_alive_timer.timeout.connect(func(): + var login_server_keep_alive_packet := LoginServerKeepAlivePacket.new() + login_server_keep_alive_packet.user_name = "dweipert" + send(login_server_keep_alive_packet) + ) + + return login_server_keep_alive_timer -- cgit v1.2.3