Added context state to output of RWHO command.
authorArt Cancro <ajc@citadel.org>
Tue, 6 Feb 2024 03:41:52 +0000 (17:41 -1000)
committerArt Cancro <ajc@citadel.org>
Tue, 6 Feb 2024 03:41:52 +0000 (17:41 -1000)
Hopefully the next time some douchebag from out of town floods our
site with stuck-open MSA sessions, we can figure out why it isn't
unbinding or timing out.

citadel/server/modules/rwho/serv_rwho.c
citadel/utils/loadtest.c

index 96e25e7877afd70cd2a1858730d2a7fec6ff2f55..d028c9b3f4e2b4f5832ce0deb8e3aaac7ca65b5a 100644 (file)
@@ -63,7 +63,6 @@ void GenerateRoomDisplay(char *real_room, CitContext *viewed, CitContext *viewer
 void cmd_rwho(char *argbuf) {
        struct CitContext *nptr;
        int nContexts, i;
-       int spoofed = 0;
        int aide;
        char room[ROOMNAMELEN];
        char flags[5];
@@ -83,7 +82,6 @@ void cmd_rwho(char *argbuf) {
        
        for (i=0; i<nContexts; i++)  {
                flags[0] = '\0';
-               spoofed = 0;
                
                if (!aide && nptr[i].state == CON_SYS)
                        continue;
@@ -100,17 +98,12 @@ void cmd_rwho(char *argbuf) {
                   
                GenerateRoomDisplay(room, &nptr[i], CC);
 
-                if ((aide) && (spoofed)) {
-                       strcat(flags, "+");
-               }
-               
                if ((nptr[i].cs_flags & CS_STEALTH) && (aide)) {
                        strcat(flags, "-");
                }
                
                if (((nptr[i].cs_flags&CS_STEALTH)==0) || (aide)) {
-
-                       cprintf("%d|%s|%s|%s|%s|%ld|%s|%s|",
+                       cprintf("%d|%s|%s|%s|%s|%ld|%s|%s||||%d|%d\n",
                                nptr[i].cs_pid,
                                (nptr[i].logged_in ? nptr[i].curr_user : NLI),
                                room,
@@ -118,14 +111,10 @@ void cmd_rwho(char *argbuf) {
                                nptr[i].cs_clientname,
                                (long)(nptr[i].lastidle),
                                nptr[i].lastcmdname,
-                               flags
+                               flags,
+                               nptr[i].logged_in,
+                               nptr[i].state
                        );
-
-                       cprintf("|");   // no spoofed user names anymore
-                       cprintf("|");   // no spoofed room names anymore
-                       cprintf("|");   // no spoofed host names anymore
-       
-                       cprintf("%d\n", nptr[i].logged_in);
                }
        }
        
index 6ed6e979f453cfcbcce035da77adb18851e00ce3..8d4e41b2f6e26708edabeffa7a3c4f65bf6055ae 100644 (file)
@@ -314,7 +314,7 @@ void *loadtest(void *pointer_to_thread_id) {
                printf("\033[%d;%dH\033[32m%8ld\033[0m", row, col, ++ops);
                ++ops_completed;                // this is declared "volatile" so we don't need to lock it
                if (thread_id == 0) {
-                       printf("\033[2;55H\033[44m\033[33m\033[1m%d ops/sec \033[0m", (ops_completed / (time(NULL) - time_started)));
+                       printf("\033[2;55H\033[44m\033[33m\033[1m%ld ops/sec \033[0m", (ops_completed / (time(NULL) - time_started)));
                }
                fflush(stdout);
        }