From dfbd928311835278aa1748e072b77ccd31d3418f Mon Sep 17 00:00:00 2001 From: otavepto Date: Mon, 25 Mar 2024 03:46:13 +0200 Subject: [PATCH] decrease min server latency to 2ms --- dll/steam_matchmaking_servers.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dll/steam_matchmaking_servers.cpp b/dll/steam_matchmaking_servers.cpp index ef50e36a..878cbaad 100644 --- a/dll/steam_matchmaking_servers.cpp +++ b/dll/steam_matchmaking_servers.cpp @@ -350,7 +350,10 @@ void Steam_Matchmaking_Servers::ReleaseRequest( HServerListRequest hServerListRe void Steam_Matchmaking_Servers::server_details(Gameserver *g, gameserveritem_t *server) { - int latency = 10; + PRINT_DEBUG("Steam_Matchmaking_Servers::server_details\n"); + constexpr const static int MIN_LATENCY = 2; + + int latency = MIN_LATENCY; if (settings->matchmaking_server_details_via_source_query && !(g->ip() < 0) && !(g->query_port() < 0)) { unsigned char ip[4]{}; @@ -371,7 +374,9 @@ void Steam_Matchmaking_Servers::server_details(Gameserver *g, gameserveritem_t * A2S_INFO *ssq_a2s_info = ssq_info(ssq); std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now(); latency = (int)std::chrono::duration_cast(t2 - t1).count(); - if (latency < 10) latency = 10; // TODO I don't know if low latency is problematic or not + + // TODO I don't know if low latency is problematic or not, hence this artificial latency + if (latency < MIN_LATENCY) latency = MIN_LATENCY; if (ssq_server_eok(ssq)) { PRINT_DEBUG(" Steam_Matchmaking_Servers::server_details ssq server info ok\n");