]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Explicitly mark bots with a tag in the server list to reduce activity spoofing
authorMario <mario.mario@y7mail.com>
Thu, 28 Nov 2024 03:43:09 +0000 (03:43 +0000)
committerDr. Jaska <drjaska83@gmail.com>
Thu, 28 Nov 2024 03:43:09 +0000 (03:43 +0000)
qcsrc/menu/xonotic/playerlist.qc

index f9f3edd679a3881cd1cf8a9c5352e66f30316373..10ab8f69c03561ede0baeff7a42003a117cc34cf 100644 (file)
@@ -88,7 +88,9 @@ void XonoticPlayerList_drawListBoxItem(entity me, int i, vector absSize, bool is
 
        string name = me.getPlayerList(me, i, PLAYERPARM_NAME);
        string score = me.getPlayerList(me, i, PLAYERPARM_SCORE);
+       string ping = me.getPlayerList(me, i, PLAYERPARM_PING);
 
+       bool is_bot = (ping == "0");
        bool is_spectator = false;
        if(substring(score, strlen(score) - 10, 10) == ":spectator")
        {
@@ -105,6 +107,9 @@ void XonoticPlayerList_drawListBoxItem(entity me, int i, vector absSize, bool is
                        is_spectator = true;
        }
 
+       if(is_bot)
+               name = cons("^9(bot)^7", name);
+
        if (is_spectator)
        {
                score = _("spectator");