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=");
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");
220 output_headers(1, "bottom");
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");
267 output_headers(1, "bottom");
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 output_headers(0, "top");
312 wprintf("<HTML><HEAD></HEAD>\n<BODY ");
314 /* 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");
393 if (noframes) embed_main_menu();
395 wprintf("</BODY></HTML>\n");
399 strcpy(wc_roomname, wc_roomname);
404 * Locate the room on the march list which we most want to go to
406 char *pop_march(int desired_floor) {
407 static char TheRoom[64];
409 int TheOrder = 32767;
410 struct march *mptr = NULL;
412 strcpy(TheRoom, "_BASEROOM_");
413 if (march == NULL) return(TheRoom);
415 for (mptr = march; mptr != NULL; mptr = mptr->next) {
416 if ((strcasecmp(mptr->march_name, "_BASEROOM_"))
417 &&(!strcasecmp(TheRoom, "_BASEROOM_"))) {
418 strcpy(TheRoom, mptr->march_name);
419 TheFloor = mptr->march_floor;
420 TheOrder = mptr->march_order;
422 else if ( (mptr->march_floor == desired_floor)
423 && (TheFloor != desired_floor)
424 && (strcasecmp(mptr->march_name, "_BASEROOM_")) ) {
425 strcpy(TheRoom, mptr->march_name);
426 TheFloor = mptr->march_floor;
427 TheOrder = mptr->march_order;
429 else if ((mptr->march_floor < TheFloor)
430 && (strcasecmp(mptr->march_name, "_BASEROOM_")) ) {
431 strcpy(TheRoom, mptr->march_name);
432 TheFloor = mptr->march_floor;
433 TheOrder = mptr->march_order;
435 else if ((mptr->march_order < TheOrder)
436 && (strcasecmp(mptr->march_name, "_BASEROOM_")) ) {
437 strcpy(TheRoom, mptr->march_name);
438 TheFloor = mptr->march_floor;
439 TheOrder = mptr->march_order;
447 /* Goto next room having unread messages.
448 * We want to skip over rooms that the user has already been to, and take the
449 * user back to the lobby when done. The room we end up in is placed in
450 * newroom - which is set to 0 (the lobby) initially.
451 * We start the search in the current room rather than the beginning to prevent
452 * two or more concurrent users from dragging each other back to the same room.
454 void gotonext(void) {
456 struct march *mptr,*mptr2;
459 /* First check to see if the march-mode list is already allocated.
460 * If it is, pop the first room off the list and go there.
467 while (serv_gets(buf), strcmp(buf,"000")) {
468 mptr = (struct march *) malloc(sizeof(struct march));
470 extract(mptr->march_name,buf,0);
471 mptr->march_floor = extract_int(buf, 2);
472 mptr->march_order = extract_int(buf, 3);
478 while (mptr2->next != NULL)
484 /* add _BASEROOM_ to the end of the march list, so the user will end up
485 * in the system base room (usually the Lobby>) at the end of the loop
487 mptr = (struct march *) malloc(sizeof(struct march));
489 strcpy(mptr->march_name,"_BASEROOM_");
495 while (mptr2->next != NULL)
500 * ...and remove the room we're currently in, so a <G>oto doesn't make us
501 * walk around in circles
503 remove_march(wc_roomname);
508 strcpy(next_room, pop_march(-1));
511 strcpy(next_room,"_BASEROOM_");
513 gotoroom(next_room,1);
519 * mark all messages in current room as having been read
521 void slrp_highest(void) {
525 serv_puts("SLRP HIGHEST");
528 wprintf("<EM>%s</EM><BR>\n",&buf[4]);
535 * un-goto the previous room
540 if (!strcmp(ugname, "")) {
541 gotoroom(wc_roomname, 1);
544 serv_printf("GOTO %s", ugname);
547 gotoroom(wc_roomname, 1);
551 serv_printf("SLRP %ld",uglsn);
560 * display the form for editing a room
562 void display_editroom(void) {
565 char er_password[10];
567 char er_roomaide[26];
576 display_error(&buf[4]);
580 extract(er_name,&buf[4],0);
581 extract(er_password,&buf[4],1);
582 extract(er_dirname,&buf[4],2);
583 er_flags=extract_int(&buf[4],3);
584 er_floor=extract_int(&buf[4],4);
587 printf("HTTP/1.0 200 OK\n");
588 output_headers(1, "bottom");
590 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
591 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
592 wprintf("<B>Edit this room</B>\n");
593 wprintf("</FONT></TD></TR></TABLE>\n");
595 wprintf("<FORM METHOD=\"POST\" ACTION=\"/editroom\">\n");
597 wprintf("<UL><LI>Name of room: ");
598 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n",er_name);
600 wprintf("<LI>Resides on floor: ");
602 wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
603 for (i=0; i<128; ++i) if (strlen(floorlist[i])>0) {
605 if (i == er_floor) wprintf("SELECTED ");
606 wprintf("VALUE=\"%d\">", i);
607 escputs(floorlist[i]);
608 wprintf("</OPTION>\n");
610 wprintf("</SELECT>\n");
612 wprintf("<LI>Type of room:<UL>\n");
614 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
615 if ((er_flags & QR_PRIVATE) == 0) wprintf("CHECKED ");
616 wprintf("> Public room\n");
618 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
619 if ((er_flags & QR_PRIVATE)&&
620 (er_flags & QR_GUESSNAME)) wprintf("CHECKED ");
621 wprintf("> Private - guess name\n");
623 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
624 if ((er_flags & QR_PRIVATE)&&
625 (er_flags & QR_PASSWORDED)) wprintf("CHECKED ");
626 wprintf("> Private - require password:\n");
627 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" VALUE=\"%s\" MAXLENGTH=\"9\">\n",er_password);
629 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
630 if ( (er_flags & QR_PRIVATE)
631 && ((er_flags & QR_GUESSNAME) == 0)
632 && ((er_flags & QR_PASSWORDED) == 0) )
634 wprintf("> Private - invitation only\n");
636 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"bump\" VALUE=\"yes\" ");
637 wprintf("> If private, cause current users to forget room\n");
641 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"prefonly\" VALUE=\"yes\" ");
642 if (er_flags & QR_PREFONLY) wprintf("CHECKED ");
643 wprintf("> Preferred users only\n");
645 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"readonly\" VALUE=\"yes\" ");
646 if (er_flags & QR_READONLY) wprintf("CHECKED ");
647 wprintf("> Read-only room\n");
649 /* directory stuff */
650 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"directory\" VALUE=\"yes\" ");
651 if (er_flags & QR_DIRECTORY) wprintf("CHECKED ");
652 wprintf("> File directory room\n");
654 wprintf("<UL><LI>Directory name: ");
655 wprintf("<INPUT TYPE=\"text\" NAME=\"er_dirname\" VALUE=\"%s\" MAXLENGTH=\"14\">\n",er_dirname);
657 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"ulallowed\" VALUE=\"yes\" ");
658 if (er_flags & QR_UPLOAD) wprintf("CHECKED ");
659 wprintf("> Uploading allowed\n");
661 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"dlallowed\" VALUE=\"yes\" ");
662 if (er_flags & QR_DOWNLOAD) wprintf("CHECKED ");
663 wprintf("> Downloading allowed\n");
665 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"visdir\" VALUE=\"yes\" ");
666 if (er_flags & QR_VISDIR) wprintf("CHECKED ");
667 wprintf("> Visible directory</UL>\n");
669 /* end of directory stuff */
671 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"network\" VALUE=\"yes\" ");
672 if (er_flags & QR_NETWORK) wprintf("CHECKED ");
673 wprintf("> Network shared room\n");
675 /* start of anon options */
677 wprintf("<LI>Anonymous messages<UL>\n");
679 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"no\" ");
680 if ( ((er_flags & QR_ANONONLY)==0)
681 && ((er_flags & QR_ANONOPT)==0)) wprintf("CHECKED ");
682 wprintf("> No anonymous messages\n");
684 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anononly\" ");
685 if (er_flags & QR_ANONONLY) wprintf("CHECKED ");
686 wprintf("> All messages are anonymous\n");
688 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anon2\" ");
689 if (er_flags & QR_ANONOPT) wprintf("CHECKED ");
690 wprintf("> Prompt user when entering messages</UL>\n");
692 /* end of anon options */
694 wprintf("<LI>Room aide: \n");
698 wprintf("<EM>%s</EM>\n",&buf[4]);
701 extract(er_roomaide,&buf[4],0);
702 wprintf("<INPUT TYPE=\"text\" NAME=\"er_roomaide\" VALUE=\"%s\" MAXLENGTH=\"25\">\n",er_roomaide);
705 wprintf("</UL><CENTER>\n");
706 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
707 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
708 wprintf("</CENTER>\n");
710 wprintf("</FORM></HTML>\n");
716 * save new parameters for a room
718 void editroom(void) {
721 char er_password[10];
723 char er_roomaide[26];
729 if (strcmp(bstr("sc"),"OK")) {
730 display_error("Cancelled. Changes were not saved.");
738 display_error(&buf[4]);
742 extract(er_name,&buf[4],0);
743 extract(er_password,&buf[4],1);
744 extract(er_dirname,&buf[4],2);
745 er_flags=extract_int(&buf[4],3);
747 strcpy(er_roomaide,bstr("er_roomaide"));
748 if (strlen(er_roomaide)==0) {
752 strcpy(er_roomaide,"");
755 extract(er_roomaide,&buf[4],0);
759 strcpy(buf,bstr("er_name")); buf[20] = 0;
760 if (strlen(buf)>0) strcpy(er_name,buf);
762 strcpy(buf,bstr("er_password")); buf[10] = 0;
763 if (strlen(buf)>0) strcpy(er_password,buf);
765 strcpy(buf,bstr("er_dirname")); buf[15] = 0;
766 if (strlen(buf)>0) strcpy(er_dirname,buf);
768 strcpy(buf,bstr("type"));
769 er_flags &= !(QR_PRIVATE|QR_PASSWORDED|QR_GUESSNAME);
771 if (!strcmp(buf,"invonly")) {
772 er_flags |= (QR_PRIVATE);
774 if (!strcmp(buf,"guessname")) {
775 er_flags |= (QR_PRIVATE | QR_GUESSNAME);
777 if (!strcmp(buf,"passworded")) {
778 er_flags |= (QR_PRIVATE | QR_PASSWORDED);
781 if (!strcmp(bstr("prefonly"),"yes")) {
782 er_flags |= QR_PREFONLY;
785 er_flags &= ~QR_PREFONLY;
788 if (!strcmp(bstr("readonly"),"yes")) {
789 er_flags |= QR_READONLY;
792 er_flags &= ~QR_READONLY;
795 if (!strcmp(bstr("network"),"yes")) {
796 er_flags |= QR_NETWORK;
799 er_flags &= ~QR_NETWORK;
802 if (!strcmp(bstr("directory"),"yes")) {
803 er_flags |= QR_DIRECTORY;
806 er_flags &= ~QR_DIRECTORY;
809 if (!strcmp(bstr("ulallowed"),"yes")) {
810 er_flags |= QR_UPLOAD;
813 er_flags &= ~QR_UPLOAD;
816 if (!strcmp(bstr("dlallowed"),"yes")) {
817 er_flags |= QR_DOWNLOAD;
820 er_flags &= ~QR_DOWNLOAD;
823 if (!strcmp(bstr("visdir"),"yes")) {
824 er_flags |= QR_VISDIR;
827 er_flags &= ~QR_VISDIR;
830 strcpy(buf,bstr("anon"));
832 er_flags &= ~(QR_ANONONLY | QR_ANONOPT);
833 if (!strcmp(buf,"anononly")) er_flags |= QR_ANONONLY;
834 if (!strcmp(buf,"anon2")) er_flags |= QR_ANONOPT;
837 if (!strcmp(bstr("bump"),"yes")) bump = 1;
839 er_floor = atoi(bstr("er_floor"));
841 sprintf(buf,"SETR %s|%s|%s|%u|%d|%d",
842 er_name,er_password,er_dirname,er_flags,bump,er_floor);
846 display_error(&buf[4]);
849 gotoroom(er_name, 0);
851 if (strlen(er_roomaide)>0) {
852 sprintf(buf,"SETA %s",er_roomaide);
856 display_error(&buf[4]);
861 gotoroom(er_name, 1);
867 * display the form for entering a new room
869 void display_entroom(void) {
876 display_error(&buf[4]);
880 printf("HTTP/1.0 200 OK\n");
881 output_headers(1, "bottom");
883 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
884 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
885 wprintf("<B>Enter (create) a new room</B>\n");
886 wprintf("</FONT></TD></TR></TABLE>\n");
888 wprintf("<FORM METHOD=\"POST\" ACTION=\"/entroom\">\n");
890 wprintf("<UL><LI>Name of room: ");
891 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" MAXLENGTH=\"19\">\n");
893 wprintf("<LI>Type of room:<UL>\n");
895 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
896 wprintf("CHECKED > Public room\n");
898 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
899 wprintf("> Private - guess name\n");
901 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
902 wprintf("> Private - require password:\n");
903 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" MAXLENGTH=\"9\">\n");
905 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
906 wprintf("> Private - invitation only\n");
908 wprintf("<CENTER>\n");
909 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
910 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
911 wprintf("</CENTER>\n");
912 wprintf("</FORM></HTML>\n");
925 char er_password[10];
928 if (strcmp(bstr("sc"),"OK")) {
929 display_error("Cancelled. No new room was created.");
933 strcpy(er_name,bstr("er_name"));
934 strcpy(er_type,bstr("type"));
935 strcpy(er_password,bstr("er_password"));
938 if (!strcmp(er_type,"guessname")) er_num_type = 1;
939 if (!strcmp(er_type,"passworded")) er_num_type = 2;
940 if (!strcmp(er_type,"invonly")) er_num_type = 3;
942 sprintf(buf,"CRE8 1|%s|%d|%s",er_name,er_num_type,er_password);
946 display_error(&buf[4]);
949 gotoroom(er_name, 1);
954 * display the screen to enter a private room
956 void display_private(char *rname, int req_pass)
959 printf("HTTP/1.0 200 OK\n");
960 output_headers(1, "bottom");
962 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
963 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
964 wprintf("<B>Goto a private room</B>\n");
965 wprintf("</FONT></TD></TR></TABLE>\n");
967 wprintf("<CENTER>\n");
968 wprintf("If you know the name of a hidden (guess-name) or\n");
969 wprintf("passworded room, you can enter that room by typing\n");
970 wprintf("its name below. Once you gain access to a private\n");
971 wprintf("room, it will appear in your regular room listings\n");
972 wprintf("so you don't have to keep returning here.\n");
975 wprintf("<FORM METHOD=\"POST\" ACTION=\"/goto_private\">\n");
977 wprintf("<TABLE border><TR><TD>");
978 wprintf("Enter room name:</TD><TD>");
979 wprintf("<INPUT TYPE=\"text\" NAME=\"gr_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n",rname);
982 wprintf("</TD></TR><TR><TD>");
983 wprintf("Enter room password:</TD><TD>");
984 wprintf("<INPUT TYPE=\"password\" NAME=\"gr_pass\" MAXLENGTH=\"9\">\n");
987 wprintf("</TD></TR></TABLE>\n");
989 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
990 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
991 wprintf("</FORM></HTML>\n");
996 * goto a private room
998 void goto_private(void) {
1002 if (strcasecmp(bstr("sc"),"OK")) {
1003 display_main_menu();
1007 strcpy(hold_rm,wc_roomname);
1008 strcpy(buf,"GOTO ");
1009 strcat(buf,bstr("gr_name"));
1011 strcat(buf,bstr("gr_pass"));
1016 gotoroom(bstr("gr_name"),1);
1020 if (!strncmp(buf,"540",3)) {
1021 display_private(bstr("gr_name"),1);
1025 printf("HTTP/1.0 200 OK\n");
1026 output_headers(1, "bottom");
1027 wprintf("%s\n",&buf[4]);
1034 * display the screen to zap a room
1036 void display_zap(void) {
1037 printf("HTTP/1.0 200 OK\n");
1038 output_headers(1, "bottom");
1040 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1041 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1042 wprintf("<B>Zap (forget) the current room</B>\n");
1043 wprintf("</FONT></TD></TR></TABLE>\n");
1045 wprintf("If you select this option, <em>%s</em> will ", wc_roomname);
1046 wprintf("disappear from your room list. Is this what you wish ");
1047 wprintf("to do?<BR>\n");
1049 wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\">\n");
1050 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1051 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1052 wprintf("</FORM></HTML>\n");
1063 if (strcmp(bstr("sc"),"OK")) {
1064 display_main_menu();
1068 serv_printf("GOTO %s", wc_roomname);
1070 if (buf[0] != '2') {
1071 display_error(&buf[4]);
1077 if (buf[0] != '2') {
1078 display_error(&buf[4]);
1082 gotoroom(bstr("_BASEROOM_"),1);
1089 * Confirm deletion of the current room
1091 void confirm_delete_room(void) {
1094 serv_puts("KILL 0");
1096 if (buf[0] != '2') {
1097 display_error(&buf[4]);
1101 printf("HTTP/1.0 200 OK\n");
1102 output_headers(1, "bottom");
1103 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1104 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1105 wprintf("<B>Confirm deletion of room</B>\n");
1106 wprintf("</FONT></TD></TR></TABLE>\n");
1108 wprintf("<CENTER>");
1109 wprintf("<FORM METHOD=\"POST\" ACTION=\"/delete_room\">\n");
1111 wprintf("Are you sure you want to delete <FONT SIZE=+1>");
1112 escputs(wc_roomname);
1113 wprintf("</FONT>?<BR>\n");
1115 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Delete\">");
1116 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1118 wprintf("</FORM></CENTER></BODY></HTML>\n");
1124 * Delete the current room
1126 void delete_room(void) {
1130 strcpy(sc, bstr("sc"));
1132 if (strcasecmp(sc, "Delete")) {
1133 display_error("Cancelled. This room was not deleted.");
1137 serv_puts("KILL 1");
1139 if (buf[0] != '2') {
1140 display_error(&buf[4]);
1143 gotoroom("_BASEROOM_", 1);