summaryrefslogtreecommitdiff
path: root/network/login_server.gd
diff options
context:
space:
mode:
Diffstat (limited to 'network/login_server.gd')
-rw-r--r--network/login_server.gd16
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