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"
44 char march_name[ROOMNAMELEN];
49 #define IFEXPERT if (userflags&US_EXPERT)
50 #define IFNEXPERT if ((userflags&US_EXPERT)==0)
51 #define IFAIDE if (axlevel>=6)
52 #define IFNAIDE if (axlevel<6)
54 struct march *march = NULL;
56 /* globals associated with the client program */
57 char temp[PATH_MAX]; /* Name of general temp file */
58 char temp2[PATH_MAX]; /* Name of general temp file */
59 char tempdir[PATH_MAX]; /* Name of general temp dir */
60 char editor_path[256]; /* path to external editor */
61 char printcmd[256]; /* print command */
62 int editor_pid = (-1);
65 struct CtdlServInfo serv_info; /* Info on the server connected */
69 char room_name[ROOMNAMELEN];
70 char ugname[ROOMNAMELEN];
71 long uglsn; /* holds <u>ngoto info */
72 char is_mail = 0; /* nonzero when we're in a mail room */
73 char axlevel = 0; /* access level */
74 char is_room_aide = 0; /* boolean flag, 1 if room aide */
78 long usernum = 0L; /* user number */
80 long highest_msg_read; /* used for <A>bandon room cmd */
81 long maxmsgnum; /* used for <G>oto */
83 char have_xterm = 0; /* are we running on an xterm? */
90 char curr_floor = 0; /* number of current floor */
91 char floorlist[128][256]; /* names of floors */
92 char express_msgs = 0; /* express messages waiting! */
95 * here is our 'clean up gracefully and exit' routine
99 if (editor_pid > 0) { /* kill the editor if it's running */
100 kill(editor_pid, SIGHUP);
102 /* shut down the server... but not if the logoff code is 3, because
103 * that means we're exiting because we already lost the server
109 * now clean up various things
116 /* Violently kill off any child processes if Citadel is
119 if (getppid() == 1) {
120 kill(0 - getpgrp(), SIGTERM);
122 kill(0 - getpgrp(), SIGKILL);
124 sttybbs(SB_RESTORE); /* return the old terminal settings */
125 exit(code); /* exit with the proper exit code */
131 * signal catching function for hangups...
133 void dropcarr(int signum)
141 * catch SIGCONT to reset terminal modes when were are put back into the
144 void catch_sigcont(int signum)
147 signal(SIGCONT, catch_sigcont);
152 /* general purpose routines */
154 void formout(char *name)
155 { /* display a file */
157 snprintf(cmd, sizeof cmd, "MESG %s", name);
161 printf("%s\n", &cmd[4]);
164 fmout(screenwidth, NULL,
165 ((userflags & US_PAGINATOR) ? 1 : 0),
170 void userlist(char *patn)
180 pprintf("%s\n", &buf[4]);
183 pprintf(" User Name Num L LastCall Calls Posts\n");
184 pprintf("------------------------- ----- - ---------- ----- -----\n");
185 while (serv_gets(buf), strcmp(buf, "000")) {
186 if (sigcaught == 0) {
188 if (pattern(fl, patn) >= 0) {
189 pprintf("%-25s ", fl);
190 pprintf("%5ld %d ", extract_long(buf, 2),
191 extract_int(buf, 1));
192 lc = extract_long(buf, 3);
193 tmbuf = (struct tm *) localtime(&lc);
194 pprintf("%02d/%02d/%04d ",
197 (tmbuf->tm_year + 1900));
198 pprintf("%5ld %5ld\n", extract_long(buf, 4), extract_long(buf, 5));
208 * grab assorted info about the user...
210 void load_user_info(char *params)
212 extract(fullname, params, 0);
213 axlevel = extract_int(params, 1);
214 timescalled = extract_int(params, 2);
215 posted = extract_int(params, 3);
216 userflags = extract_int(params, 4);
217 usernum = extract_long(params, 5);
222 * Remove a room from the march list. 'floornum' is ignored unless
223 * 'roomname' is set to _FLOOR_, in which case all rooms on the requested
224 * floor will be removed from the march list.
226 void remove_march(char *roomname, int floornum)
228 struct march *mptr, *mptr2;
233 if ((!strcasecmp(march->march_name, roomname))
234 || ((!strcasecmp(roomname, "_FLOOR_")) && (march->march_floor == floornum))) {
241 for (mptr = march; mptr != NULL; mptr = mptr->next) {
243 if ((!strcasecmp(mptr->march_name, roomname))
244 || ((!strcasecmp(roomname, "_FLOOR_"))
245 && (mptr->march_floor == floornum))) {
247 mptr2->next = mptr->next;
258 * Locate the room on the march list which we most want to go to. Each room
259 * is measured given a "weight" of preference based on various factors.
261 char *pop_march(int desired_floor)
263 static char TheRoom[ROOMNAMELEN];
265 int TheOrder = 32767;
268 struct march *mptr = NULL;
270 strcpy(TheRoom, "_BASEROOM_");
274 for (mptr = march; mptr != NULL; mptr = mptr->next) {
276 if ((strcasecmp(mptr->march_name, "_BASEROOM_")))
277 weight = weight + 10000;
278 if (mptr->march_floor == desired_floor)
279 weight = weight + 5000;
281 weight = weight + ((128 - (mptr->march_floor)) * 128);
282 weight = weight + (128 - (mptr->march_order));
284 if (weight > TheWeight) {
286 strcpy(TheRoom, mptr->march_name);
287 TheFloor = mptr->march_floor;
288 TheOrder = mptr->march_order;
296 * jump directly to a room
298 void dotgoto(char *towhere, int display_name)
300 char aaa[256], bbb[256], psearch[256];
303 static int oldmailcount = (-1);
304 int partial_match, best_match;
307 /* store ungoto information */
308 strcpy(ugname, room_name);
311 /* first try an exact match */
312 snprintf(aaa, sizeof aaa, "GOTO %s", towhere);
317 if (!strncmp(aaa, "54", 2)) {
318 newprompt("Enter room password: ", bbb, 9);
319 snprintf(aaa, sizeof aaa, "GOTO %s|%s", towhere, bbb);
325 if (!strncmp(aaa, "54", 2)) {
326 printf("Wrong password.\n");
330 * If a match is not found, try a partial match.
331 * Partial matches anywhere in the string carry a weight of 1,
332 * left-aligned matches carry a weight of 2. Pick the room that
333 * has the highest-weighted match.
341 while (serv_gets(aaa), strcmp(aaa, "000")) {
342 extract(psearch, aaa, 0);
344 if (pattern(psearch, towhere) >= 0) {
347 if (!strncasecmp(towhere, psearch, strlen(towhere))) {
350 if (partial_match > best_match) {
351 strcpy(bbb, psearch);
352 best_match = partial_match;
355 if (strlen(bbb) == 0) {
356 printf("No room '%s'.\n", towhere);
359 snprintf(aaa, sizeof aaa, "GOTO %s", bbb);
369 extract(room_name, &aaa[4], 0);
370 room_flags = extract_int(&aaa[4], 4);
371 from_floor = curr_floor;
372 curr_floor = extract_int(&aaa[4], 10);
374 remove_march(room_name, 0);
375 if (!strcasecmp(towhere, "_BASEROOM_"))
376 remove_march(towhere, 0);
377 if ((from_floor != curr_floor) && (display_name > 0) && (floor_mode == 1)) {
378 if (floorlist[(int) curr_floor][0] == 0)
380 printf("(Entering floor: %s)\n", &floorlist[(int) curr_floor][0]);
382 if (display_name == 1) {
384 printf("%s ", room_name);
388 if (display_name != 2) {
389 color(BRIGHT_YELLOW);
390 printf("%d ", extract_int(&aaa[4], 1));
393 color(BRIGHT_YELLOW);
394 printf("%d ", extract_int(&aaa[4], 2));
396 printf("messages.\n");
398 highest_msg_read = extract_int(&aaa[4], 6);
399 maxmsgnum = extract_int(&aaa[4], 5);
400 is_mail = (char) extract_int(&aaa[4], 7);
401 is_room_aide = (char) extract_int(&aaa[4], 8);
402 ls = extract_long(&aaa[4], 6);
404 /* read info file if necessary */
405 if (extract_int(&aaa[4], 3) > 0)
408 /* check for newly arrived mail if we can */
409 if (num_parms(&aaa[4]) >= 10) {
410 newmailcount = extract_int(&aaa[4], 9);
411 if ((oldmailcount >= 0) && (newmailcount > oldmailcount)) {
413 printf("*** You have new mail\n");
416 oldmailcount = newmailcount;
420 /* Goto next room having unread messages.
421 * We want to skip over rooms that the user has already been to, and take the
422 * user back to the lobby when done. The room we end up in is placed in
423 * newroom - which is set to 0 (the lobby) initially.
428 struct march *mptr, *mptr2;
429 char next_room[ROOMNAMELEN];
431 /* Check to see if the march-mode list is already allocated.
432 * If it is, pop the first room off the list and go there.
438 while (serv_gets(buf), strcmp(buf, "000")) {
439 mptr = (struct march *) malloc(sizeof(struct march));
441 extract(mptr->march_name, buf, 0);
442 mptr->march_floor = (char) (extract_int(buf, 2) & 0x7F);
443 mptr->march_order = (char) (extract_int(buf, 3) & 0x7F);
448 while (mptr2->next != NULL)
453 /* add _BASEROOM_ to the end of the march list, so the user will end up
454 * in the system base room (usually the Lobby>) at the end of the loop
456 mptr = (struct march *) malloc(sizeof(struct march));
458 strcpy(mptr->march_name, "_BASEROOM_");
463 while (mptr2->next != NULL)
468 * ...and remove the room we're currently in, so a <G>oto doesn't make us
469 * walk around in circles
471 remove_march(room_name, 0);
474 strcpy(next_room, pop_march(curr_floor));
476 strcpy(next_room, "_BASEROOM_");
478 remove_march(next_room, 0);
479 dotgoto(next_room, 1);
483 * forget all rooms on a given floor
485 void forget_all_rooms_on(int ffloor)
488 struct march *flist, *fptr;
490 printf("Forgetting all rooms on %s...\r", &floorlist[ffloor][0]);
492 snprintf(buf, sizeof buf, "LKRA %d", ffloor);
496 printf("%-72s\n", &buf[4]);
500 while (serv_gets(buf), strcmp(buf, "000")) {
501 fptr = (struct march *) malloc(sizeof(struct march));
504 extract(fptr->march_name, buf, 0);
506 while (flist != NULL) {
507 snprintf(buf, sizeof buf, "GOTO %s", flist->march_name);
518 printf("%-72s\r", "");
523 * routine called by gotofloor() to move to a new room on a new floor
525 void gf_toroom(char *towhere, int mode)
527 int floor_being_left;
529 floor_being_left = curr_floor;
531 if (mode == GF_GOTO) { /* <;G>oto mode */
535 if (mode == GF_SKIP) { /* <;S>kip mode */
537 remove_march("_FLOOR_", floor_being_left);
539 if (mode == GF_ZAP) { /* <;Z>ap mode */
541 remove_march("_FLOOR_", floor_being_left);
542 forget_all_rooms_on(floor_being_left);
550 void gotofloor(char *towhere, int mode)
554 char buf[256], targ[256];
556 if (floorlist[0][0] == 0)
559 for (a = 0; a < 128; ++a)
560 if (!strcasecmp(&floorlist[a][0], towhere))
564 for (a = 0; a < 128; ++a) {
565 if (!strncasecmp(&floorlist[a][0], towhere, strlen(towhere))) {
571 for (a = 0; a < 128; ++a)
572 if (pattern(towhere, &floorlist[a][0]) > 0)
576 printf("No floor '%s'.\n", towhere);
579 for (mptr = march; mptr != NULL; mptr = mptr->next) {
580 if ((mptr->march_floor) == tofloor)
581 gf_toroom(mptr->march_name, mode);
586 snprintf(buf, sizeof buf, "LKRA %d", tofloor);
590 while (serv_gets(buf), strcmp(buf, "000")) {
591 if ((extract_int(buf, 2) == tofloor) && (strlen(targ) == 0))
592 extract(targ, buf, 0);
594 if (strlen(targ) > 0) {
595 gf_toroom(targ, mode);
597 printf("There are no rooms on '%s'.\n", &floorlist[tofloor][0]);
603 * forget all rooms on current floor
605 void forget_this_floor(void)
608 if (curr_floor == 0) {
609 printf("Can't forget this floor.\n");
612 if (floorlist[0][0] == 0)
614 printf("Are you sure you want to forget all rooms on %s? ",
615 &floorlist[(int) curr_floor][0]);
619 gf_toroom("_BASEROOM_", GF_ZAP);
624 * Figure out the physical screen dimensions, if we can
626 void check_screen_dims(void)
630 unsigned short height; /* rows */
631 unsigned short width; /* columns */
632 unsigned short xpixels;
633 unsigned short ypixels; /* pixels */
636 if (have_xterm) { /* dynamically size screen if on an xterm */
637 if (ioctl(0, TIOCGWINSZ, &xwinsz) == 0) {
639 screenheight = (int) xwinsz.height;
641 screenwidth = (int) xwinsz.width;
649 * set floor mode depending on client, server, and user settings
651 void set_floor_mode(void)
653 if (serv_info.serv_ok_floors == 0) {
654 floor_mode = 0; /* Don't use floors if the server */
656 /* doesn't support them! */
658 if (rc_floor_mode == RC_NO) { /* never use floors */
661 if (rc_floor_mode == RC_YES) { /* always use floors */
664 if (rc_floor_mode == RC_DEFAULT) { /* user choice */
665 floor_mode = ((userflags & US_FLOORS) ? 1 : 0);
671 * Set or change the user's password
673 int set_password(void)
679 if (strlen(rc_password) > 0) {
680 strcpy(pass1, rc_password);
681 strcpy(pass2, rc_password);
683 IFNEXPERT formout("changepw");
684 newprompt("Enter a new password: ", pass1, -19);
685 newprompt("Enter it again to confirm: ", pass2, -19);
689 if (!strcasecmp(pass1, pass2)) {
690 snprintf(buf, sizeof buf, "SETP %s", pass1);
693 printf("%s\n", &buf[4]);
694 offer_to_remember_password(hostbuf, portbuf, fullname, pass1);
697 printf("*** They don't match... try again.\n");
705 * get info about the server we've connected to
707 void get_serv_info(void)
711 CtdlInternalGetServInfo(&serv_info);
713 /* be nice and identify ourself to the server */
714 snprintf(buf, sizeof buf, "IDEN %d|%d|%d|%s|",
715 SERVER_TYPE, 0, REV_LEVEL,
716 (server_is_local ? "local" : CITADEL));
717 locate_host(&buf[strlen(buf)]); /* append to the end */
719 serv_gets(buf); /* we don't care about the result code */
727 * Display list of users currently logged on to the server
729 void who_is_online(int longlist)
731 char buf[256], username[256], roomname[256], fromhost[256];
733 char actual_user[256], actual_room[256], actual_host[256];
734 char tbuf[256], clientsoft[256];
736 time_t idletime, idlehours, idlemins, idlesecs;
737 int last_session = (-1);
741 if (tbuf[0] == '2') {
742 timenow = extract_long(&tbuf[4], 0);
750 pprintf("FLG ### User Name Room From host\n");
752 pprintf("--- --- ------------------------- -------------------- ------------------------\n");
757 while (serv_gets(buf), strcmp(buf, "000")) {
758 extract(username, buf, 1);
759 extract(roomname, buf, 2);
760 extract(fromhost, buf, 3);
761 extract(clientsoft, buf, 4);
762 extract(flags, buf, 7);
764 idletime = timenow - extract_long(buf, 5);
765 idlehours = idletime / 3600;
766 idlemins = (idletime - (idlehours * 3600)) / 60;
767 idlesecs = (idletime - (idlehours * 3600) - (idlemins * 60));
769 if (idletime > 900) {
770 while (strlen(roomname) < 20) {
771 strcat(roomname, " ");
773 strcpy(&roomname[14], "[idle]");
778 extract(actual_user, buf, 8);
779 extract(actual_room, buf, 9);
780 extract(actual_host, buf, 10);
782 pprintf("\nFlags: %-3s Sess# %-3d Name: %-25s Room: %s\n",
783 flags, extract_int(buf, 0), username, roomname);
784 pprintf("from <%s> using <%s>, idle %ld:%02ld:%02ld\n",
785 fromhost, clientsoft,
786 (long) idlehours, (long) idlemins, (long) idlesecs);
788 if ( (strlen(actual_user)+strlen(actual_room)+strlen(actual_host)) > 0) {
790 if (strlen(actual_user)>0) pprintf("<%s> ", actual_user);
791 if (strlen(actual_room)>0) pprintf("in <%s> ", actual_room);
792 if (strlen(actual_host)>0) pprintf("from <%s> ", actual_host);
797 if (extract_int(buf, 0) == last_session) {
800 color(BRIGHT_MAGENTA);
801 pprintf("%-3s ", flags);
803 pprintf("%-3d ", extract_int(buf, 0));
805 last_session = extract_int(buf, 0);
807 pprintf("%-25s ", username);
808 color(BRIGHT_MAGENTA);
810 pprintf("%-20s ", roomname);
812 pprintf("%-24s\n", fromhost);
819 void enternew(char *desc, char *buf, int maxlen)
822 snprintf(bbb, sizeof bbb, "Enter in your new %s: ", desc);
823 newprompt(bbb, buf, maxlen);
827 void proto_sync_check(void) { /* FIXME ... remove this */
832 safestrncpy(token, tmpnam(NULL), sizeof token);
833 sprintf(buf, "ECHO %s", token);
836 if (!strcmp(&buf[4], token)) return;
838 fp = fopen(token, "w");
839 fprintf(fp, "%s\n", buf);
840 while (serv_gets(buf), strcmp(&buf[4], token)) {
841 fprintf(fp, "%s\n", buf);
845 sprintf(buf, "gedit %s &", token);
858 int main(int argc, char **argv)
861 char aaa[100], bbb[100];/* general purpose variables */
862 char argbuf[32]; /* command line buf */
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 */
874 printf("Attaching to server... \r");
876 attach_to_server(argc, argv, hostbuf, portbuf);
882 printf("%s\n", &aaa[4]);
891 printf("%-23s\n%s\n%s\n", serv_info.serv_software, serv_info.serv_humannode,
892 serv_info.serv_bbs_city);
893 screenwidth = 80; /* default screen dimensions */
896 printf(" pause next stop\n");
897 printf(" ctrl-s ctrl-o ctrl-c\n\n");
898 formout("hello"); /* print the opening greeting */
901 GSTA: /* See if we have a username and password on disk */
902 if (rc_remember_passwords) {
903 get_stored_password(hostbuf, portbuf, fullname, password);
904 if (strlen(fullname) > 0) {
905 sprintf(aaa, "USER %s", fullname);
908 sprintf(aaa, "PASS %s", password);
912 load_user_info(&aaa[4]);
917 set_stored_password(hostbuf, portbuf, "", "");
925 if (strlen(rc_username) > 0) {
926 strcpy(fullname, rc_username);
928 newprompt("Enter your name: ", fullname, 29);
931 if (!strcasecmp(fullname, "new")) { /* just in case */
932 printf("Please enter the name you wish to log in with.\n");
935 (!strcasecmp(fullname, "bbs"))
936 || (!strcasecmp(fullname, "new"))
937 || (strlen(fullname) == 0));
939 if (!strcasecmp(fullname, "off")) {
943 /* sign on to the server */
944 snprintf(aaa, sizeof aaa, "USER %s", fullname);
950 /* password authentication */
951 if (strlen(rc_password) > 0) {
952 strcpy(password, rc_password);
954 newprompt("\rPlease enter your password: ", password, -19);
957 snprintf(aaa, sizeof aaa, "PASS %s", password);
961 load_user_info(&aaa[4]);
962 offer_to_remember_password(hostbuf, portbuf,
966 printf("<< wrong password >>\n");
967 if (strlen(rc_password) > 0)
971 NEWUSR: if (strlen(rc_password) == 0) {
972 printf("No record. Enter as new user? ");
976 snprintf(aaa, sizeof aaa, "NEWU %s", fullname);
983 load_user_info(&aaa[4]);
985 while (set_password() != 0);;
991 PWOK: printf("%s\nAccess level: %d (%s)\nUser #%ld / Call #%d\n",
992 fullname, axlevel, axdefs[(int) axlevel],
993 usernum, timescalled);
998 b = extract_int(&aaa[4], 0);
1002 printf("*** You have a new private message in Mail>\n");
1004 printf("*** You have %d new private messages in Mail>\n", b);
1007 if ((axlevel >= 6) && (extract_int(&aaa[4], 2) > 0)) {
1008 printf("*** Users need validation\n");
1010 if (extract_int(&aaa[4], 1) > 0) {
1011 printf("*** Please register.\n");
1012 formout("register");
1016 /* Make up some temporary filenames for use in various parts of the
1017 * program. Don't mess with these once they've been set, because we
1018 * will be unlinking them later on in the program and we don't
1019 * want to delete something that we didn't create. */
1020 snprintf(temp, sizeof temp, tmpnam(NULL));
1021 snprintf(temp2, sizeof temp2, tmpnam(NULL));
1022 snprintf(tempdir, sizeof tempdir, tmpnam(NULL));
1024 /* Get screen dimensions. First we go to a default of 80x24. Then
1025 * we try to get the user's actual screen dimensions off the server.
1026 * However, if we're running on an xterm, all this stuff is
1027 * irrelevant because we're going to dynamically size the screen
1028 * during the session.
1034 if (aaa[0] == '2') {
1035 screenwidth = extract_int(&aaa[4], 0);
1036 screenheight = extract_int(&aaa[4], 1);
1038 if (getenv("TERM") != NULL)
1039 if (!strcmp(getenv("TERM"), "xterm")) {
1043 check_screen_dims();
1049 /* Enter the lobby */
1050 dotgoto("_BASEROOM_", 1);
1052 /* Main loop for the system... user is logged in. */
1061 do { /* MAIN LOOP OF PROGRAM */
1063 proto_sync_check(); /* FIXME ... remove this */
1064 mcmd = getcmd(argbuf);
1067 check_screen_dims();
1085 newprompt("What do you want your username to be? ", aaa, 32);
1086 snprintf(bbb, sizeof bbb, "ENT0 2|0|0|0|%s", aaa);
1089 if (strncmp("200", aaa, 3))
1090 printf("\n%s\n", aaa);
1104 dotgoto("_MAIL_", 1);
1121 readmsgs(0, (-1), 0);
1124 readmsgs(2, (-1), 0);
1127 readmsgs(3, 1, atoi(argbuf));
1214 cli_image_upload("_userpic_");
1217 cli_image_upload("_roompic_");
1221 snprintf(aaa, sizeof aaa, "_floorpic_|%d", curr_floor);
1222 cli_image_upload(aaa);
1226 enternew("roomname", aaa, 20);
1227 snprintf(bbb, sizeof bbb, "RCHG %s", aaa);
1230 if (strncmp("200", aaa, 3))
1231 printf("\n%s\n", aaa);
1234 enternew("hostname", aaa, 25);
1235 snprintf(bbb, sizeof bbb, "HCHG %s", aaa);
1238 if (strncmp("200", aaa, 3))
1239 printf("\n%s\n", aaa);
1242 enternew("username", aaa, 32);
1243 snprintf(bbb, sizeof bbb, "UCHG %s", aaa);
1246 if (strncmp("200", aaa, 3))
1247 printf("\n%s\n", aaa);
1257 display_help(argbuf);
1261 formout("register");
1266 printf("Are you sure (y/n)? ");
1275 printf("All users will be disconnected! "
1276 "Really terminate the server? ");
1280 printf("%s\n", &aaa[4]);
1289 printf("Do you really want to schedule a "
1290 "server shutdown? ");
1292 serv_puts("SCDN 1");
1295 if (atoi(&aaa[4])) {
1297 "The Citadel server will terminate when all users are logged off.\n"
1302 "The Citadel server will not terminate.\n"
1317 if (server_is_local) {
1318 sttybbs(SB_RESTORE);
1319 snprintf(aaa, sizeof aaa, "USERNAME=\042%s\042; export USERNAME;"
1320 "exec ./subsystem %ld %d %d", fullname,
1321 usernum, screenwidth, axlevel);
1323 sttybbs(SB_NO_INTR);
1325 printf("*** Can't run doors when server is not local.\n");
1338 do_system_configuration();
1342 do_internet_configuration();
1346 check_message_base();
1368 gotofloor(argbuf, GF_GOTO);
1372 gotofloor(argbuf, GF_SKIP);
1376 forget_this_floor();
1404 knrooms(floor_mode);
1414 misc_server_cmd(argbuf);
1418 edit_system_message(argbuf);
1443 } while (termn8 == 0);
1445 TERMN8:printf("%s logged out.\n", fullname);
1446 while (march != NULL)
1447 remove_march(march->march_name, 0);
1449 printf("\n\nType 'off' to hang up, or next user...\n");
1450 snprintf(aaa, sizeof aaa, "LOUT");
1453 if ((mcmd == 29) || (mcmd == 15)) {