Merge pull request #2929 from def-/pr-pure

Remove pure server filters, add space for Countries/Types
This commit is contained in:
Dennis Felsing 2020-09-26 21:36:19 +02:00 committed by GitHub
commit a5cf31040b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 52 deletions

View file

@ -193,31 +193,6 @@ void CServerBrowser::Filter()
Filtered = 1;
else if(g_Config.m_BrFilterPw && m_ppServerlist[i]->m_Info.m_Flags&SERVER_FLAG_PASSWORD)
Filtered = 1;
else if(g_Config.m_BrFilterPure &&
(str_comp(m_ppServerlist[i]->m_Info.m_aGameType, "DM") != 0 &&
str_comp(m_ppServerlist[i]->m_Info.m_aGameType, "TDM") != 0 &&
str_comp(m_ppServerlist[i]->m_Info.m_aGameType, "CTF") != 0))
{
Filtered = 1;
}
else if(g_Config.m_BrFilterPureMap &&
!(str_comp(m_ppServerlist[i]->m_Info.m_aMap, "dm1") == 0 ||
str_comp(m_ppServerlist[i]->m_Info.m_aMap, "dm2") == 0 ||
str_comp(m_ppServerlist[i]->m_Info.m_aMap, "dm6") == 0 ||
str_comp(m_ppServerlist[i]->m_Info.m_aMap, "dm7") == 0 ||
str_comp(m_ppServerlist[i]->m_Info.m_aMap, "dm8") == 0 ||
str_comp(m_ppServerlist[i]->m_Info.m_aMap, "dm9") == 0 ||
str_comp(m_ppServerlist[i]->m_Info.m_aMap, "ctf1") == 0 ||
str_comp(m_ppServerlist[i]->m_Info.m_aMap, "ctf2") == 0 ||
str_comp(m_ppServerlist[i]->m_Info.m_aMap, "ctf3") == 0 ||
str_comp(m_ppServerlist[i]->m_Info.m_aMap, "ctf4") == 0 ||
str_comp(m_ppServerlist[i]->m_Info.m_aMap, "ctf5") == 0 ||
str_comp(m_ppServerlist[i]->m_Info.m_aMap, "ctf6") == 0 ||
str_comp(m_ppServerlist[i]->m_Info.m_aMap, "ctf7") == 0)
)
{
Filtered = 1;
}
else if(g_Config.m_BrFilterPing && g_Config.m_BrFilterPing < m_ppServerlist[i]->m_Info.m_Latency)
Filtered = 1;
else if(g_Config.m_BrFilterCompatversion && str_comp_num(m_ppServerlist[i]->m_Info.m_aVersion, m_aNetVersion, 3) != 0)
@ -328,20 +303,18 @@ void CServerBrowser::Filter()
int CServerBrowser::SortHash() const
{
int i = g_Config.m_BrSort&0xff;
i |= g_Config.m_BrFilterEmpty<<4;
i |= g_Config.m_BrFilterFull<<5;
i |= g_Config.m_BrFilterSpectators<<6;
i |= g_Config.m_BrFilterFriends<<7;
i |= g_Config.m_BrFilterPw<<8;
i |= g_Config.m_BrSortOrder<<9;
i |= g_Config.m_BrFilterCompatversion<<11;
i |= g_Config.m_BrFilterPure<<12;
i |= g_Config.m_BrFilterPureMap<<13;
i |= g_Config.m_BrFilterGametypeStrict<<14;
i |= g_Config.m_BrFilterUnfinishedMap<<15;
i |= g_Config.m_BrFilterCountry<<16;
i |= g_Config.m_BrFilterConnectingPlayers<<17;
int i = g_Config.m_BrSort & 0xff;
i |= g_Config.m_BrFilterEmpty << 4;
i |= g_Config.m_BrFilterFull << 5;
i |= g_Config.m_BrFilterSpectators << 6;
i |= g_Config.m_BrFilterFriends << 7;
i |= g_Config.m_BrFilterPw << 8;
i |= g_Config.m_BrSortOrder << 9;
i |= g_Config.m_BrFilterCompatversion << 11;
i |= g_Config.m_BrFilterGametypeStrict << 12;
i |= g_Config.m_BrFilterUnfinishedMap << 13;
i |= g_Config.m_BrFilterCountry << 14;
i |= g_Config.m_BrFilterConnectingPlayers << 15;
return i;
}

