From 6bdc73ad3db85eb9d3dc014e35fb192af8c220f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Mon, 8 Jan 2024 21:42:52 +0100 Subject: [PATCH] Fix community not set for servers with missing server info The server community was only initialized when receiving server info. This caused servers for which no server info is received to be hidden when using the community filter. Now the community filter also works correctly for servers for which no ordinary server info is received, by initializing the community already when adding server entries to the list. Closes #7776. --- src/engine/client/serverbrowser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/engine/client/serverbrowser.cpp b/src/engine/client/serverbrowser.cpp index 22939fe1f..681b71e86 100644 --- a/src/engine/client/serverbrowser.cpp +++ b/src/engine/client/serverbrowser.cpp @@ -550,7 +550,9 @@ void CServerBrowser::SetInfo(CServerEntry *pEntry, const CServerInfo &Info) cons mem_copy(pEntry->m_Info.m_aAddresses, TmpInfo.m_aAddresses, sizeof(pEntry->m_Info.m_aAddresses)); pEntry->m_Info.m_NumAddresses = TmpInfo.m_NumAddresses; ServerBrowserFormatAddresses(pEntry->m_Info.m_aAddress, sizeof(pEntry->m_Info.m_aAddress), pEntry->m_Info.m_aAddresses, pEntry->m_Info.m_NumAddresses); - UpdateServerCommunity(&pEntry->m_Info); + str_copy(pEntry->m_Info.m_aCommunityId, TmpInfo.m_aCommunityId); + str_copy(pEntry->m_Info.m_aCommunityCountry, TmpInfo.m_aCommunityCountry); + str_copy(pEntry->m_Info.m_aCommunityType, TmpInfo.m_aCommunityType); UpdateServerRank(&pEntry->m_Info); if(pEntry->m_Info.m_ClientScoreKind == CServerInfo::CLIENT_SCORE_KIND_UNSPECIFIED) @@ -662,6 +664,7 @@ CServerBrowser::CServerEntry *CServerBrowser::Add(const NETADDR *pAddrs, int Num pEntry->m_Info.m_Latency = 999; pEntry->m_Info.m_HasRank = CServerInfo::RANK_UNAVAILABLE; ServerBrowserFormatAddresses(pEntry->m_Info.m_aAddress, sizeof(pEntry->m_Info.m_aAddress), pEntry->m_Info.m_aAddresses, pEntry->m_Info.m_NumAddresses); + UpdateServerCommunity(&pEntry->m_Info); str_copy(pEntry->m_Info.m_aName, pEntry->m_Info.m_aAddress, sizeof(pEntry->m_Info.m_aName)); // check if it's a favorite