Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added strict game type filter

  • Loading branch information...
commit 9fb36fd8027f547845df8af67c785456e67492dc 1 parent 8017344
@heinrich5991 heinrich5991 authored oy committed
View
5 src/engine/client/serverbrowser.cpp
@@ -196,7 +196,9 @@ void CServerBrowser::Filter()
Filtered = 1;
else if(g_Config.m_BrFilterServerAddress[0] && !str_find_nocase(m_ppServerlist[i]->m_Info.m_aAddress, g_Config.m_BrFilterServerAddress))
Filtered = 1;
- else if(g_Config.m_BrFilterGametype[0] && !str_find_nocase(m_ppServerlist[i]->m_Info.m_aGameType, g_Config.m_BrFilterGametype))
+ else if(g_Config.m_BrFilterGametypeStrict && g_Config.m_BrFilterGametype[0] && str_comp_nocase(m_ppServerlist[i]->m_Info.m_aGameType, g_Config.m_BrFilterGametype))
+ Filtered = 1;
+ else if(!g_Config.m_BrFilterGametypeStrict && g_Config.m_BrFilterGametype[0] && !str_find_nocase(m_ppServerlist[i]->m_Info.m_aGameType, g_Config.m_BrFilterGametype))
Filtered = 1;
else if(g_Config.m_BrFilterString[0] != 0)
{
@@ -252,6 +254,7 @@ int CServerBrowser::SortHash() const
i |= g_Config.m_BrFilterCompatversion<<10;
i |= g_Config.m_BrFilterPure<<11;
i |= g_Config.m_BrFilterPureMap<<12;
+ i |= g_Config.m_BrFilterGametypeStrict<<13;
i |= g_Config.m_BrFilterPing<<18;
return i;
}
View
1  src/engine/shared/config_variables.h
@@ -35,6 +35,7 @@ MACRO_CONFIG_INT(BrFilterFriends, br_filter_friends, 0, 0, 1, CFGFLAG_SAVE|CFGFL
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")
+MACRO_CONFIG_INT(BrFilterGametypeStrict, br_filter_gametype_strict, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Strict gametype filter")
MACRO_CONFIG_STR(BrFilterServerAddress, br_filter_serveraddress, 128, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server address to filter")
MACRO_CONFIG_INT(BrFilterPure, br_filter_pure, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out non-standard servers in browser")
MACRO_CONFIG_INT(BrFilterPureMap, br_filter_pure_map, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Filter out non-standard maps in browser")
View
5 src/game/client/components/menus_browser.cpp
@@ -481,6 +481,10 @@ void CMenus::RenderServerbrowserFilters(CUIRect View)
ServerFilter.HSplitTop(20.0f, &Button, &ServerFilter);
if (DoButton_CheckBox((char *)&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((char *)&g_Config.m_BrFilterGametypeStrict, Localize("Strict gametype filter"), g_Config.m_BrFilterGametypeStrict, &Button))
+ g_Config.m_BrFilterGametypeStrict ^= 1;
ServerFilter.HSplitTop(5.0f, 0, &ServerFilter);
@@ -530,6 +534,7 @@ void CMenus::RenderServerbrowserFilters(CUIRect View)
g_Config.m_BrFilterString[0] = 0;
g_Config.m_BrFilterPure = 1;
g_Config.m_BrFilterPureMap = 1;
+ g_Config.m_BrFilterGametypeStrict = 0;
Client()->ServerBrowserUpdate();
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.