]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
a feature nobody hopefully ever needs
authorRudolf Polzer <divVerent@xonotic.org>
Tue, 4 Oct 2011 11:28:04 +0000 (13:28 +0200)
committerRudolf Polzer <divVerent@xonotic.org>
Tue, 4 Oct 2011 11:28:04 +0000 (13:28 +0200)
qcsrc/menu/xonotic/serverlist.c
qcsrc/menu/xonotic/util.qc
qcsrc/menu/xonotic/util.qh

index e6b0d6232f5ef0760f430e19c6e244dbf2f22081..aacad0e2f65e9eb6fcb79287dfdc15e220294537 100644 (file)
@@ -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 != "")
                {
index 65a5d3e71a60fad721cddb189660e0489891c6ab..3484fd4aa8e96667a0fac7edab260ca0be2fc0ca 100644 (file)
@@ -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));
        }
 }
 
index 1720710d2c44de09db39110aa93b9a84578ebb5d..8e4b81144e6b1ef58a1d5c27137e4b29ff61376d 100644 (file)
@@ -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;