]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/common.qc
Two new aliases for fbskins, plus fix whitespace in commands/common.qc
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / common.qc
index 2493f0a850dc07e926809fc04dd15eb24f08df9c..6d9980630a9865b21cef6757fb9d34834bae703f 100644 (file)
@@ -487,10 +487,10 @@ void CommonCommand_who(float request, entity caller, float argc)
                case CMD_REQUEST_COMMAND:
                {
                        float total_listed_players, tmp_hours, tmp_minutes, tmp_seconds, is_bot;
-                       entity tmp_player;                      
+                       entity tmp_player;
                        
                        float privacy = (caller && autocvar_sv_status_privacy);
-                       string separator = strcat((argv(1) ? argv(1) : " "), "^7");
+                       string separator = strreplace("%", " ", 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), ":"));
@@ -501,8 +501,21 @@ 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);
+                               if(is_bot)
+                               {
+                                       tmp_netaddress = "null/botclient";
+                                       tmp_crypto_idfp = "null/botclient";
+                               }
+                               else if(privacy)
+                               {
+                                       tmp_netaddress = "hidden";
+                                       tmp_crypto_idfp = "hidden";
+                               }
+                               else
+                               {
+                                       tmp_netaddress = tmp_player.netaddress;
+                                       tmp_crypto_idfp = tmp_player.crypto_idfp;
+                               }
                                
                                tmp_hours = tmp_minutes = tmp_seconds = 0;
                                
@@ -513,15 +526,15 @@ void CommonCommand_who(float request, entity caller, float argc)
                                if(tmp_minutes) { tmp_seconds -= (tmp_minutes * 60); }                          
                                if(tmp_hours) { tmp_minutes -= (tmp_hours * 60); }
 
-                               print_to(caller, sprintf(strreplace(" ", separator, " %-4s %-20.20s %-5d %-3d %-9s %-16s %s "), 
-                                       strcat("#", ftos(num_for_edict(tmp_player))), 
+                               print_to(caller, sprintf(strreplace(" ", separator, " #%-3d %-20.20s %-5d %-3d %-9s %-16s %s "), 
+                                       num_for_edict(tmp_player), 
                                        tmp_player.netname,
                                        tmp_player.ping, 
                                        tmp_player.ping_packetloss, 
                                        sprintf("%02d:%02d:%02d", tmp_hours, tmp_minutes, tmp_seconds),
-                                       (is_bot ? "null/botclient" : tmp_netaddress),
-                                       (is_bot ? "null/botclient" : tmp_crypto_idfp)));
-                                       
+                                       tmp_netaddress,
+                                       tmp_crypto_idfp));
+                               
                                ++total_listed_players;
                        }