]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
working on "who" command
authorSamual <samual@xonotic.org>
Wed, 21 Dec 2011 17:25:08 +0000 (12:25 -0500)
committerSamual <samual@xonotic.org>
Wed, 21 Dec 2011 17:25:08 +0000 (12:25 -0500)
qcsrc/server/command/common.qc

index ff6b49c2e8296eb252e13af217b6c0928b74c338..2493f0a850dc07e926809fc04dd15eb24f08df9c 100644 (file)
@@ -489,8 +489,9 @@ void CommonCommand_who(float request, entity caller, float argc)
                        float total_listed_players, tmp_hours, tmp_minutes, tmp_seconds, is_bot;
                        entity tmp_player;                      
                        
-                       string separator = strcat((argv(1) ? argv(1) : " "), "^7");
                        float privacy = (caller && autocvar_sv_status_privacy);
+                       string separator = strcat((argv(1) ? argv(1) : " "), "^7");
+                       string tmp_netaddress, tmp_crypto_idfp;
                        
                        print_to(caller, strcat("List of client information", (privacy ? " (some data is hidden for privacy)" : string_null), ":"));
                        print_to(caller, sprintf(strreplace(" ", separator, " %-4s %-20s %-5s %-3s %-9s %-16s %s "), 
@@ -500,6 +501,9 @@ void CommonCommand_who(float request, entity caller, float argc)
                        {
                                is_bot = (clienttype(tmp_player) == CLIENTTYPE_BOT);
                                
+                               tmp_netaddress = (privacy ? "hidden" : tmp_player.netaddress);
+                               tmp_crypto_idfp = (privacy ? "hidden" : tmp_player.crypto_idfp);
+                               
                                tmp_hours = tmp_minutes = tmp_seconds = 0;
                                
                                tmp_seconds = floor(time - tmp_player.jointime);
@@ -515,8 +519,8 @@ void CommonCommand_who(float request, entity caller, float argc)
                                        tmp_player.ping, 
                                        tmp_player.ping_packetloss, 
                                        sprintf("%02d:%02d:%02d", tmp_hours, tmp_minutes, tmp_seconds),
-                                       (is_bot ? "null/botclient" : (privacy ? "hidden" : tmp_player.netaddress)),
-                                       (is_bot ? "null/botclient" : (privacy ? "hidden" : tmp_player.crypto_idfp))));
+                                       (is_bot ? "null/botclient" : tmp_netaddress),
+                                       (is_bot ? "null/botclient" : tmp_crypto_idfp)));
                                        
                                ++total_listed_players;
                        }