10 #include <sys/types.h>
15 * This struct holds a list of rooms for <G>oto operations.
25 * This struct holds a list of rooms for client display.
29 struct roomlisting *lnext;
30 struct roomlisting *rnext;
38 char floorlist[128][256];
45 struct march *march = NULL;
48 * load the list of floors
50 void load_floorlist(void) {
54 for (a=0; a<128; ++a) floorlist[a][0] = 0;
59 strcpy(floorlist[0],"Main Floor");
62 while (serv_gets(buf), strcmp(buf,"000")) {
63 extract(floorlist[extract_int(buf,0)],buf,1);
69 * remove a room from the march list
71 void remove_march(char *aaa)
73 struct march *mptr,*mptr2;
75 if (march==NULL) return;
77 if (!strcasecmp(march->march_name,aaa)) {
85 for (mptr=march; mptr!=NULL; mptr=mptr->next) {
86 if (!strcasecmp(mptr->march_name,aaa)) {
87 mptr2->next = mptr->next;
101 void room_tree_list(struct roomlisting *rp) {
105 if (rp == NULL) return;
107 if (rp->lnext != NULL) {
108 room_tree_list(rp->lnext);
111 strcpy(rmname, rp->rlname);
114 wprintf("<A HREF=\"/dotgoto&room=");
116 wprintf("\" TARGET=\"top\">");
118 if ((f & QR_DIRECTORY) && (f & QR_NETWORK)) wprintf("}");
119 else if (f & QR_DIRECTORY) wprintf("]");
120 else if (f & QR_NETWORK) wprintf(")");
121 else wprintf(">");
122 wprintf("</A><TT> </TT>\n");
124 if (rp->rnext != NULL) {
125 room_tree_list(rp->rnext);
133 * Room ordering stuff (compare first by floor, then by order)
135 int rordercmp(struct roomlisting *r1, struct roomlisting *r2)
137 if ((r1==NULL)&&(r2==NULL)) return(0);
138 if (r1==NULL) return(-1);
139 if (r2==NULL) return(1);
140 if (r1->rlfloor < r2->rlfloor) return(-1);
141 if (r1->rlfloor > r2->rlfloor) return(1);
142 if (r1->rlorder < r2->rlorder) return(-1);
143 if (r1->rlorder > r2->rlorder) return(1);
149 * Common code for all room listings
151 void listrms(char *variety)
155 struct roomlisting *rl = NULL;
156 struct roomlisting *rp;
157 struct roomlisting *rs;
160 /* Ask the server for a room list */
163 if (buf[0]!='1') return;
164 while (serv_gets(buf), strcmp(buf, "000")) {
165 rp = malloc(sizeof(struct roomlisting));
166 extract(rp->rlname, buf, 0);
167 rp->rlflags = extract_int(buf, 1);
168 rp->rlfloor = extract_int(buf, 2);
169 rp->rlorder = extract_int(buf, 3);
177 else while (rp != NULL) {
178 if (rordercmp(rp, rs)<0) {
179 if (rs->lnext == NULL) {
188 if (rs->rnext == NULL) {
211 * list all rooms by floor
213 void list_all_rooms_by_floor(void) {
219 printf("HTTP/1.0 200 OK\n");
222 wprintf("<TABLE width=100% border><TR><TH>Floor</TH>");
223 wprintf("<TH>Rooms with new messages</TH>");
224 wprintf("<TH>Rooms with no new messages</TH></TR>\n");
226 for (a=0; a<128; ++a) if (floorlist[a][0]!=0) {
228 /* Floor name column */
231 serv_printf("OIMG _floorpic_|%d", a);
236 wprintf("<IMG SRC=\"/image&name=_floorpic_&parm=%d\" ALT=\"%s\">",
237 a, &floorlist[a][0]);
240 escputs(&floorlist[a][0]);
245 /* Rooms with new messages column */
247 sprintf(buf,"LKRN %d",a);
249 wprintf("</TD><TD>\n");
251 /* Rooms with old messages column */
252 sprintf(buf,"LKRO %d",a);
254 wprintf("</TD></TR>\n");
256 wprintf("</TABLE>\n");
257 wprintf("</BODY></HTML>\n");
263 * list all forgotten rooms
265 void zapped_list(void) {
266 printf("HTTP/1.0 200 OK\n");
268 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
269 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
270 wprintf("<B>Zapped (forgotten) rooms</B>\n");
271 wprintf("</FONT></TD></TR></TABLE><BR>\n");
273 wprintf("<BR><BR>\n");
274 wprintf("Click on any room to un-zap it and goto that room.\n");
275 wprintf("</BODY></HTML>\n");
281 * read this room's info file (set v to 1 for verbose mode)
289 if (buf[0]=='1') fmout(NULL);
291 if (v==1) wprintf("<EM>%s</EM><BR>\n",&buf[4]);
297 * generic routine to take the session to a new room
299 * display_name values: 0 = goto only
300 * 1 = goto and display
303 void gotoroom(char *gname, int display_name)
306 static long ls = (-1L);
310 printf("HTTP/1.0 200 OK\n");
311 printf("Window-target: top\n");
313 wprintf("<HTML><HEAD></HEAD>\n<BODY ");
315 /* automatically fire up a read-new-msgs in the bottom frame */
316 wprintf("onload=location=\"/readnew\" ");
318 wprintf("BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\n");
321 if (display_name != 2) {
322 /* store ungoto information */
323 strcpy(ugname, wc_roomname);
327 /* move to the new room */
328 serv_printf("GOTO %s", gname);
331 serv_puts("GOTO _BASEROOM_");
336 wprintf("<EM>%s</EM><BR></BODY></HTML>\n",&buf[4]);
342 extract(wc_roomname,&buf[4],0);
343 room_flags = extract_int(&buf[4],4);
344 /* highest_msg_read = extract_int(&buf[4],6);
345 maxmsgnum = extract_int(&buf[4],5);
346 is_mail = (char) extract_int(&buf[4],7); */
347 ls = extract_long(&buf[4], 6);
349 if (is_aide) is_room_aide = is_aide;
350 else is_room_aide = (char) extract_int(&buf[4],8);
352 remove_march(wc_roomname);
353 if (!strcasecmp(gname,"_BASEROOM_")) remove_march(gname);
355 /* Display the room banner */
357 wprintf("<CENTER><TABLE border=0><TR>");
359 if ( (strlen(ugname)>0) && (strcasecmp(ugname,wc_roomname)) ) {
360 wprintf("<TD VALIGN=TOP><A HREF=\"/ungoto\">");
361 wprintf("<IMG SRC=\"/static/back.gif\" border=0></A></TD>");
364 wprintf("<TD VALIGN=TOP><H1>%s</H1>",wc_roomname);
365 wprintf("<FONT SIZE=-1>%d new of %d messages</FONT></TD>\n",
366 extract_int(&buf[4],1),
367 extract_int(&buf[4],2));
369 /* Display room graphic. The server doesn't actually
370 * need the room name, but we supply it in order to
371 * keep the browser from using a cached graphic from
374 serv_puts("OIMG _roompic_");
378 wprintf("<IMG SRC=\"/image&name=_roompic_&room=");
379 escputs(wc_roomname);
385 wprintf("<TD VALIGN=TOP>");
389 wprintf("<TD VALIGN=TOP><A HREF=\"/gotonext\">");
390 wprintf("<IMG SRC=\"/static/forward.gif\" border=0></A></TD>");
391 wprintf("</TR></TABLE></CENTER>\n");
392 wprintf("</BODY></HTML>\n");
396 strcpy(wc_roomname, wc_roomname);
401 * Locate the room on the march list which we most want to go to
403 char *pop_march(int desired_floor) {
404 static char TheRoom[64];
406 int TheOrder = 32767;
407 struct march *mptr = NULL;
409 strcpy(TheRoom, "_BASEROOM_");
410 if (march == NULL) return(TheRoom);
412 for (mptr = march; mptr != NULL; mptr = mptr->next) {
413 if ((strcasecmp(mptr->march_name, "_BASEROOM_"))
414 &&(!strcasecmp(TheRoom, "_BASEROOM_"))) {
415 strcpy(TheRoom, mptr->march_name);
416 TheFloor = mptr->march_floor;
417 TheOrder = mptr->march_order;
419 else if ( (mptr->march_floor == desired_floor)
420 && (TheFloor != desired_floor)
421 && (strcasecmp(mptr->march_name, "_BASEROOM_")) ) {
422 strcpy(TheRoom, mptr->march_name);
423 TheFloor = mptr->march_floor;
424 TheOrder = mptr->march_order;
426 else if ((mptr->march_floor < TheFloor)
427 && (strcasecmp(mptr->march_name, "_BASEROOM_")) ) {
428 strcpy(TheRoom, mptr->march_name);
429 TheFloor = mptr->march_floor;
430 TheOrder = mptr->march_order;
432 else if ((mptr->march_order < TheOrder)
433 && (strcasecmp(mptr->march_name, "_BASEROOM_")) ) {
434 strcpy(TheRoom, mptr->march_name);
435 TheFloor = mptr->march_floor;
436 TheOrder = mptr->march_order;
444 /* Goto next room having unread messages.
445 * We want to skip over rooms that the user has already been to, and take the
446 * user back to the lobby when done. The room we end up in is placed in
447 * newroom - which is set to 0 (the lobby) initially.
448 * We start the search in the current room rather than the beginning to prevent
449 * two or more concurrent users from dragging each other back to the same room.
451 void gotonext(void) {
453 struct march *mptr,*mptr2;
456 /* First check to see if the march-mode list is already allocated.
457 * If it is, pop the first room off the list and go there.
464 while (serv_gets(buf), strcmp(buf,"000")) {
465 mptr = (struct march *) malloc(sizeof(struct march));
467 extract(mptr->march_name,buf,0);
468 mptr->march_floor = extract_int(buf, 2);
469 mptr->march_order = extract_int(buf, 3);
475 while (mptr2->next != NULL)
481 /* add _BASEROOM_ to the end of the march list, so the user will end up
482 * in the system base room (usually the Lobby>) at the end of the loop
484 mptr = (struct march *) malloc(sizeof(struct march));
486 strcpy(mptr->march_name,"_BASEROOM_");
492 while (mptr2->next != NULL)
497 * ...and remove the room we're currently in, so a <G>oto doesn't make us
498 * walk around in circles
500 remove_march(wc_roomname);
505 strcpy(next_room, pop_march(-1));
508 strcpy(next_room,"_BASEROOM_");
510 gotoroom(next_room,1);
516 * mark all messages in current room as having been read
518 void slrp_highest(void) {
522 serv_puts("SLRP HIGHEST");
525 wprintf("<EM>%s</EM><BR>\n",&buf[4]);
532 * un-goto the previous room
537 if (!strcmp(ugname, "")) {
538 gotoroom(wc_roomname, 1);
541 serv_printf("GOTO %s", ugname);
544 gotoroom(wc_roomname, 1);
548 serv_printf("SLRP %ld",uglsn);
557 * display the form for editing a room
559 void display_editroom(void) {
562 char er_password[10];
564 char er_roomaide[26];
571 display_error(&buf[4]);
575 extract(er_name,&buf[4],0);
576 extract(er_password,&buf[4],1);
577 extract(er_dirname,&buf[4],2);
578 er_flags=extract_int(&buf[4],3);
581 printf("HTTP/1.0 200 OK\n");
584 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
585 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
586 wprintf("<B>Edit this room</B>\n");
587 wprintf("</FONT></TD></TR></TABLE>\n");
589 wprintf("<FORM METHOD=\"POST\" ACTION=\"/editroom\">\n");
591 wprintf("<UL><LI>Name of room: ");
592 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n",er_name);
594 wprintf("<LI>Type of room:<UL>\n");
596 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
597 if ((er_flags & QR_PRIVATE) == 0) wprintf("CHECKED ");
598 wprintf("> Public room\n");
600 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
601 if ((er_flags & QR_PRIVATE)&&
602 (er_flags & QR_GUESSNAME)) wprintf("CHECKED ");
603 wprintf("> Private - guess name\n");
605 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
606 if ((er_flags & QR_PRIVATE)&&
607 (er_flags & QR_PASSWORDED)) wprintf("CHECKED ");
608 wprintf("> Private - require password:\n");
609 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" VALUE=\"%s\" MAXLENGTH=\"9\">\n",er_password);
611 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
612 if ( (er_flags & QR_PRIVATE)
613 && ((er_flags & QR_GUESSNAME) == 0)
614 && ((er_flags & QR_PASSWORDED) == 0) )
616 wprintf("> Private - invitation only\n");
618 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"bump\" VALUE=\"yes\" ");
619 wprintf("> If private, cause current users to forget room\n");
623 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"prefonly\" VALUE=\"yes\" ");
624 if (er_flags & QR_PREFONLY) wprintf("CHECKED ");
625 wprintf("> Preferred users only\n");
627 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"readonly\" VALUE=\"yes\" ");
628 if (er_flags & QR_READONLY) wprintf("CHECKED ");
629 wprintf("> Read-only room\n");
631 /* directory stuff */
632 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"directory\" VALUE=\"yes\" ");
633 if (er_flags & QR_DIRECTORY) wprintf("CHECKED ");
634 wprintf("> File directory room\n");
636 wprintf("<UL><LI>Directory name: ");
637 wprintf("<INPUT TYPE=\"text\" NAME=\"er_dirname\" VALUE=\"%s\" MAXLENGTH=\"14\">\n",er_dirname);
639 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"ulallowed\" VALUE=\"yes\" ");
640 if (er_flags & QR_UPLOAD) wprintf("CHECKED ");
641 wprintf("> Uploading allowed\n");
643 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"dlallowed\" VALUE=\"yes\" ");
644 if (er_flags & QR_DOWNLOAD) wprintf("CHECKED ");
645 wprintf("> Downloading allowed\n");
647 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"visdir\" VALUE=\"yes\" ");
648 if (er_flags & QR_VISDIR) wprintf("CHECKED ");
649 wprintf("> Visible directory</UL>\n");
651 /* end of directory stuff */
653 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"network\" VALUE=\"yes\" ");
654 if (er_flags & QR_NETWORK) wprintf("CHECKED ");
655 wprintf("> Network shared room\n");
657 /* start of anon options */
659 wprintf("<LI>Anonymous messages<UL>\n");
661 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"no\" ");
662 if ( ((er_flags & QR_ANONONLY)==0)
663 && ((er_flags & QR_ANONOPT)==0)) wprintf("CHECKED ");
664 wprintf("> No anonymous messages\n");
666 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anononly\" ");
667 if (er_flags & QR_ANONONLY) wprintf("CHECKED ");
668 wprintf("> All messages are anonymous\n");
670 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anon2\" ");
671 if (er_flags & QR_ANONOPT) wprintf("CHECKED ");
672 wprintf("> Prompt user when entering messages</UL>\n");
674 /* end of anon options */
676 wprintf("<LI>Room aide: \n");
680 wprintf("<EM>%s</EM>\n",&buf[4]);
683 extract(er_roomaide,&buf[4],0);
684 wprintf("<INPUT TYPE=\"text\" NAME=\"er_roomaide\" VALUE=\"%s\" MAXLENGTH=\"25\">\n",er_roomaide);
687 wprintf("</UL><CENTER>\n");
688 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
689 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
690 wprintf("</CENTER>\n");
692 wprintf("</FORM></HTML>\n");
698 * save new parameters for a room
700 void editroom(void) {
703 char er_password[10];
705 char er_roomaide[26];
710 if (strcmp(bstr("sc"),"OK")) {
711 display_error("Cancelled. Changes were not saved.");
719 display_error(&buf[4]);
723 extract(er_name,&buf[4],0);
724 extract(er_password,&buf[4],1);
725 extract(er_dirname,&buf[4],2);
726 er_flags=extract_int(&buf[4],3);
728 strcpy(er_roomaide,bstr("er_roomaide"));
729 if (strlen(er_roomaide)==0) {
733 strcpy(er_roomaide,"");
736 extract(er_roomaide,&buf[4],0);
740 strcpy(buf,bstr("er_name")); buf[20] = 0;
741 if (strlen(buf)>0) strcpy(er_name,buf);
743 strcpy(buf,bstr("er_password")); buf[10] = 0;
744 if (strlen(buf)>0) strcpy(er_password,buf);
746 strcpy(buf,bstr("er_dirname")); buf[15] = 0;
747 if (strlen(buf)>0) strcpy(er_dirname,buf);
749 strcpy(buf,bstr("type"));
750 er_flags &= !(QR_PRIVATE|QR_PASSWORDED|QR_GUESSNAME);
752 if (!strcmp(buf,"invonly")) {
753 er_flags |= (QR_PRIVATE);
755 if (!strcmp(buf,"guessname")) {
756 er_flags |= (QR_PRIVATE | QR_GUESSNAME);
758 if (!strcmp(buf,"passworded")) {
759 er_flags |= (QR_PRIVATE | QR_PASSWORDED);
762 if (!strcmp(bstr("prefonly"),"yes")) {
763 er_flags |= QR_PREFONLY;
766 er_flags &= ~QR_PREFONLY;
769 if (!strcmp(bstr("readonly"),"yes")) {
770 er_flags |= QR_READONLY;
773 er_flags &= ~QR_READONLY;
776 if (!strcmp(bstr("network"),"yes")) {
777 er_flags |= QR_NETWORK;
780 er_flags &= ~QR_NETWORK;
783 if (!strcmp(bstr("directory"),"yes")) {
784 er_flags |= QR_DIRECTORY;
787 er_flags &= ~QR_DIRECTORY;
790 if (!strcmp(bstr("ulallowed"),"yes")) {
791 er_flags |= QR_UPLOAD;
794 er_flags &= ~QR_UPLOAD;
797 if (!strcmp(bstr("dlallowed"),"yes")) {
798 er_flags |= QR_DOWNLOAD;
801 er_flags &= ~QR_DOWNLOAD;
804 if (!strcmp(bstr("visdir"),"yes")) {
805 er_flags |= QR_VISDIR;
808 er_flags &= ~QR_VISDIR;
811 strcpy(buf,bstr("anon"));
813 er_flags &= ~(QR_ANONONLY | QR_ANONOPT);
814 if (!strcmp(buf,"anononly")) er_flags |= QR_ANONONLY;
815 if (!strcmp(buf,"anon2")) er_flags |= QR_ANONOPT;
818 if (!strcmp(bstr("bump"),"yes")) bump = 1;
820 sprintf(buf,"SETR %s|%s|%s|%u|%d",
821 er_name,er_password,er_dirname,er_flags,bump);
825 display_error(&buf[4]);
828 gotoroom(er_name, 0);
830 if (strlen(er_roomaide)>0) {
831 sprintf(buf,"SETA %s",er_roomaide);
835 display_error(&buf[4]);
840 gotoroom(er_name, 1);
846 * display the form for entering a new room
848 void display_entroom(void) {
855 display_error(&buf[4]);
859 printf("HTTP/1.0 200 OK\n");
862 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
863 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
864 wprintf("<B>Enter (create) a new room</B>\n");
865 wprintf("</FONT></TD></TR></TABLE>\n");
867 wprintf("<FORM METHOD=\"POST\" ACTION=\"/entroom\">\n");
869 wprintf("<UL><LI>Name of room: ");
870 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" MAXLENGTH=\"19\">\n");
872 wprintf("<LI>Type of room:<UL>\n");
874 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
875 wprintf("CHECKED > Public room\n");
877 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
878 wprintf("> Private - guess name\n");
880 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
881 wprintf("> Private - require password:\n");
882 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" MAXLENGTH=\"9\">\n");
884 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
885 wprintf("> Private - invitation only\n");
887 wprintf("<CENTER>\n");
888 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
889 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
890 wprintf("</CENTER>\n");
891 wprintf("</FORM></HTML>\n");
904 char er_password[10];
907 if (strcmp(bstr("sc"),"OK")) {
908 display_error("Cancelled. No new room was created.");
912 strcpy(er_name,bstr("er_name"));
913 strcpy(er_type,bstr("type"));
914 strcpy(er_password,bstr("er_password"));
917 if (!strcmp(er_type,"guessname")) er_num_type = 1;
918 if (!strcmp(er_type,"passworded")) er_num_type = 2;
919 if (!strcmp(er_type,"invonly")) er_num_type = 3;
921 sprintf(buf,"CRE8 1|%s|%d|%s",er_name,er_num_type,er_password);
925 display_error(&buf[4]);
928 gotoroom(er_name, 1);
933 * display the screen to enter a private room
935 void display_private(char *rname, int req_pass)
938 printf("HTTP/1.0 200 OK\n");
941 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
942 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
943 wprintf("<B>Goto a private room</B>\n");
944 wprintf("</FONT></TD></TR></TABLE>\n");
946 wprintf("<CENTER>\n");
947 wprintf("If you know the name of a hidden (guess-name) or\n");
948 wprintf("passworded room, you can enter that room by typing\n");
949 wprintf("its name below. Once you gain access to a private\n");
950 wprintf("room, it will appear in your regular room listings\n");
951 wprintf("so you don't have to keep returning here.\n");
954 wprintf("<FORM METHOD=\"POST\" ACTION=\"/goto_private\">\n");
956 wprintf("<TABLE border><TR><TD>");
957 wprintf("Enter room name:</TD><TD>");
958 wprintf("<INPUT TYPE=\"text\" NAME=\"gr_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n",rname);
961 wprintf("</TD></TR><TR><TD>");
962 wprintf("Enter room password:</TD><TD>");
963 wprintf("<INPUT TYPE=\"password\" NAME=\"gr_pass\" MAXLENGTH=\"9\">\n");
966 wprintf("</TD></TR></TABLE>\n");
968 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
969 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
970 wprintf("</FORM></HTML>\n");
975 * goto a private room
977 void goto_private(void) {
981 if (strcasecmp(bstr("sc"),"OK")) {
986 strcpy(hold_rm,wc_roomname);
988 strcat(buf,bstr("gr_name"));
990 strcat(buf,bstr("gr_pass"));
995 gotoroom(bstr("gr_name"),1);
999 if (!strncmp(buf,"540",3)) {
1000 display_private(bstr("gr_name"),1);
1004 printf("HTTP/1.0 200 OK\n");
1006 wprintf("%s\n",&buf[4]);
1013 * display the screen to zap a room
1015 void display_zap(void) {
1016 printf("HTTP/1.0 200 OK\n");
1019 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1020 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1021 wprintf("<B>Zap (forget) the current room</B>\n");
1022 wprintf("</FONT></TD></TR></TABLE>\n");
1024 wprintf("If you select this option, <em>%s</em> will ", wc_roomname);
1025 wprintf("disappear from your room list. Is this what you wish ");
1026 wprintf("to do?<BR>\n");
1028 wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\">\n");
1029 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1030 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1031 wprintf("</FORM></HTML>\n");
1042 if (strcmp(bstr("sc"),"OK")) {
1043 display_main_menu();
1047 serv_printf("GOTO %s", wc_roomname);
1049 if (buf[0] != '2') {
1050 display_error(&buf[4]);
1056 if (buf[0] != '2') {
1057 display_error(&buf[4]);
1061 gotoroom(bstr("_BASEROOM_"),1);
1068 * Confirm deletion of the current room
1070 void confirm_delete_room(void) {
1073 serv_puts("KILL 0");
1075 if (buf[0] != '2') {
1076 display_error(&buf[4]);
1080 printf("HTTP/1.0 200 OK\n");
1082 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1083 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1084 wprintf("<B>Confirm deletion of room</B>\n");
1085 wprintf("</FONT></TD></TR></TABLE>\n");
1087 wprintf("<CENTER>");
1088 wprintf("<FORM METHOD=\"POST\" ACTION=\"/delete_room\">\n");
1090 wprintf("Are you sure you want to delete <FONT SIZE=+1>");
1091 escputs(wc_roomname);
1092 wprintf("</FONT>?<BR>\n");
1094 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Delete\">");
1095 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1097 wprintf("</FORM></CENTER></BODY></HTML>\n");
1103 * Delete the current room
1105 void delete_room(void) {
1109 strcpy(sc, bstr("sc"));
1111 if (strcasecmp(sc, "Delete")) {
1112 display_error("Cancelled. This room was not deleted.");
1116 serv_puts("KILL 1");
1118 if (buf[0] != '2') {
1119 display_error(&buf[4]);
1122 gotoroom("_BASEROOM_", 1);