MCPcopy Create free account
hub / github.com/ddnet/ddnet / UpdateServerCommunity

Method UpdateServerCommunity

src/engine/client/serverbrowser.cpp:1659–1675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1657}
1658
1659void CServerBrowser::UpdateServerCommunity(CServerInfo *pInfo) const
1660{
1661 for(int AddressIndex = 0; AddressIndex < pInfo->m_NumAddresses; AddressIndex++)
1662 {
1663 const auto Community = m_CommunityServersByAddr.find(CommunityAddressKey(pInfo->m_aAddresses[AddressIndex]));
1664 if(Community != m_CommunityServersByAddr.end())
1665 {
1666 str_copy(pInfo->m_aCommunityId, Community->second.CommunityId());
1667 str_copy(pInfo->m_aCommunityCountry, Community->second.CountryName());
1668 str_copy(pInfo->m_aCommunityType, Community->second.TypeName());
1669 return;
1670 }
1671 }
1672 str_copy(pInfo->m_aCommunityId, COMMUNITY_NONE);
1673 str_copy(pInfo->m_aCommunityCountry, COMMUNITY_COUNTRY_NONE);
1674 str_copy(pInfo->m_aCommunityType, COMMUNITY_TYPE_NONE);
1675}
1676
1677void CServerBrowser::UpdateServerRank(CServerInfo *pInfo) const
1678{

Callers 1

ProcessServerInfoMethod · 0.80

Calls 6

CommunityAddressKeyFunction · 0.85
endMethod · 0.80
CountryNameMethod · 0.80
str_copyFunction · 0.50
CommunityIdMethod · 0.45
TypeNameMethod · 0.45

Tested by

no test coverage detected