From 4c754602314d62919ebe9b080e4fe70bcecd4269 Mon Sep 17 00:00:00 2001 From: nochinator <61996219+nochinator@users.noreply.github.com> Date: Thu, 11 Jul 2024 06:18:17 -0400 Subject: [PATCH 1/3] Update serverbrowser.cpp to add option to update_now, ignoring wait for serverupdateinterval --- src/engine/serverbrowser.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/engine/serverbrowser.cpp b/src/engine/serverbrowser.cpp index 8cc583a18..e6f3a94e9 100644 --- a/src/engine/serverbrowser.cpp +++ b/src/engine/serverbrowser.cpp @@ -389,7 +389,7 @@ void checkpings() static inline int serverinfocompare(serverinfo *a, serverinfo *b) { return client::servercompare(a, b) < 0; } -void refreshservers() +void refreshservers(const int update_now = 0) { static int lastrefresh = 0; if(lastrefresh == totalmillis) return; @@ -403,7 +403,7 @@ void refreshservers() checkresolver(); checkpings(); - if(totalmillis - lastinfo >= (serverupdateinterval*1000)/(maxservpings ? max(1, (servers.length() + maxservpings - 1) / maxservpings) : 1)) pingservers(); + if(totalmillis - lastinfo >= (serverupdateinterval*1000)/(maxservpings ? max(1, (servers.length() + maxservpings - 1) / maxservpings) : 1) || update_now = 1) pingservers(); } bool reqmaster = false; @@ -499,14 +499,14 @@ void updatefrommaster() else conoutf(colourgrey, "Retrieved list from master successfully"); } else conoutf(colourred, "Master server not replying"); - refreshservers(); + refreshservers(1); } COMMAND(IDF_NOECHO, updatefrommaster, ""); -void updateservers() +void updateservers(const int update_now = 0) { if(!reqmaster) updatefrommaster(); - refreshservers(); + refreshservers(update_now); if(autosortservers && !pausesortservers) sortservers(); intret(servers.length()); } From 54e3e2fe4462bd8c7ad745fd6a11cbfbe4216dfc Mon Sep 17 00:00:00 2001 From: nochinator <61996219+nochinator@users.noreply.github.com> Date: Thu, 11 Jul 2024 06:20:58 -0400 Subject: [PATCH 2/3] Update online.cfg to use cahnges made to serverbrowser.cpp --- config/ui/game/online.cfg | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config/ui/game/online.cfg b/config/ui/game/online.cfg index f2a31e7c2..a32d53b74 100644 --- a/config/ui/game/online.cfg +++ b/config/ui/game/online.cfg @@ -23,7 +23,11 @@ gameui_online_ver_check = [ gameui_online_update = [ if (>=f $gameui_panel_anim 1) [ - updateservers + if (> $_lastping 0) [ + updateservers + ] [ + updateservers 1 + ] ] ] @@ -203,7 +207,7 @@ ui_gameui_online_entry_mapshot = [ uipad 0.02 0 0 0 [ uialign -1 uicolour 0 0.2 $_size [ - if (>= $_lastping 0) [ + if (>= $+++++ 0) [ uitext "?" 4 uicroppedimage (concatword "maps/" $_mapname) 0xffffff 0 0.2 $_size 0 (+f (*f $_size -2.5) 0.5) 1 (divf $_size 0.2) [ uispace 0 0.01 [ From 6bb1fead10f41e45ef399966a43c146143f852d8 Mon Sep 17 00:00:00 2001 From: nochinator <61996219+nochinator@users.noreply.github.com> Date: Thu, 11 Jul 2024 06:33:19 -0400 Subject: [PATCH 3/3] Update online.cfg with logic that does first ping before the animation happens further reducing delay for higher ping clients --- config/ui/game/online.cfg | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/config/ui/game/online.cfg b/config/ui/game/online.cfg index a32d53b74..180464969 100644 --- a/config/ui/game/online.cfg +++ b/config/ui/game/online.cfg @@ -22,13 +22,14 @@ gameui_online_ver_check = [ ] gameui_online_update = [ - if (>=f $gameui_panel_anim 1) [ - if (> $_lastping 0) [ + if (> $_lastping 0) [ + if (>=f $gameui_panel_anim 1) [ updateservers - ] [ - updateservers 1 ] + ] [ + updateservers 1 ] + ] ui_gameui_online_connect_on_close = [