From febfbeafc11ecad57d6e9a06575c28f1b13da8da Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Tue, 25 Aug 2020 12:18:49 +0300 Subject: Actually make use of the completely useless CHECK and CH keepalive timer and use them to determine the client's ping. Display ping in the application window title. keepalive timer now fires every second instead of every minute Remove meme clock starting on set_widgets() implement get_ping() on w_courtroom --- src/packet_distribution.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/packet_distribution.cpp') diff --git a/src/packet_distribution.cpp b/src/packet_distribution.cpp index e4e5d5c2..9422cfdb 100644 --- a/src/packet_distribution.cpp +++ b/src/packet_distribution.cpp @@ -116,7 +116,13 @@ void AOApplication::server_packet_received(AOPacket *p_packet) qDebug() << "R:" << f_packet; #endif - if (header == "decryptor") { + if (header == "CHECK") { + if (courtroom_constructed) { + last_ping = w_courtroom->get_ping(); + w_courtroom->set_window_title(window_title + " [ping:" + QString::number(last_ping) + "]"); + } + } + else if (header == "decryptor") { if (f_contents.size() == 0) goto end; @@ -250,7 +256,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet) courtroom_loaded = false; - QString window_title = tr("Attorney Online 2"); + window_title = tr("Attorney Online 2"); int selected_server = w_lobby->get_selected_server(); QString server_address = "", server_name = ""; -- cgit