4 * citadel.c - Main source file.
16 #include <sys/types.h>
19 #include <sys/ioctl.h>
26 #include "serv_info.h"
28 #include "routines2.h"
34 #include "client_chat.h"
35 #include "citadel_decls.h"
43 #define IFEXPERT if (userflags&US_EXPERT)
44 #define IFNEXPERT if ((userflags&US_EXPERT)==0)
45 #define IFAIDE if (axlevel>=6)
46 #define IFNAIDE if (axlevel<6)
48 struct march *march = NULL;
50 /* globals associated with the client program */
51 char temp[16]; /* Name of general temp file */
52 char temp2[16]; /* Name of general temp file */
53 char tempdir[16]; /* Name of general temp dir */
54 char editor_path[256]; /* path to external editor */
55 char printcmd[256]; /* print command */
56 int editor_pid = (-1);
59 struct CtdlServInfo serv_info; /* Info on the server connected */
65 long uglsn; /* holds <u>ngoto info */
66 char is_mail = 0; /* nonzero when we're in a mail room */
67 char axlevel = 0; /* access level */
68 char is_room_aide = 0; /* boolean flag, 1 if room aide */
72 long usernum = 0L; /* user number */
74 long highest_msg_read; /* used for <A>bandon room cmd */
75 long maxmsgnum; /* used for <G>oto */
77 char have_xterm = 0; /* are we running on an xterm? */
82 char curr_floor = 0; /* number of current floor */
83 char floorlist[128][256]; /* names of floors */
84 char express_msgs = 0; /* express messages waiting! */
85 char last_paged[32]="";
88 * here is our 'clean up gracefully and exit' routine
92 if (editor_pid>0) { /* kill the editor if it's running */
93 kill(editor_pid,SIGHUP);
96 /* shut down the server... but not if the logoff code is 3, because
97 * that means we're exiting because we already lost the server
99 if (code!=3) serv_puts("QUIT");
102 * now clean up various things
109 /* Violently kill off any child processes if Citadel is
113 kill(0-getpgrp(),SIGTERM);
115 kill(0-getpgrp(),SIGKILL);
118 sttybbs(SB_RESTORE); /* return the old terminal settings */
119 exit(code); /* exit with the proper exit code */
125 * We handle "next" and "stop" much differently than in earlier versions.
126 * The signal catching routine simply sets a flag and returns.
128 void sighandler(int which_sig)
130 signal(SIGINT,SIG_IGN);
131 signal(SIGQUIT,SIG_IGN);
132 sigcaught = which_sig;
138 * signal catching function for hangups...
140 void dropcarr(int signum) {
146 /* general purpose routines */
148 void formout(char *name) /* display a file */
152 sprintf(cmd,"MESG %s",name);
156 printf("%s\n",&cmd[4]);
159 fmout(screenwidth,NULL,
160 ((userflags & US_PAGINATOR) ? 1 : 0),
165 void userlist(void) {
175 printf("%s\n",&buf[4]);
179 sttybbs(SB_YES_INTR);
180 printf(" User Name Num L LastCall Calls Posts\n");
181 printf("------------------------- ----- - ---------- ----- -----\n");
182 while (serv_gets(buf), strcmp(buf,"000")) {
183 if (sigcaught == 0) {
186 printf("%5ld %d ",extract_long(buf,2),
188 lc = extract_long(buf,3);
189 tmbuf = (struct tm *)localtime(&lc);
190 printf("%02d/%02d/%04d ",
193 (tmbuf->tm_year + 1900));
194 printf("%5ld %5ld\n",extract_long(buf,4),extract_long(buf,5));
197 linecount = checkpagin(linecount,
198 ((userflags & US_PAGINATOR) ? 1 : 0),
209 * grab assorted info about the user...
211 void load_user_info(char *params)
213 extract(fullname,params,0);
214 axlevel = extract_int(params,1);
215 timescalled = extract_int(params,2);
216 posted = extract_int(params,3);
217 userflags = extract_int(params,4);
218 usernum = extract_long(params,5);
223 * Remove a room from the march list. 'floornum' is ignored unless
224 * 'roomname' is set to _FLOOR_, in which case all rooms on the requested
225 * floor will be removed from the march list.
227 void remove_march(char *roomname, int floornum)
229 struct march *mptr,*mptr2;
231 if (march==NULL) return;
233 if ( (!strucmp(march->march_name,roomname))
234 || ((!strucmp(roomname,"_FLOOR_"))&&(march->march_floor==floornum))) {
242 for (mptr=march; mptr!=NULL; mptr=mptr->next) {
244 if ( (!strucmp(mptr->march_name,roomname))
245 || ((!strucmp(roomname,"_FLOOR_"))
246 &&(mptr->march_floor==floornum))) {
248 mptr2->next = mptr->next;
259 * sort the march list by floor
261 void sort_march_list(void) {
262 struct march *mlist[129];
263 struct march *mptr = NULL;
266 if (march == NULL) return;
268 for (a=0; a<129; ++a) mlist[a] = NULL;
270 /* first, create 128 separate lists for each floor. */
271 while (march != NULL) {
273 a = (int)(march->march_floor);
275 /* assign an illegal floor number of 128 to _BASEROOM_
276 * in order to force it to show up last */
277 if (!strucmp(march->march_name,"_BASEROOM_")) a = 128;
281 mptr->next = mlist[a];
285 /* now merge the lists, in order, into one big list,
286 * except the current floor
288 for (a=128; a>=0; --a) if (a != curr_floor) {
289 while (mlist[a] != NULL) {
291 mlist[a] = mlist[a]->next;
297 /* now merge in rooms from the current floor */
298 while (mlist[(int)curr_floor] != NULL) {
299 mptr = mlist[(int)curr_floor];
300 mlist[(int)curr_floor] = mlist[(int)curr_floor]->next;
310 * jump directly to a room
312 void dotgoto(char *towhere, int display_name)
314 char aaa[256],bbb[256],psearch[256];
317 static int oldmailcount = (-1);
318 int partial_match,best_match;
321 /* store ungoto information */
322 strcpy(ugname,room_name);
325 /* first try an exact match */
326 sprintf(aaa,"GOTO %s",towhere);
329 if (aaa[3]=='*') express_msgs = 1;
330 if (!strncmp(aaa,"54",2)) {
331 newprompt("Enter room password: ",bbb,9);
332 sprintf(aaa,"GOTO %s|%s",towhere,bbb);
335 if (aaa[3]=='*') express_msgs = 1;
337 if (!strncmp(aaa,"54",2)) {
338 printf("Wrong password.\n");
344 * If a match is not found, try a partial match.
345 * Partial matches anywhere in the string carry a weight of 1,
346 * left-aligned matches carry a weight of 2. Pick the room that
347 * has the highest-weighted match.
354 if (aaa[0]=='1') while (serv_gets(aaa), strcmp(aaa,"000")) {
355 extract(psearch,aaa,0);
357 if (pattern(psearch,towhere)>=0) {
360 if (!struncmp(towhere,psearch,strlen(towhere))) {
363 if (partial_match > best_match) {
365 best_match = partial_match;
368 if (strlen(bbb)==0) {
369 printf("No room '%s'.\n",towhere);
372 sprintf(aaa,"GOTO %s",bbb);
375 if (aaa[3]=='*') express_msgs = 1;
383 extract(room_name,&aaa[4],0);
384 room_flags = extract_int(&aaa[4],4);
385 from_floor = curr_floor;
386 curr_floor = extract_int(&aaa[4],10);
388 remove_march(room_name,0);
389 if (!strucmp(towhere,"_BASEROOM_")) remove_march(towhere,0);
390 if ((from_floor!=curr_floor) && (display_name>0) && (floor_mode==1)) {
391 if (floorlist[(int)curr_floor][0]==0) load_floorlist();
392 printf("(Entering floor: %s)\n",&floorlist[(int)curr_floor][0]);
394 if (display_name == 1) printf("%s - ",room_name);
395 if (display_name != 2) printf("%d new of %d messages.\n",
396 extract_int(&aaa[4],1),
397 extract_int(&aaa[4],2));
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) readinfo();
407 /* check for newly arrived mail if we can */
408 if (num_parms(&aaa[4])>=10) {
409 newmailcount = extract_int(&aaa[4],9);
410 if ( (oldmailcount >= 0) && (newmailcount > oldmailcount) )
411 printf("*** You have new mail\n");
412 oldmailcount = newmailcount;
416 /* Goto next room having unread messages.
417 * We want to skip over rooms that the user has already been to, and take the
418 * user back to the lobby when done. The room we end up in is placed in
419 * newroom - which is set to 0 (the lobby) initially.
420 * We start the search in the current room rather than the beginning to prevent
421 * two or more concurrent users from dragging each other back to the same room.
423 void gotonext(void) {
425 struct march *mptr,*mptr2;
428 /* First check to see if the march-mode list is already allocated.
429 * If it is, pop the first room off the list and go there.
436 while (serv_gets(buf), strcmp(buf,"000")) {
437 mptr = (struct march *) malloc(sizeof(struct march));
439 extract(mptr->march_name,buf,0);
440 mptr->march_floor = (char) (extract_int(buf,2) & 0x7F);
446 while (mptr2->next != NULL)
452 /* add _BASEROOM_ to the end of the march list, so the user will end up
453 * in the system base room (usually the Lobby>) at the end of the loop
455 mptr = (struct march *) malloc(sizeof(struct march));
457 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);
477 strcpy(next_room,march->march_name);
480 strcpy(next_room,"_BASEROOM_");
482 remove_march(next_room,0);
483 dotgoto(next_room,1);
487 * forget all rooms on a given floor
489 void forget_all_rooms_on(int ffloor)
492 struct march *flist,*fptr;
494 printf("Forgetting all rooms on %s...\r",&floorlist[ffloor][0]);
496 sprintf(buf,"LKRA %d",ffloor);
500 printf("%-72s\n",&buf[4]);
504 while (serv_gets(buf), strcmp(buf,"000")) {
505 fptr = (struct march *) malloc(sizeof(struct march));
508 extract(fptr->march_name,buf,0);
510 while (flist != NULL) {
511 sprintf(buf,"GOTO %s",flist->march_name);
522 printf("%-72s\r","");
527 * routine called by gotofloor() to move to a new room on a new floor
529 void gf_toroom(char *towhere, int mode)
531 int floor_being_left;
533 floor_being_left = curr_floor;
535 if (mode == GF_GOTO) { /* <;G>oto mode */
540 if (mode == GF_SKIP) { /* <;S>kip mode */
542 remove_march("_FLOOR_",floor_being_left);
545 if (mode == GF_ZAP) { /* <;Z>ap mode */
547 remove_march("_FLOOR_",floor_being_left);
548 forget_all_rooms_on(floor_being_left);
556 void gotofloor(char *towhere, int mode)
560 char buf[256],targ[256];
562 if (floorlist[0][0]==0) load_floorlist();
564 for (a=0; a<128; ++a) if (!strucmp(&floorlist[a][0],towhere))
568 for (a=0; a<128; ++a) {
569 if (!struncmp(&floorlist[a][0],towhere,strlen(towhere))) {
576 for (a=0; a<128; ++a)
577 if (pattern(towhere,&floorlist[a][0])>0)
582 printf("No floor '%s'.\n",towhere);
586 for (mptr = march; mptr != NULL; mptr = mptr->next) {
587 if ((mptr->march_floor) == tofloor)
588 gf_toroom(mptr->march_name,mode);
593 sprintf(buf,"LKRA %d",tofloor);
596 if (buf[0]=='1') while (serv_gets(buf), strcmp(buf,"000")) {
597 if ((extract_int(buf,2)==tofloor)&&(strlen(targ)==0))
600 if (strlen(targ)>0) {
601 gf_toroom(targ,mode);
604 printf("There are no rooms on '%s'.\n",&floorlist[tofloor][0]);
610 * forget all rooms on current floor
612 void forget_this_floor(void) {
614 if (curr_floor == 0) {
615 printf("Can't forget this floor.\n");
619 if (floorlist[0][0]==0) load_floorlist();
620 printf("Are you sure you want to forget all rooms on %s? ",
621 &floorlist[(int)curr_floor][0]);
622 if (yesno()==0) return;
624 gf_toroom("_BASEROOM_",GF_ZAP);
629 * Figure out the physical screen dimensions, if we can
631 void check_screen_dims(void) {
634 unsigned short height; /* rows */
635 unsigned short width; /* columns */
636 unsigned short xpixels;
637 unsigned short ypixels; /* pixels */
640 if (have_xterm) { /* dynamically size screen if on an xterm */
641 if ( ioctl(0, TIOCGWINSZ, &xwinsz) == 0 ) {
642 if (xwinsz.height) screenheight = (int) xwinsz.height;
643 if (xwinsz.width) screenwidth = (int) xwinsz.width;
651 * set floor mode depending on client, server, and user settings
653 void set_floor_mode(void) {
654 if (serv_info.serv_ok_floors == 0) {
655 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) {
678 if (strlen(rc_password) > 0) {
679 strcpy(pass1,rc_password);
680 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);
687 if (!strucmp(pass1,pass2)) {
688 sprintf(buf,"SETP %s",pass1);
691 printf("%s\n",&buf[4]);
695 printf("*** They don't match... try again.\n");
703 * get info about the server we've connected to
705 void get_serv_info(void) {
708 CtdlInternalGetServInfo(&serv_info);
710 /* be nice and identify ourself to the server */
711 sprintf(buf,"IDEN %d|%d|%d|%s|",
712 SERVER_TYPE,0,REV_LEVEL,
713 (server_is_local ? "local" : CITADEL));
714 locate_host(&buf[strlen(buf)]); /* append to the end */
716 serv_gets(buf); /* we don't care about the result code */
724 * Display list of users currently logged on to the server
726 void who_is_online(int longlist)
728 char buf[128], username[128], roomname[128], fromhost[128], flags[128];
729 char tbuf[128], timestr[128], idlebuf[128], clientsoft[128];
731 time_t idletime, idlehours, idlemins, idlesecs;
737 extract(timestr, tbuf, 1);
738 timenow = atol(timestr);
741 printf("FLG ### User Name Room From host\n");
742 printf("--- --- ------------------------- -------------------- ------------------------\n");
748 while(serv_gets(buf), strcmp(buf,"000"))
750 extract(username,buf,1);
751 extract(roomname,buf,2);
752 extract(fromhost,buf,3);
753 extract(clientsoft, buf, 4);
754 extract(idlebuf, buf,5);
755 extract(flags,buf,7);
758 idletime = timenow - atol(idlebuf);
759 idlehours = idletime / 3600;
760 idlemins = (idletime - (idlehours*3600)) / 60;
761 idlesecs = (idletime - (idlehours*3600) - (idlemins*60) );
762 printf("\nFlags: %-3s Session: %-3d Name: %-25s Room: %s\n",
763 flags, extract_int(buf,0), username, roomname);
764 printf("from <%s> using <%s>, idle %ld:%02ld:%02ld\n",
765 fromhost, clientsoft,
766 idlehours, idlemins, idlesecs);
770 printf("%-3s %-3d %-25s %-20s %-24s\n",
771 flags, extract_int(buf,0), username,
778 void enternew(char *desc, char *buf, int maxlen)
781 sprintf(bbb, "Enter in your new %s: ", desc);
782 newprompt(bbb, buf, maxlen);
788 void main(int argc, char **argv)
792 char aaa[100],bbb[100],ccc[100],eee[100]; /* general purpose variables */
793 char argbuf[32]; /* command line buf */
796 load_command_set(); /* parse the citadel.rc file */
797 sttybbs(SB_SAVE); /* Store the old terminal parameters */
798 sttybbs(SB_NO_INTR); /* Install the new ones */
799 signal(SIGINT,SIG_IGN);
800 signal(SIGQUIT,SIG_IGN);
801 signal(SIGHUP,dropcarr); /* Cleanup gracefully if carrier is dropped */
802 signal(SIGTERM,dropcarr); /* Cleanup gracefully if terminated */
805 printf("Attaching to server...\r");
807 attach_to_server(argc,argv);
813 printf("%s\n",&aaa[4]);
818 printf("%-22s\n%s\n%s\n",serv_info.serv_software,serv_info.serv_humannode,
819 serv_info.serv_bbs_city);
820 screenwidth = 80; /* default screen dimensions */
823 printf(" pause next stop\n");
824 printf(" ctrl-s ctrl-o ctrl-c\n\n");
825 formout("hello"); /* print the opening greeting */
828 /* if we're not the login shell, try auto-login */
833 load_user_info(&aaa[4]);
840 GSTA: termn8=0; newnow=0;
842 if (strlen(rc_username) > 0) {
843 strcpy(fullname,rc_username);
846 newprompt("Enter your name: ",fullname,29);
849 if (!strucmp(fullname,"new")) { /* just in case */
850 printf("Please enter the name you wish to log in with.\n");
853 (!strucmp(fullname,"bbs"))
854 || (!strucmp(fullname,"new"))
855 || (strlen(fullname)==0) );
857 if (!strucmp(fullname,"off")) {
862 /* sign on to the server */
863 sprintf(aaa,"USER %s",fullname);
866 if (aaa[0]!='3') goto NEWUSR;
868 /* password authentication */
869 if (strlen(rc_password)>0) {
870 strcpy(eee,rc_password);
873 newprompt("\rPlease enter your password: ",eee,-19);
876 sprintf(aaa,"PASS %s",eee);
880 load_user_info(&aaa[4]);
884 printf("<< wrong password >>\n");
885 if (strlen(rc_password)>0) logoff(0);
888 NEWUSR: if (strlen(rc_password)==0) {
889 printf("No record. Enter as new user? ");
890 if (yesno()==0) goto GSTA;
893 sprintf(aaa,"NEWU %s",fullname);
900 load_user_info(&aaa[4]);
902 while (set_password() != 0) ;;
908 PWOK: printf("%s\nAccess level: %d (%s)\nUser #%ld / Call #%d\n",
909 fullname,axlevel,axdefs[(int)axlevel],
910 usernum,timescalled);
915 b = extract_int(&aaa[4],0);
916 if (b==1) printf("*** You have a new private message in Mail>\n");
917 if (b>1) printf("*** You have %d new private messages in Mail>\n",b);
919 if ((axlevel>=6) && (extract_int(&aaa[4],2)>0)) {
920 printf("*** Users need validation\n");
923 if (extract_int(&aaa[4],1)>0) {
924 printf("*** Please register.\n");
930 /* Make up some temporary filenames for use in various parts of the
931 * program. Don't mess with these once they've been set, because we
932 * will be unlinking them later on in the program and we don't
933 * want to delete something that we didn't create. */
934 sprintf(temp,"/tmp/citA%d",getpid());
935 sprintf(temp2,"/tmp/citB%d",getpid());
936 sprintf(tempdir,"/tmp/citC%d",getpid());
938 /* Get screen dimensions. First we go to a default of 80x24. Then
939 * we try to get the user's actual screen dimensions off the server.
940 * However, if we're running on an xterm, all this stuff is
941 * irrelevant because we're going to dynamically size the screen
942 * during the session.
949 screenwidth = extract_int(&aaa[4],0);
950 screenheight = extract_int(&aaa[4],1);
952 if (getenv("TERM")!=NULL) if (!strcmp(getenv("TERM"),"xterm")) {
962 /* Enter the lobby */
963 dotgoto("_BASEROOM_",1);
965 /* Main loop for the system... user is logged in. */
969 if (newnow==1) readmsgs(3,1,5);
970 else readmsgs(1,1,0);
972 do { /* MAIN LOOP OF PROGRAM */
973 signal(SIGINT,SIG_IGN);
974 signal(SIGQUIT,SIG_IGN);
981 if (termn8==0) switch(mcmd) {
982 case 1: formout("help");
986 case 36: entmsg(0,1);
988 case 46: entmsg(0,2);
990 case 78: newprompt("What do you want your username to be? ", aaa, 32);
991 sprintf(bbb, "ENT0 2|0|0|0|%s", aaa);
994 if (strncmp("200", aaa, 3))
995 printf("\n%s\n", aaa);
1002 case 47: updatelsa();
1005 case 58: updatelsa();
1006 dotgoto("_MAIL_",1);
1008 case 20: updatels();
1009 case 52: dotgoto(argbuf,0);
1011 case 10: readmsgs(0,1,0);
1013 case 9: readmsgs(3,1,5);
1015 case 13: readmsgs(1,1,0);
1017 case 11: readmsgs(0,(-1),0);
1019 case 12: readmsgs(2,(-1),0);
1021 case 71: readmsgs(3, 1, atoi(argbuf));
1023 case 7: forget(); break;
1024 case 18: subshell(); break;
1025 case 38: updatels();
1027 case 22: killroom(); break;
1028 case 32: userlist(); break;
1029 case 27: invite(); break;
1030 case 28: kickout(); break;
1031 case 23: editthisroom(); break;
1032 case 14: roomdir(); break;
1033 case 33: download(0); break;
1034 case 34: download(1); break;
1035 case 31: download(2); break;
1036 case 43: download(3); break;
1037 case 45: download(4); break;
1038 case 55: download(5); break;
1039 case 39: upload(0); break;
1040 case 40: upload(1); break;
1041 case 42: upload(2); break;
1042 case 44: upload(3); break;
1043 case 57: cli_upload(); break;
1044 case 16: ungoto(); break;
1045 case 24: whoknows(); break;
1046 case 26: validate(); break;
1047 case 29: updatels();
1050 case 30: updatels();
1053 case 48: enterinfo();
1055 case 49: readinfo();
1057 case 72: cli_image_upload("_userpic_");
1059 case 73: cli_image_upload("_roompic_");
1063 sprintf(aaa, "_floorpic_|%d", curr_floor);
1064 cli_image_upload(aaa);
1068 enternew("roomname", aaa, 20);
1069 sprintf(bbb, "RCHG %s", aaa);
1072 if (strncmp("200",aaa, 3))
1073 printf("\n%s\n", aaa);
1076 enternew("hostname", aaa, 25);
1077 sprintf(bbb, "HCHG %s", aaa);
1080 if (strncmp("200",aaa, 3))
1081 printf("\n%s\n", aaa);
1084 enternew("username", aaa, 32);
1085 sprintf(bbb, "UCHG %s", aaa);
1088 if (strncmp("200",aaa, 3))
1089 printf("\n%s\n", aaa);
1097 if (argbuf[0]==0) strcpy(aaa,"?");
1098 display_help(argbuf);
1102 formout("register");
1107 printf("Are you sure (y/n)? ");
1122 case 2: if (server_is_local) {
1123 sttybbs(SB_RESTORE);
1124 sprintf(aaa,"USERNAME=\042%s\042; export USERNAME; exec ./subsystem %ld %d %d",
1126 usernum,screenwidth,axlevel);
1128 sttybbs(SB_NO_INTR);
1131 printf("*** Can't run doors when server is not local.\n");
1158 gotofloor(argbuf,GF_GOTO);
1162 gotofloor(argbuf,GF_SKIP);
1166 forget_this_floor();
1194 knrooms(floor_mode);
1204 misc_server_cmd(argbuf);
1208 edit_system_message(argbuf);
1230 sprintf(bbb, "Page who [%s]? ", last_paged);
1232 sprintf(bbb, "Page who? ");
1233 newprompt(bbb,aaa,30);
1235 strcpy(aaa, last_paged);
1237 newprompt("Message: ",bbb,69);
1238 sprintf(ccc,"SEXP %s|%s",aaa,bbb);
1241 if (!strncmp("200", ccc, 3))
1242 strcpy(last_paged, aaa);
1243 printf("%s\n",&ccc[4]);
1249 TERMN8: printf("%s logged out.\n",fullname);
1250 while (march!=NULL) remove_march(march->march_name,0);
1252 printf("\n\nType 'off' to hang up, or next user...\n");
1253 sprintf(aaa,"LOUT");
1256 if ((mcmd==29)||(mcmd==15)) {