4 * Main source module for the client program.
16 #include <sys/types.h>
19 #include <sys/ioctl.h>
27 #include "serv_info.h"
29 #include "routines2.h"
34 #include "client_chat.h"
35 #include "client_passwords.h"
36 #include "citadel_decls.h"
47 char march_name[ROOMNAMELEN];
52 #define IFEXPERT if (userflags&US_EXPERT)
53 #define IFNEXPERT if ((userflags&US_EXPERT)==0)
54 #define IFAIDE if (axlevel>=6)
55 #define IFNAIDE if (axlevel<6)
57 struct march *march = NULL;
59 /* globals associated with the client program */
60 char temp[PATH_MAX]; /* Name of general temp file */
61 char temp2[PATH_MAX]; /* Name of general temp file */
62 char tempdir[PATH_MAX]; /* Name of general temp dir */
63 char editor_path[256]; /* path to external editor */
64 char printcmd[256]; /* print command */
65 int editor_pid = (-1);
68 struct CtdlServInfo serv_info; /* Info on the server connected */
72 char room_name[ROOMNAMELEN];
73 char ugname[ROOMNAMELEN];
74 long uglsn; /* holds <u>ngoto info */
75 char is_mail = 0; /* nonzero when we're in a mail room */
76 char axlevel = 0; /* access level */
77 char is_room_aide = 0; /* boolean flag, 1 if room aide */
81 long usernum = 0L; /* user number */
83 long highest_msg_read; /* used for <A>bandon room cmd */
84 long maxmsgnum; /* used for <G>oto */
86 char have_xterm = 0; /* are we running on an xterm? */
93 char curr_floor = 0; /* number of current floor */
94 char floorlist[128][256]; /* names of floors */
95 char express_msgs = 0; /* express messages waiting! */
97 extern int rc_ansi_color; /* ansi color value from citadel.rc */
100 * here is our 'clean up gracefully and exit' routine
102 void logoff(int code)
104 if (editor_pid > 0) { /* kill the editor if it's running */
105 kill(editor_pid, SIGHUP);
107 /* shut down the server... but not if the logoff code is 3, because
108 * that means we're exiting because we already lost the server
114 * now clean up various things
121 /* Violently kill off any child processes if Citadel is
124 if (getppid() == 1) {
125 kill(0 - getpgrp(), SIGTERM);
127 kill(0 - getpgrp(), SIGKILL);
129 sttybbs(SB_RESTORE); /* return the old terminal settings */
130 exit(code); /* exit with the proper exit code */
136 * signal catching function for hangups...
138 void dropcarr(int signum)
146 * catch SIGCONT to reset terminal modes when were are put back into the
149 void catch_sigcont(int signum)
152 signal(SIGCONT, catch_sigcont);
157 /* general purpose routines */
159 void formout(char *name)
160 { /* display a file */
162 snprintf(cmd, sizeof cmd, "MESG %s", name);
166 printf("%s\n", &cmd[4]);
169 fmout(screenwidth, NULL,
170 ((userflags & US_PAGINATOR) ? 1 : 0),
175 void userlist(char *patn)
185 pprintf("%s\n", &buf[4]);
188 pprintf(" User Name Num L LastCall Calls Posts\n");
189 pprintf("------------------------- ----- - ---------- ----- -----\n");
190 while (serv_gets(buf), strcmp(buf, "000")) {
191 if (sigcaught == 0) {
193 if (pattern(fl, patn) >= 0) {
194 pprintf("%-25s ", fl);
195 pprintf("%5ld %d ", extract_long(buf, 2),
196 extract_int(buf, 1));
197 lc = extract_long(buf, 3);
198 tmbuf = (struct tm *) localtime(&lc);
199 pprintf("%02d/%02d/%04d ",
202 (tmbuf->tm_year + 1900));
203 pprintf("%5ld %5ld\n", extract_long(buf, 4), extract_long(buf, 5));
213 * grab assorted info about the user...
215 void load_user_info(char *params)
217 extract(fullname, params, 0);
218 axlevel = extract_int(params, 1);
219 timescalled = extract_int(params, 2);
220 posted = extract_int(params, 3);
221 userflags = extract_int(params, 4);
222 usernum = extract_long(params, 5);
227 * Remove a room from the march list. 'floornum' is ignored unless
228 * 'roomname' is set to _FLOOR_, in which case all rooms on the requested
229 * floor will be removed from the march list.
231 void remove_march(char *roomname, int floornum)
233 struct march *mptr, *mptr2;
238 if ((!strcasecmp(march->march_name, roomname))
239 || ((!strcasecmp(roomname, "_FLOOR_")) && (march->march_floor == floornum))) {
246 for (mptr = march; mptr != NULL; mptr = mptr->next) {
248 if ((!strcasecmp(mptr->march_name, roomname))
249 || ((!strcasecmp(roomname, "_FLOOR_"))
250 && (mptr->march_floor == floornum))) {
252 mptr2->next = mptr->next;
263 * Locate the room on the march list which we most want to go to. Each room
264 * is measured given a "weight" of preference based on various factors.
266 char *pop_march(int desired_floor)
268 static char TheRoom[ROOMNAMELEN];
270 int TheOrder = 32767;
273 struct march *mptr = NULL;
275 strcpy(TheRoom, "_BASEROOM_");
279 for (mptr = march; mptr != NULL; mptr = mptr->next) {
281 if ((strcasecmp(mptr->march_name, "_BASEROOM_")))
282 weight = weight + 10000;
283 if (mptr->march_floor == desired_floor)
284 weight = weight + 5000;
286 weight = weight + ((128 - (mptr->march_floor)) * 128);
287 weight = weight + (128 - (mptr->march_order));
289 if (weight > TheWeight) {
291 strcpy(TheRoom, mptr->march_name);
292 TheFloor = mptr->march_floor;
293 TheOrder = mptr->march_order;
301 * jump directly to a room
303 void dotgoto(char *towhere, int display_name)
305 char aaa[256], bbb[256], psearch[256];
308 static int oldmailcount = (-1);
309 int partial_match, best_match;
312 /* store ungoto information */
313 strcpy(ugname, room_name);
316 /* first try an exact match */
317 snprintf(aaa, sizeof aaa, "GOTO %s", towhere);
322 if (!strncmp(aaa, "54", 2)) {
323 newprompt("Enter room password: ", bbb, 9);
324 snprintf(aaa, sizeof aaa, "GOTO %s|%s", towhere, bbb);
330 if (!strncmp(aaa, "54", 2)) {
331 printf("Wrong password.\n");
335 * If a match is not found, try a partial match.
336 * Partial matches anywhere in the string carry a weight of 1,
337 * left-aligned matches carry a weight of 2. Pick the room that
338 * has the highest-weighted match.
346 while (serv_gets(aaa), strcmp(aaa, "000")) {
347 extract(psearch, aaa, 0);
349 if (pattern(psearch, towhere) >= 0) {
352 if (!strncasecmp(towhere, psearch, strlen(towhere))) {
355 if (partial_match > best_match) {
356 strcpy(bbb, psearch);
357 best_match = partial_match;
360 if (strlen(bbb) == 0) {
361 printf("No room '%s'.\n", towhere);
364 snprintf(aaa, sizeof aaa, "GOTO %s", bbb);
374 extract(room_name, &aaa[4], 0);
375 room_flags = extract_int(&aaa[4], 4);
376 from_floor = curr_floor;
377 curr_floor = extract_int(&aaa[4], 10);
379 remove_march(room_name, 0);
380 if (!strcasecmp(towhere, "_BASEROOM_"))
381 remove_march(towhere, 0);
382 if ((from_floor != curr_floor) && (display_name > 0) && (floor_mode == 1)) {
383 if (floorlist[(int) curr_floor][0] == 0)
385 printf("(Entering floor: %s)\n", &floorlist[(int) curr_floor][0]);
387 if (display_name == 1) {
389 printf("%s ", room_name);
393 if (display_name != 2) {
394 color(BRIGHT_YELLOW);
395 printf("%d ", extract_int(&aaa[4], 1));
398 color(BRIGHT_YELLOW);
399 printf("%d ", extract_int(&aaa[4], 2));
401 printf("messages.\n");
403 highest_msg_read = extract_int(&aaa[4], 6);
404 maxmsgnum = extract_int(&aaa[4], 5);
405 is_mail = (char) extract_int(&aaa[4], 7);
406 is_room_aide = (char) extract_int(&aaa[4], 8);
407 ls = extract_long(&aaa[4], 6);
409 /* read info file if necessary */
410 if (extract_int(&aaa[4], 3) > 0)
413 /* check for newly arrived mail if we can */
414 if (num_parms(&aaa[4]) >= 10) {
415 newmailcount = extract_int(&aaa[4], 9);
416 if ((oldmailcount >= 0) && (newmailcount > oldmailcount)) {
418 printf("*** You have new mail\n");
421 oldmailcount = newmailcount;
425 /* Goto next room having unread messages.
426 * We want to skip over rooms that the user has already been to, and take the
427 * user back to the lobby when done. The room we end up in is placed in
428 * newroom - which is set to 0 (the lobby) initially.
433 struct march *mptr, *mptr2;
434 char next_room[ROOMNAMELEN];
436 /* Check to see if the march-mode list is already allocated.
437 * If it is, pop the first room off the list and go there.
443 while (serv_gets(buf), strcmp(buf, "000")) {
444 mptr = (struct march *) malloc(sizeof(struct march));
446 extract(mptr->march_name, buf, 0);
447 mptr->march_floor = (char) (extract_int(buf, 2) & 0x7F);
448 mptr->march_order = (char) (extract_int(buf, 3) & 0x7F);
453 while (mptr2->next != NULL)
458 /* add _BASEROOM_ to the end of the march list, so the user will end up
459 * in the system base room (usually the Lobby>) at the end of the loop
461 mptr = (struct march *) malloc(sizeof(struct march));
463 strcpy(mptr->march_name, "_BASEROOM_");
468 while (mptr2->next != NULL)
473 * ...and remove the room we're currently in, so a <G>oto doesn't make us
474 * walk around in circles
476 remove_march(room_name, 0);
479 strcpy(next_room, pop_march(curr_floor));
481 strcpy(next_room, "_BASEROOM_");
483 remove_march(next_room, 0);
484 dotgoto(next_room, 1);
488 * forget all rooms on a given floor
490 void forget_all_rooms_on(int ffloor)
493 struct march *flist, *fptr;
495 printf("Forgetting all rooms on %s...\r", &floorlist[ffloor][0]);
497 snprintf(buf, sizeof buf, "LKRA %d", ffloor);
501 printf("%-72s\n", &buf[4]);
505 while (serv_gets(buf), strcmp(buf, "000")) {
506 fptr = (struct march *) malloc(sizeof(struct march));
509 extract(fptr->march_name, buf, 0);
511 while (flist != NULL) {
512 snprintf(buf, sizeof buf, "GOTO %s", flist->march_name);
523 printf("%-72s\r", "");
528 * routine called by gotofloor() to move to a new room on a new floor
530 void gf_toroom(char *towhere, int mode)
532 int floor_being_left;
534 floor_being_left = curr_floor;
536 if (mode == GF_GOTO) { /* <;G>oto mode */
540 if (mode == GF_SKIP) { /* <;S>kip mode */
542 remove_march("_FLOOR_", floor_being_left);
544 if (mode == GF_ZAP) { /* <;Z>ap mode */
546 remove_march("_FLOOR_", floor_being_left);
547 forget_all_rooms_on(floor_being_left);
555 void gotofloor(char *towhere, int mode)
559 char buf[256], targ[256];
561 if (floorlist[0][0] == 0)
564 for (a = 0; a < 128; ++a)
565 if (!strcasecmp(&floorlist[a][0], towhere))
569 for (a = 0; a < 128; ++a) {
570 if (!strncasecmp(&floorlist[a][0], towhere, strlen(towhere))) {
576 for (a = 0; a < 128; ++a)
577 if (pattern(towhere, &floorlist[a][0]) > 0)
581 printf("No floor '%s'.\n", towhere);
584 for (mptr = march; mptr != NULL; mptr = mptr->next) {
585 if ((mptr->march_floor) == tofloor)
586 gf_toroom(mptr->march_name, mode);
591 snprintf(buf, sizeof buf, "LKRA %d", tofloor);
595 while (serv_gets(buf), strcmp(buf, "000")) {
596 if ((extract_int(buf, 2) == tofloor) && (strlen(targ) == 0))
597 extract(targ, buf, 0);
599 if (strlen(targ) > 0) {
600 gf_toroom(targ, mode);
602 printf("There are no rooms on '%s'.\n", &floorlist[tofloor][0]);
608 * forget all rooms on current floor
610 void forget_this_floor(void)
613 if (curr_floor == 0) {
614 printf("Can't forget this floor.\n");
617 if (floorlist[0][0] == 0)
619 printf("Are you sure you want to forget all rooms on %s? ",
620 &floorlist[(int) curr_floor][0]);
624 gf_toroom("_BASEROOM_", GF_ZAP);
629 * Figure out the physical screen dimensions, if we can
631 void check_screen_dims(void)
635 unsigned short height; /* rows */
636 unsigned short width; /* columns */
637 unsigned short xpixels;
638 unsigned short ypixels; /* pixels */
641 if (have_xterm) { /* dynamically size screen if on an xterm */
642 if (ioctl(0, TIOCGWINSZ, &xwinsz) == 0) {
644 screenheight = (int) xwinsz.height;
646 screenwidth = (int) xwinsz.width;
654 * set floor mode depending on client, server, and user settings
656 void set_floor_mode(void)
658 if (serv_info.serv_ok_floors == 0) {
659 floor_mode = 0; /* Don't use floors if the server */
661 /* doesn't support them! */
663 if (rc_floor_mode == RC_NO) { /* never use floors */
666 if (rc_floor_mode == RC_YES) { /* always use floors */
669 if (rc_floor_mode == RC_DEFAULT) { /* user choice */
670 floor_mode = ((userflags & US_FLOORS) ? 1 : 0);
676 * Set or change the user's password
678 int set_password(void)
684 if (strlen(rc_password) > 0) {
685 strcpy(pass1, rc_password);
686 strcpy(pass2, rc_password);
688 IFNEXPERT formout("changepw");
689 newprompt("Enter a new password: ", pass1, -19);
690 newprompt("Enter it again to confirm: ", pass2, -19);
694 if (!strcasecmp(pass1, pass2)) {
695 snprintf(buf, sizeof buf, "SETP %s", pass1);
698 printf("%s\n", &buf[4]);
699 offer_to_remember_password(hostbuf, portbuf, fullname, pass1);
702 printf("*** They don't match... try again.\n");
710 * get info about the server we've connected to
712 void get_serv_info(char *supplied_hostname)
716 CtdlInternalGetServInfo(&serv_info);
718 /* be nice and identify ourself to the server */
719 snprintf(buf, sizeof buf, "IDEN %d|%d|%d|%s|",
720 SERVER_TYPE, 0, REV_LEVEL,
721 (server_is_local ? "local" : CITADEL));
723 /* Append a hostname */
724 if (supplied_hostname != NULL) {
725 strcat(buf, supplied_hostname);
728 locate_host(&buf[strlen(buf)]); /* append to the end */
732 serv_gets(buf); /* we don't care about the result code */
740 * Display list of users currently logged on to the server
742 void who_is_online(int longlist)
744 char buf[256], username[256], roomname[256], fromhost[256];
746 char actual_user[256], actual_room[256], actual_host[256];
747 char tbuf[256], clientsoft[256];
749 time_t idletime, idlehours, idlemins, idlesecs;
750 int last_session = (-1);
754 if (tbuf[0] == '2') {
755 timenow = extract_long(&tbuf[4], 0);
763 pprintf("FLG ### User Name Room From host\n");
765 pprintf("--- --- ------------------------- -------------------- ------------------------\n");
770 while (serv_gets(buf), strcmp(buf, "000")) {
771 extract(username, buf, 1);
772 extract(roomname, buf, 2);
773 extract(fromhost, buf, 3);
774 extract(clientsoft, buf, 4);
775 extract(flags, buf, 7);
777 idletime = timenow - extract_long(buf, 5);
778 idlehours = idletime / 3600;
779 idlemins = (idletime - (idlehours * 3600)) / 60;
780 idlesecs = (idletime - (idlehours * 3600) - (idlemins * 60));
782 if (idletime > 900) {
783 while (strlen(roomname) < 20) {
784 strcat(roomname, " ");
786 strcpy(&roomname[14], "[idle]");
791 extract(actual_user, buf, 8);
792 extract(actual_room, buf, 9);
793 extract(actual_host, buf, 10);
795 pprintf("\nFlags: %-3s Sess# %-3d Name: %-25s Room: %s\n",
796 flags, extract_int(buf, 0), username, roomname);
797 pprintf("from <%s> using <%s>, idle %ld:%02ld:%02ld\n",
798 fromhost, clientsoft,
799 (long) idlehours, (long) idlemins, (long) idlesecs);
801 if ( (strlen(actual_user)+strlen(actual_room)+strlen(actual_host)) > 0) {
803 if (strlen(actual_user)>0) pprintf("<%s> ", actual_user);
804 if (strlen(actual_room)>0) pprintf("in <%s> ", actual_room);
805 if (strlen(actual_host)>0) pprintf("from <%s> ", actual_host);
810 if (extract_int(buf, 0) == last_session) {
813 color(BRIGHT_MAGENTA);
814 pprintf("%-3s ", flags);
816 pprintf("%-3d ", extract_int(buf, 0));
818 last_session = extract_int(buf, 0);
820 pprintf("%-25s ", username);
821 color(BRIGHT_MAGENTA);
823 pprintf("%-20s ", roomname);
825 pprintf("%-24s\n", fromhost);
832 void enternew(char *desc, char *buf, int maxlen)
835 snprintf(bbb, sizeof bbb, "Enter in your new %s: ", desc);
836 newprompt(bbb, buf, maxlen);
841 int shift(int argc, char **argv, int start, int count) {
844 for (i=start; i<(argc-count); ++i) {
845 argv[i] = argv[i+count];
854 int main(int argc, char **argv)
857 char aaa[100], bbb[100];/* general purpose variables */
858 char argbuf[32]; /* command line buf */
859 char nonce[NONCE_SIZE];
860 char *telnet_client_host = NULL;
861 char *sptr, *sptr2; /* USed to extract the nonce */
862 char hexstring[MD5_HEXSTRING_SIZE];
863 volatile int termn8 = 0;
864 int stored_password = 0;
867 sttybbs(SB_SAVE); /* Store the old terminal parameters */
868 load_command_set(); /* parse the citadel.rc file */
869 sttybbs(SB_NO_INTR); /* Install the new ones */
870 signal(SIGHUP, dropcarr); /* Cleanup gracefully if carrier is dropped */
871 signal(SIGTERM, dropcarr); /* Cleanup gracefully if terminated */
872 signal(SIGCONT, catch_sigcont); /* Catch SIGCONT so we can reset terminal */
875 * Handle command line options as if we were called like /bin/login
876 * (i.e. from in.telnetd)
878 for (a=0; a<argc; ++a) {
879 if ((argc > a+1) && (!strcmp(argv[a], "-h")) ) {
880 telnet_client_host = argv[a+1];
881 argc = shift(argc, argv, a, 2);
883 if (!strcmp(argv[a], "-p")) {
884 argc = shift(argc, argv, a, 1);
888 printf("Attaching to server... \r");
890 attach_to_server(argc, argv, hostbuf, portbuf);
896 printf("%s\n", &aaa[4]);
900 /* If there is a [nonce] at the end, put the nonce in <nonce>, else nonce
904 if ((sptr = strchr(aaa, '<')) == NULL)
910 if ((sptr2 = strchr(sptr, '>')) == NULL)
918 strncpy(nonce, sptr, NONCE_SIZE);
922 get_serv_info(telnet_client_host);
928 printf("%-23s\n%s\n%s\n", serv_info.serv_software, serv_info.serv_humannode,
929 serv_info.serv_bbs_city);
930 screenwidth = 80; /* default screen dimensions */
933 printf(" pause next stop\n");
934 printf(" ctrl-s ctrl-o ctrl-c\n\n");
935 formout("hello"); /* print the opening greeting */
938 GSTA: /* See if we have a username and password on disk */
939 if (rc_remember_passwords) {
940 get_stored_password(hostbuf, portbuf, fullname, password);
941 if (strlen(fullname) > 0) {
942 snprintf(aaa, sizeof(aaa)-1, "USER %s", fullname);
947 sprintf(aaa, "PAS2 %s", make_apop_string(password, nonce, hexstring));
949 else /* Else no APOP */
951 snprintf(aaa, sizeof(aaa)-1, "PASS %s", password);
957 load_user_info(&aaa[4]);
962 set_stored_password(hostbuf, portbuf, "", "");
970 if (strlen(rc_username) > 0) {
971 strcpy(fullname, rc_username);
973 newprompt("Enter your name: ", fullname, 29);
976 if (!strcasecmp(fullname, "new")) { /* just in case */
977 printf("Please enter the name you wish to log in with.\n");
980 (!strcasecmp(fullname, "bbs"))
981 || (!strcasecmp(fullname, "new"))
982 || (strlen(fullname) == 0));
984 if (!strcasecmp(fullname, "off")) {
988 /* sign on to the server */
989 snprintf(aaa, sizeof aaa, "USER %s", fullname);
995 /* password authentication */
996 if (strlen(rc_password) > 0) {
997 strcpy(password, rc_password);
999 newprompt("\rPlease enter your password: ", password, -19);
1005 sprintf(aaa, "PAS2 %s", make_apop_string(password, nonce, hexstring));
1007 else /* Else no APOP */
1009 snprintf(aaa, sizeof(aaa)-1, "PASS %s", password);
1014 if (aaa[0] == '2') {
1015 load_user_info(&aaa[4]);
1016 offer_to_remember_password(hostbuf, portbuf,
1017 fullname, password);
1020 printf("<< wrong password >>\n");
1021 if (strlen(rc_password) > 0)
1025 NEWUSR: if (strlen(rc_password) == 0) {
1026 printf("No record. Enter as new user? ");
1030 snprintf(aaa, sizeof aaa, "NEWU %s", fullname);
1033 if (aaa[0] != '2') {
1034 printf("%s\n", aaa);
1037 load_user_info(&aaa[4]);
1039 while (set_password() != 0);;
1045 /* Switch color support on or off if we're in user mode */
1046 if (rc_ansi_color == 3) {
1047 if (userflags & US_COLOR)
1053 printf("%s\nAccess level: %d (%s)\nUser #%ld / Call #%d\n",
1054 fullname, axlevel, axdefs[(int) axlevel],
1055 usernum, timescalled);
1059 if (aaa[0] == '2') {
1060 b = extract_int(&aaa[4], 0);
1064 printf("*** You have a new private message in Mail>\n");
1066 printf("*** You have %d new private messages in Mail>\n", b);
1069 if ((axlevel >= 6) && (extract_int(&aaa[4], 2) > 0)) {
1070 printf("*** Users need validation\n");
1072 if (extract_int(&aaa[4], 1) > 0) {
1073 printf("*** Please register.\n");
1074 formout("register");
1078 /* Make up some temporary filenames for use in various parts of the
1079 * program. Don't mess with these once they've been set, because we
1080 * will be unlinking them later on in the program and we don't
1081 * want to delete something that we didn't create. */
1082 snprintf(temp, sizeof temp, tmpnam(NULL));
1083 snprintf(temp2, sizeof temp2, tmpnam(NULL));
1084 snprintf(tempdir, sizeof tempdir, tmpnam(NULL));
1086 /* Get screen dimensions. First we go to a default of 80x24. Then
1087 * we try to get the user's actual screen dimensions off the server.
1088 * However, if we're running on an xterm, all this stuff is
1089 * irrelevant because we're going to dynamically size the screen
1090 * during the session.
1096 if (aaa[0] == '2') {
1097 screenwidth = extract_int(&aaa[4], 0);
1098 screenheight = extract_int(&aaa[4], 1);
1100 if (getenv("TERM") != NULL)
1101 if (!strcmp(getenv("TERM"), "xterm")) {
1105 check_screen_dims();
1111 /* Enter the lobby */
1112 dotgoto("_BASEROOM_", 1);
1114 /* Main loop for the system... user is logged in. */
1123 /* MAIN COMMAND LOOP */
1125 mcmd = getcmd(argbuf); /* Get keyboard command */
1128 check_screen_dims(); /* if xterm, get screen size */
1146 newprompt("What do you want your username to be? ", aaa, 32);
1147 snprintf(bbb, sizeof bbb, "ENT0 2|0|0|0|%s", aaa);
1150 if (strncmp("200", aaa, 3))
1151 printf("\n%s\n", aaa);
1165 dotgoto("_MAIL_", 1);
1182 readmsgs(0, (-1), 0);
1185 readmsgs(2, (-1), 0);
1188 readmsgs(3, 1, atoi(argbuf));
1275 cli_image_upload("_userpic_");
1278 cli_image_upload("_roompic_");
1282 snprintf(aaa, sizeof aaa, "_floorpic_|%d", curr_floor);
1283 cli_image_upload(aaa);
1287 enternew("roomname", aaa, 20);
1288 snprintf(bbb, sizeof bbb, "RCHG %s", aaa);
1291 if (strncmp("200", aaa, 3))
1292 printf("\n%s\n", aaa);
1295 enternew("hostname", aaa, 25);
1296 snprintf(bbb, sizeof bbb, "HCHG %s", aaa);
1299 if (strncmp("200", aaa, 3))
1300 printf("\n%s\n", aaa);
1303 enternew("username", aaa, 32);
1304 snprintf(bbb, sizeof bbb, "UCHG %s", aaa);
1307 if (strncmp("200", aaa, 3))
1308 printf("\n%s\n", aaa);
1318 display_help(argbuf);
1322 formout("register");
1327 printf("Are you sure (y/n)? ");
1336 printf("All users will be disconnected! "
1337 "Really terminate the server? ");
1341 printf("%s\n", &aaa[4]);
1350 printf("Do you really want to schedule a "
1351 "server shutdown? ");
1353 serv_puts("SCDN 1");
1356 if (atoi(&aaa[4])) {
1358 "The Citadel server will terminate when all users are logged off.\n"
1363 "The Citadel server will not terminate.\n"
1378 if (server_is_local) {
1379 sttybbs(SB_RESTORE);
1380 snprintf(aaa, sizeof aaa, "USERNAME=\042%s\042; export USERNAME;"
1381 "exec ./subsystem %ld %d %d", fullname,
1382 usernum, screenwidth, axlevel);
1384 sttybbs(SB_NO_INTR);
1386 printf("*** Can't run doors when server is not local.\n");
1399 do_system_configuration();
1403 do_internet_configuration();
1407 check_message_base();
1429 gotofloor(argbuf, GF_GOTO);
1433 gotofloor(argbuf, GF_SKIP);
1437 forget_this_floor();
1465 knrooms(floor_mode);
1475 misc_server_cmd(argbuf);
1479 edit_system_message(argbuf);
1504 } while (termn8 == 0);
1506 TERMN8:printf("%s logged out.\n", fullname);
1507 while (march != NULL)
1508 remove_march(march->march_name, 0);
1510 printf("\n\nType 'off' to hang up, or next user...\n");
1511 snprintf(aaa, sizeof aaa, "LOUT");
1514 if ((mcmd == 29) || (mcmd == 15)) {