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/login_server.gd | |
parent | e3c185e05823e30eccd7728ceda2ee57cc66fd4d (diff) |
next commit
Diffstat (limited to 'network/login_server.gd')
-rw-r--r-- | network/login_server.gd | 16 |
1 files changed, 16 insertions, 0 deletions
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 |