make the "show friends"-filter just list servers with friends on them

This commit is contained in:
oy 2011-03-31 21:22:12 +02:00
parent 98eaaf2e23
commit b3ae1a088e
2 changed files with 4 additions and 5 deletions

View file

@ -143,21 +143,20 @@ void CServerBrowser::Filter()
for(i = 0; i < m_NumServers; i++)
{
int Filtered = 0;
bool FoundFriend = false;
if(g_Config.m_BrFilterFriends)
{
Filtered = 1;
for(p = 0; p < m_ppServerlist[i]->m_Info.m_NumClients; p++)
{
if(m_pFriends->IsFriend(m_ppServerlist[i]->m_Info.m_aClients[p].m_aName, m_ppServerlist[i]->m_Info.m_aClients[p].m_aClan))
{
FoundFriend = true;
Filtered = 0;
break;
}
}
}
if(!FoundFriend)
else
{
if(g_Config.m_BrFilterEmpty && ((g_Config.m_BrFilterSpectators && m_ppServerlist[i]->m_Info.m_NumPlayers == 0) || m_ppServerlist[i]->m_Info.m_NumClients == 0))
Filtered = 1;

View file

@ -31,7 +31,7 @@ MACRO_CONFIG_STR(BrFilterString, br_filter_string, 25, "", CFGFLAG_SAVE|CFGFLAG_
MACRO_CONFIG_INT(BrFilterFull, br_filter_full, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out full server in browser")
MACRO_CONFIG_INT(BrFilterEmpty, br_filter_empty, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out empty server in browser")
MACRO_CONFIG_INT(BrFilterSpectators, br_filter_spectators, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out spectators from player numbers")
MACRO_CONFIG_INT(BrFilterFriends, br_filter_friends, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Do not filter out servers with friends")
MACRO_CONFIG_INT(BrFilterFriends, br_filter_friends, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out servers with no friends")
MACRO_CONFIG_INT(BrFilterPw, br_filter_pw, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out password protected servers in browser")
MACRO_CONFIG_INT(BrFilterPing, br_filter_ping, 999, 0, 999, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Ping to filter by in the server browser")
MACRO_CONFIG_STR(BrFilterGametype, br_filter_gametype, 128, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Game types to filter")