* Make stealth mode available to all users
authorArt Cancro <ajc@citadel.org>
Sat, 4 May 2002 02:43:36 +0000 (02:43 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 4 May 2002 02:43:36 +0000 (02:43 +0000)
* <.W>holist <S>tealth mode command in the client

citadel/citadel.c
citadel/citadel.rc
citadel/client_chat.c
citadel/client_chat.h
citadel/help/summary
citadel/serv_chat.c
citadel/serv_rwho.c

index 09961d8ebbf31df8eb48ef653693096a90f1bc43..cf8e5b5cedeed8348c7e8e890742acb9c9c4456b 100644 (file)
@@ -1612,6 +1612,10 @@ PWOK:
                                quiet_mode();
                                break;
 
+                       case 93:
+                               stealth_mode();
+                               break;
+
                        case 50:
                                enter_config(2);
                                break;
index 6f0fb0a44da75dd2c1a0a77f7afadc307f131378..6721f8a5d0ccc5e05ac1356ff4524d9f23c92a7d 100644 (file)
@@ -301,6 +301,7 @@ cmd=79,0,&.,&Wholist,&Long
 cmd=75,0,&.,&Wholist,&Roomname
 cmd=76,0,&.,&Wholist,&Hostname
 cmd=91,0,&.,&Wholist,&Active
+cmd=93,0,&.,&Wholist,&Stealth mode
 
 #
 # Command 69 allows the user to enter a server command directly.  It is
index 7c4b02c56055ee8e50eaf2c5175c1745cffaf7b1..b5d867fe41753a6b139e1bfc851f93684ea93f46 100644 (file)
@@ -314,3 +314,35 @@ void quiet_mode(void)
                scr_printf("Quiet mode disabled (other users may page you)\n");
        }
 }
+
+
+void stealth_mode(void)
+{
+       int qstate;
+       char buf[SIZ];
+
+       serv_puts("STEL 2");
+       serv_gets(buf);
+       if (buf[0] != '2') {
+               scr_printf("%s\n", &buf[4]);
+               return;
+       }
+       qstate = atoi(&buf[4]);
+       if (qstate == 0)
+               qstate = 1;
+       else
+               qstate = 0;
+       snprintf(buf, sizeof buf, "STEL %d", qstate);
+       serv_puts(buf);
+       serv_gets(buf);
+       if (buf[0] != '2') {
+               scr_printf("%s\n", &buf[4]);
+               return;
+       }
+       qstate = atoi(&buf[4]);
+       if (qstate) {
+               scr_printf("Stealth mode enabled (you are invisible)\n");
+       } else {
+               scr_printf("Stealth mode disabled (you are listed as online)\n");
+       }
+}
index 927cd4f40924b4d2ddc8b483d2969612be2ce1a6..2c427692a85d440d7bdce944f8bd16a85e0ab3a2 100644 (file)
@@ -2,5 +2,6 @@
 void chatmode(void);
 void page_user(void);
 void quiet_mode(void);
+void stealth_mode(void);
 
 extern char last_paged[];
index 94ff37a79a13096e3f7a037e9eeb04a72f36a3ab..d951fbd7facd49e7a7a886664e6019396a031425 100644 (file)
@@ -76,6 +76,8 @@ commands are available:
                                   actual name of the room you're in)
  <.> <W>holist <H>ostname         Masquerade your host name
  <.> <E>nter <U>sername           Masquerade your user name (Aides only)
+ <.> <W>holist <S>tealth mode     Enter/exit "stealth mode" (when in stealth
+                                  mode you are invisible on the wholist)
  
  
  Floor commands (if using floor mode)
index 99732cf553bea5c0945bd067add43c3fb8c9b8ba..d8cbc80a64723eac9ec5f751cb6d1fbc2a65ac2a 100644 (file)
@@ -702,18 +702,16 @@ void cmd_dexp(char *argbuf)
 {
        int new_state;
 
-       if (!CC->logged_in) {
-               cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
-               return;
-               }
+       if (CtdlAccessCheck(ac_logged_in)) return;
 
        new_state = extract_int(argbuf, 0);
        if ((new_state == 0) || (new_state == 1)) {
                CC->disable_exp = new_state;
-               }
-       cprintf("%d %d\n", CIT_OK, CC->disable_exp);
        }
 
+       cprintf("%d %d\n", CIT_OK, CC->disable_exp);
+}
+
 
 /*
  * Request client termination
index bdfec24fdf433b16a549083363f2e668b9abb36f..0da0e3f423283f2a7bea8ffcaf5d0551b306a95e 100644 (file)
@@ -232,22 +232,20 @@ void cmd_stel(char *cmdbuf)
        int requested_mode;
 
        requested_mode = extract_int(cmdbuf,0);
-       if (requested_mode !=0) requested_mode = 1;
 
-       if (CtdlAccessCheck(ac_aide)) return;
-
-       if (CC->cs_flags & CS_STEALTH) {
-               if (requested_mode == 0)
-                       CC->cs_flags = CC->cs_flags-CS_STEALTH;
-               }
-       else {
-               if (requested_mode == 1)
-                       CC->cs_flags = CC->cs_flags|CS_STEALTH;
-               }
+       if (CtdlAccessCheck(ac_logged_in)) return;
 
-       cprintf("%d Ok\n",CIT_OK);
+       if (requested_mode == 1) {
+               CC->cs_flags = CC->cs_flags | CS_STEALTH;
+       }
+       if (requested_mode == 0) {
+               CC->cs_flags = CC->cs_flags & ~CS_STEALTH;
        }
 
+       cprintf("%d %d\n", CIT_OK,
+               ((CC->cs_flags & CS_STEALTH) ? 1 : 0) );
+}
+