From 8a113d39e4500871e99d143015595e8650a65eae Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Tue, 4 Oct 2011 13:28:04 +0200 Subject: [PATCH] a feature nobody hopefully ever needs --- qcsrc/menu/xonotic/serverlist.c | 15 ++++++++++++++- qcsrc/menu/xonotic/util.qc | 4 ++++ qcsrc/menu/xonotic/util.qh | 2 ++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/qcsrc/menu/xonotic/serverlist.c b/qcsrc/menu/xonotic/serverlist.c index e6b0d6232..aacad0e2f 100644 --- a/qcsrc/menu/xonotic/serverlist.c +++ b/qcsrc/menu/xonotic/serverlist.c @@ -238,7 +238,7 @@ void XonoticServerList_refreshServerList(entity me, float mode) } else */ { - float m, o; + float m, o, i, n; // moin moin string s, typestr, modstr; s = me.filterString; @@ -261,15 +261,22 @@ void XonoticServerList_refreshServerList(entity me, float mode) // ping: reject negative ping (no idea why this happens in the first place, engine bug) sethostcachemasknumber(++m, SLIST_FIELD_PING, 0, SLIST_TEST_GREATEREQUAL); + // show full button if(!me.filterShowFull) { sethostcachemasknumber(++m, SLIST_FIELD_FREESLOTS, 1, SLIST_TEST_GREATEREQUAL); // legacy sethostcachemaskstring(++m, SLIST_FIELD_QCSTATUS, ":S0:", SLIST_TEST_NOTCONTAIN); // g_maxplayers support } + + // show empty button if(!me.filterShowEmpty) sethostcachemasknumber(++m, SLIST_FIELD_NUMHUMANS, 1, SLIST_TEST_GREATEREQUAL); + + // gametype filtering if(typestr != "") sethostcachemaskstring(++m, SLIST_FIELD_QCSTATUS, strcat(typestr, ":"), SLIST_TEST_STARTSWITH); + + // mod filtering if(modstr != "") { if(substring(modstr, 0, 1) == "!") @@ -277,6 +284,12 @@ void XonoticServerList_refreshServerList(entity me, float mode) else sethostcachemaskstring(++m, SLIST_FIELD_MOD, resolvemod(modstr), SLIST_TEST_EQUAL); } + + // server banning + n = tokenizebyseparator(_Nex_ExtResponseSystem_BannedServers, " "); + for(i = 0; i < n; ++i) + sethostcachemaskstring(++m, SLIST_FIELD_CNAME, argv(i), SLIST_TEST_NOTEQUAL); + m = SLIST_MASK_OR - 1; if(s != "") { diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index 65a5d3e71..3484fd4aa 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -256,6 +256,7 @@ void setDependentWeird(entity e, float(entity) func) float _Nex_ExtResponseSystem_Queried; string _Nex_ExtResponseSystem_UpdateTo; string _Nex_ExtResponseSystem_UpdateToURL; +string _Nex_ExtResponseSystem_BannedServers; void URI_Get_Callback(float id, float status, string data) { @@ -325,6 +326,9 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data) } _Nex_ExtResponseSystem_UpdateTo = strzone(_Nex_ExtResponseSystem_UpdateTo); + + if(n >= 4) + _Nex_ExtResponseSystem_BannedServers = strzone(argv(3)); } } diff --git a/qcsrc/menu/xonotic/util.qh b/qcsrc/menu/xonotic/util.qh index 1720710d2..8e4b81144 100644 --- a/qcsrc/menu/xonotic/util.qh +++ b/qcsrc/menu/xonotic/util.qh @@ -47,3 +47,5 @@ void dialog_hudpanel_common_notoggle(entity me, string panelname); me.TR(me); \ me.TD(me, 1, 4, e = makeXonoticCheckBox(0, strzone(strcat("hud_panel_", panelname)), _("Enable panel"))); \ DIALOG_HUDPANEL_COMMON_NOTOGGLE() + +string _Nex_ExtResponseSystem_BannedServers; -- 2.39.2