View file

@ -52,8 +52,6 @@ MACRO_CONFIG_STR(BrFilterGametype, br_filter_gametype, 128, "", CFGFLAG_SAVE | C
MACRO_CONFIG_INT(BrFilterGametypeStrict, br_filter_gametype_strict, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Strict gametype filter")
MACRO_CONFIG_INT(BrFilterConnectingPlayers, br_filter_connecting_players, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Filter connecting players")
MACRO_CONFIG_STR(BrFilterServerAddress, br_filter_serveraddress, 128, "", CFGFLAG_SAVE | CFGFLAG_CLIENT, "Server address to filter")
MACRO_CONFIG_INT(BrFilterPure, br_filter_pure, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Filter out non-standard servers in browser")
MACRO_CONFIG_INT(BrFilterPureMap, br_filter_pure_map, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Filter out non-standard maps in browser")
MACRO_CONFIG_INT(BrFilterCompatversion, br_filter_compatversion, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Filter out non-compatible servers in browser")
MACRO_CONFIG_INT(BrFilterUnfinishedMap, br_filter_unfinished_map, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Show only servers with unfinished maps")

View file

@ -695,14 +695,6 @@ void CMenus::RenderServerbrowserFilters(CUIRect View)
if(DoButton_CheckBox(&g_Config.m_BrFilterCompatversion, Localize("Compatible version"), g_Config.m_BrFilterCompatversion, &Button))
g_Config.m_BrFilterCompatversion ^= 1;
ServerFilter.HSplitTop(20.0f, &Button, &ServerFilter);
if(DoButton_CheckBox(&g_Config.m_BrFilterPure, Localize("Standard gametype"), g_Config.m_BrFilterPure, &Button))
g_Config.m_BrFilterPure ^= 1;
ServerFilter.HSplitTop(20.0f, &Button, &ServerFilter);
if(DoButton_CheckBox(&g_Config.m_BrFilterPureMap, Localize("Standard map"), g_Config.m_BrFilterPureMap, &Button))
g_Config.m_BrFilterPureMap ^= 1;
ServerFilter.HSplitTop(20.0f, &Button, &ServerFilter);
if(DoButton_CheckBox(&g_Config.m_BrFilterGametypeStrict, Localize("Strict gametype filter"), g_Config.m_BrFilterGametypeStrict, &Button))
g_Config.m_BrFilterGametypeStrict ^= 1;
@ -806,7 +798,7 @@ void CMenus::RenderServerbrowserFilters(CUIRect View)
// add more space
ServerFilter.HSplitTop(5.0f, 0, &ServerFilter);
ServerFilter.HSplitTop(20.0f, &Button, &ServerFilter);
ServerFilter.HSplitTop(80.0f, &ServerFilter, 0);
ServerFilter.HSplitTop(140.0f, &ServerFilter, 0);
RenderTools()->DrawUIRect(&ServerFilter, ms_ColorTabbarActive, CUI::CORNER_B, 10.0f);
@ -997,8 +989,6 @@ void CMenus::RenderServerbrowserFilters(CUIRect View)
g_Config.m_BrFilterConnectingPlayers = 1;
g_Config.m_BrFilterUnfinishedMap = 0;
g_Config.m_BrFilterServerAddress[0] = 0;
g_Config.m_BrFilterPure = 0;
g_Config.m_BrFilterPureMap = 0;
g_Config.m_BrFilterCompatversion = 0;
g_Config.m_BrFilterExcludeCountries[0] = 0;
g_Config.m_BrFilterExcludeTypes[0] = 0;