10 #include <sys/types.h>
12 #include <sys/socket.h>
15 #include <netinet/in.h>
33 * This struct holds a list of rooms for <G>oto operations.
43 * This struct holds a list of rooms for client display.
47 struct roomlisting *lnext;
48 struct roomlisting *rnext;
56 char floorlist[128][256];
58 struct march *march = NULL;
61 * load the list of floors
63 void load_floorlist(void)
68 for (a = 0; a < 128; ++a)
74 strcpy(floorlist[0], "Main Floor");
77 while (serv_gets(buf), strcmp(buf, "000")) {
78 extract(floorlist[extract_int(buf, 0)], buf, 1);
84 * remove a room from the march list
86 void remove_march(char *aaa)
88 struct march *mptr, *mptr2;
93 if (!strcasecmp(march->march_name, aaa)) {
100 for (mptr = march; mptr != NULL; mptr = mptr->next) {
101 if (!strcasecmp(mptr->march_name, aaa)) {
102 mptr2->next = mptr->next;
115 void room_tree_list(struct roomlisting *rp)
123 if (rp->lnext != NULL) {
124 room_tree_list(rp->lnext);
126 strcpy(rmname, rp->rlname);
129 wprintf("<A HREF=\"/dotgoto&room=");
134 if ((f & QR_DIRECTORY) && (f & QR_NETWORK))
136 else if (f & QR_DIRECTORY)
138 else if (f & QR_NETWORK)
142 wprintf("</A><TT> </TT>\n");
144 if (rp->rnext != NULL) {
145 room_tree_list(rp->rnext);
152 * Room ordering stuff (compare first by floor, then by order)
154 int rordercmp(struct roomlisting *r1, struct roomlisting *r2)
156 if ((r1 == NULL) && (r2 == NULL))
162 if (r1->rlfloor < r2->rlfloor)
164 if (r1->rlfloor > r2->rlfloor)
166 if (r1->rlorder < r2->rlorder)
168 if (r1->rlorder > r2->rlorder)
175 * Common code for all room listings
177 void listrms(char *variety)
182 struct roomlisting *rl = NULL;
183 struct roomlisting *rp;
184 struct roomlisting *rs;
187 /* Ask the server for a room list */
194 while (serv_gets(buf), strcmp(buf, "000")) {
196 rp = malloc(sizeof(struct roomlisting));
197 extract(rp->rlname, buf, 0);
198 rp->rlflags = extract_int(buf, 1);
199 rp->rlfloor = extract_int(buf, 2);
200 rp->rlorder = extract_int(buf, 3);
209 if (rordercmp(rp, rs) < 0) {
210 if (rs->lnext == NULL) {
217 if (rs->rnext == NULL) {
229 /* If no rooms were listed, print an nbsp to make the cell
230 * borders show up anyway.
232 if (num_rooms == 0) wprintf(" ");
244 * list all rooms by floor
246 void list_all_rooms_by_floor(void)
255 wprintf("<TABLE width=100% border><TR><TH>Floor</TH>");
256 wprintf("<TH><FONT FACE=\"Arial,Helvetica,sans-serif\">Rooms with new messages</FONT></TH>");
257 wprintf("<TH><FONT FACE=\"Arial,Helvetica,sans-serif\">Rooms with no new messages</FONT></TH></TR>\n");
259 for (a = 0; a < 128; ++a)
260 if (floorlist[a][0] != 0) {
262 /* Floor name column */
263 wprintf("<TR><TD><FONT FACE=\"Arial,Helvetica,sans-serif\">");
265 serv_printf("OIMG _floorpic_|%d", a);
270 wprintf("<IMG SRC=\"/image&name=_floorpic_&parm=%d\" ALT=\"%s\">",
271 a, &floorlist[a][0]);
273 escputs(&floorlist[a][0]);
276 wprintf("</FONT></TD>");
278 /* Rooms with new messages column */
279 wprintf("<TD><FONT FACE=\"Arial,Helvetica,sans-serif\">");
280 sprintf(buf, "LKRN %d", a);
282 wprintf("</FONT></TD>\n<TD><FONT FACE=\"Arial,Helvetica,sans-serif\">");
284 /* Rooms with old messages column */
285 sprintf(buf, "LKRO %d", a);
287 wprintf("</FONT></TD></TR>\n");
289 wprintf("</TABLE>\n");
295 * list all forgotten rooms
297 void zapped_list(void)
300 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
301 wprintf("<FONT FACE=\"Arial,Helvetica,sans-serif\" SIZE=+1 COLOR=\"FFFFFF\"");
302 wprintf("<B>Zapped (forgotten) rooms</B>\n");
303 wprintf("</FONT></TD></TR></TABLE><BR>\n");
305 wprintf("<BR><BR>\n");
306 wprintf("Click on any room to un-zap it and goto that room.\n");
312 * read this room's info file (set v to 1 for verbose mode)
324 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
330 void embed_room_banner(char *got) {
333 static int remember_new_mail = (-1);
335 /* We need to have the information returned by a GOTO server command.
336 * If it isn't supplied, we fake it by issuing our own GOTO.
339 serv_printf("GOTO %s", WC->wc_roomname);
344 /* Check for new mail. */
345 WC->new_mail = extract_int(&got[4], 9);
347 /* Now start spewing HTML. */
348 wprintf("<CENTER><TABLE border=0><TR>");
350 if ((strlen(WC->ugname) > 0) && (strcasecmp(WC->ugname, WC->wc_roomname))) {
351 wprintf("<TD VALIGN=TOP><A HREF=\"/ungoto\">");
352 wprintf("<IMG SRC=\"/static/back.gif\" BORDER=0></A></TD>");
354 wprintf("<TD VALIGN=TOP><FONT FACE=\"Arial,Helvetica,sans-serif\"><FONT SIZE=+2>%s</FONT><BR>", WC->wc_roomname);
355 wprintf("%d new of %d messages</FONT></TD>\n",
356 extract_int(&got[4], 1),
357 extract_int(&got[4], 2));
359 /* Display room graphic. The server doesn't actually
360 * need the room name, but we supply it in order to
361 * keep the browser from using a cached graphic from
364 serv_puts("OIMG _roompic_");
367 wprintf("<TD><FONT FACE=\"Arial,Helvetica,sans-serif\">");
368 wprintf("<IMG SRC=\"/image&name=_roompic_&room=");
369 urlescputs(WC->wc_roomname);
370 wprintf("\"></FONT></TD>");
374 wprintf("<TD VALIGN=TOP><FONT FACE=\"Arial,Helvetica,sans-serif\">");
376 wprintf("</FONT></TD>");
378 /* Let the user know if new mail has arrived */
379 if ( (WC->new_mail > remember_new_mail) && (WC->new_mail>0) ) {
380 wprintf("<TD VALIGN=TOP>"
381 "<IMG SRC=\"/static/mail.gif\" border=0 "
382 "ALT=\"You have new mail\">"
383 "<BR><BLINK>%d</BLINK></TD>", WC->new_mail);
384 remember_new_mail = WC->new_mail;
387 wprintf("<TD VALIGN=TOP><A HREF=\"/gotonext\">");
388 wprintf("<IMG SRC=\"/static/forward.gif\" border=0></A></TD>");
389 wprintf("</TR></TABLE></CENTER>\n");
397 * generic routine to take the session to a new room
399 * display_name values: 0 = goto only
400 * 1 = goto and display
403 void gotoroom(char *gname, int display_name)
406 static long ls = (-1L);
411 wprintf("Pragma: no-cache\n");
412 wprintf("Cache-Control: no-store\n");
414 wprintf("<HTML><HEAD>\n"
415 "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n"
417 wprintf("BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\n");
419 if (display_name != 2) {
420 /* store ungoto information */
421 strcpy(WC->ugname, WC->wc_roomname);
424 /* move to the new room */
425 serv_printf("GOTO %s", gname);
428 serv_puts("GOTO _BASEROOM_");
433 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
438 extract(WC->wc_roomname, &buf[4], 0);
439 WC->room_flags = extract_int(&buf[4], 4);
440 /* highest_msg_read = extract_int(&buf[4],6);
441 maxmsgnum = extract_int(&buf[4],5);
442 is_mail = (char) extract_int(&buf[4],7); */
443 ls = extract_long(&buf[4], 6);
446 WC->is_room_aide = WC->is_aide;
448 WC->is_room_aide = (char) extract_int(&buf[4], 8);
450 remove_march(WC->wc_roomname);
451 if (!strcasecmp(gname, "_BASEROOM_"))
454 /* Display the room banner */
456 embed_room_banner(buf);
459 strcpy(WC->wc_roomname, WC->wc_roomname);
464 * Locate the room on the march list which we most want to go to. Each room
465 * is measured given a "weight" of preference based on various factors.
467 char *pop_march(int desired_floor)
469 static char TheRoom[64];
471 int TheOrder = 32767;
474 struct march *mptr = NULL;
476 strcpy(TheRoom, "_BASEROOM_");
480 for (mptr = march; mptr != NULL; mptr = mptr->next) {
482 if ((strcasecmp(mptr->march_name, "_BASEROOM_")))
483 weight = weight + 10000;
484 if (mptr->march_floor == desired_floor)
485 weight = weight + 5000;
487 weight = weight + ((128 - (mptr->march_floor)) * 128);
488 weight = weight + (128 - (mptr->march_order));
490 if (weight > TheWeight) {
492 strcpy(TheRoom, mptr->march_name);
493 TheFloor = mptr->march_floor;
494 TheOrder = mptr->march_order;
502 /* Goto next room having unread messages.
503 * We want to skip over rooms that the user has already been to, and take the
504 * user back to the lobby when done. The room we end up in is placed in
505 * newroom - which is set to 0 (the lobby) initially.
506 * We start the search in the current room rather than the beginning to prevent
507 * two or more concurrent users from dragging each other back to the same room.
512 struct march *mptr, *mptr2;
515 /* First check to see if the march-mode list is already allocated.
516 * If it is, pop the first room off the list and go there.
523 while (serv_gets(buf), strcmp(buf, "000")) {
524 mptr = (struct march *) malloc(sizeof(struct march));
526 extract(mptr->march_name, buf, 0);
527 mptr->march_floor = extract_int(buf, 2);
528 mptr->march_order = extract_int(buf, 3);
533 while (mptr2->next != NULL)
538 /* add _BASEROOM_ to the end of the march list, so the user will end up
539 * in the system base room (usually the Lobby>) at the end of the loop
541 mptr = (struct march *) malloc(sizeof(struct march));
543 strcpy(mptr->march_name, "_BASEROOM_");
548 while (mptr2->next != NULL)
553 * ...and remove the room we're currently in, so a <G>oto doesn't make us
554 * walk around in circles
556 remove_march(WC->wc_roomname);
559 strcpy(next_room, pop_march(-1));
561 strcpy(next_room, "_BASEROOM_");
565 smart_goto(next_room);
569 void smart_goto(char *next_room) {
570 gotoroom(next_room, 0);
577 * mark all messages in current room as having been read
579 void slrp_highest(void)
584 serv_puts("SLRP HIGHEST");
587 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
594 * un-goto the previous room
600 if (!strcmp(WC->ugname, "")) {
601 smart_goto(WC->wc_roomname);
604 serv_printf("GOTO %s", WC->ugname);
607 smart_goto(WC->wc_roomname);
610 if (WC->uglsn >= 0L) {
611 serv_printf("SLRP %ld", WC->uglsn);
614 strcpy(buf, WC->ugname);
615 strcpy(WC->ugname, "");
620 * display the form for editing a room
622 void display_editroom(void)
626 char er_password[10];
628 char er_roomaide[26];
637 display_error(&buf[4]);
640 extract(er_name, &buf[4], 0);
641 extract(er_password, &buf[4], 1);
642 extract(er_dirname, &buf[4], 2);
643 er_flags = extract_int(&buf[4], 3);
644 er_floor = extract_int(&buf[4], 4);
649 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
650 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
651 wprintf("<B>Room administration</B>\n");
652 wprintf("</FONT></TD></TR></TABLE>\n");
655 "<LI><A HREF=\"/confirm_delete_room\">\n"
656 "Delete this room</A>\n"
657 "<LI><A HREF=\"/display_editroompic\">\n"
658 "Set or change the graphic for this room's banner</A>\n"
659 "<LI><A HREF=\"/display_editinfo\">\n"
660 "Edit this room's Info file</A>\n"
663 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
664 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
665 wprintf("<B>Room editing</B>\n");
666 wprintf("</FONT></TD></TR></TABLE>\n");
668 wprintf("<FORM METHOD=\"POST\" ACTION=\"/editroom\">\n");
670 wprintf("<UL><LI>Name of room: ");
671 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", er_name);
673 wprintf("<LI>Resides on floor: ");
675 wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
676 for (i = 0; i < 128; ++i)
677 if (strlen(floorlist[i]) > 0) {
680 wprintf("SELECTED ");
681 wprintf("VALUE=\"%d\">", i);
682 escputs(floorlist[i]);
683 wprintf("</OPTION>\n");
685 wprintf("</SELECT>\n");
687 wprintf("<LI>Type of room:<UL>\n");
689 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
690 if ((er_flags & QR_PRIVATE) == 0)
692 wprintf("> Public room\n");
694 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
695 if ((er_flags & QR_PRIVATE) &&
696 (er_flags & QR_GUESSNAME))
698 wprintf("> Private - guess name\n");
700 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
701 if ((er_flags & QR_PRIVATE) &&
702 (er_flags & QR_PASSWORDED))
704 wprintf("> Private - require password:\n");
705 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" VALUE=\"%s\" MAXLENGTH=\"9\">\n", er_password);
707 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
708 if ((er_flags & QR_PRIVATE)
709 && ((er_flags & QR_GUESSNAME) == 0)
710 && ((er_flags & QR_PASSWORDED) == 0))
712 wprintf("> Private - invitation only\n");
714 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"bump\" VALUE=\"yes\" ");
715 wprintf("> If private, cause current users to forget room\n");
719 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"prefonly\" VALUE=\"yes\" ");
720 if (er_flags & QR_PREFONLY)
722 wprintf("> Preferred users only\n");
724 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"readonly\" VALUE=\"yes\" ");
725 if (er_flags & QR_READONLY)
727 wprintf("> Read-only room\n");
729 /* directory stuff */
730 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"directory\" VALUE=\"yes\" ");
731 if (er_flags & QR_DIRECTORY)
733 wprintf("> File directory room\n");
735 wprintf("<UL><LI>Directory name: ");
736 wprintf("<INPUT TYPE=\"text\" NAME=\"er_dirname\" VALUE=\"%s\" MAXLENGTH=\"14\">\n", er_dirname);
738 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"ulallowed\" VALUE=\"yes\" ");
739 if (er_flags & QR_UPLOAD)
741 wprintf("> Uploading allowed\n");
743 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"dlallowed\" VALUE=\"yes\" ");
744 if (er_flags & QR_DOWNLOAD)
746 wprintf("> Downloading allowed\n");
748 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"visdir\" VALUE=\"yes\" ");
749 if (er_flags & QR_VISDIR)
751 wprintf("> Visible directory</UL>\n");
753 /* end of directory stuff */
755 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"network\" VALUE=\"yes\" ");
756 if (er_flags & QR_NETWORK)
758 wprintf("> Network shared room\n");
760 /* start of anon options */
762 wprintf("<LI>Anonymous messages<UL>\n");
764 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"no\" ");
765 if (((er_flags & QR_ANONONLY) == 0)
766 && ((er_flags & QR_ANONOPT) == 0))
768 wprintf("> No anonymous messages\n");
770 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anononly\" ");
771 if (er_flags & QR_ANONONLY)
773 wprintf("> All messages are anonymous\n");
775 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anon2\" ");
776 if (er_flags & QR_ANONOPT)
778 wprintf("> Prompt user when entering messages</UL>\n");
780 /* end of anon options */
782 wprintf("<LI>Room aide: \n");
786 wprintf("<EM>%s</EM>\n", &buf[4]);
788 extract(er_roomaide, &buf[4], 0);
789 wprintf("<INPUT TYPE=\"text\" NAME=\"er_roomaide\" VALUE=\"%s\" MAXLENGTH=\"25\">\n", er_roomaide);
792 wprintf("</UL><CENTER>\n");
793 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
794 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
795 wprintf("</CENTER>\n");
802 * save new parameters for a room
808 char er_password[10];
810 char er_roomaide[26];
816 if (strcmp(bstr("sc"), "OK")) {
817 display_error("Cancelled. Changes were not saved.");
824 display_error(&buf[4]);
827 extract(er_name, &buf[4], 0);
828 extract(er_password, &buf[4], 1);
829 extract(er_dirname, &buf[4], 2);
830 er_flags = extract_int(&buf[4], 3);
832 strcpy(er_roomaide, bstr("er_roomaide"));
833 if (strlen(er_roomaide) == 0) {
837 strcpy(er_roomaide, "");
839 extract(er_roomaide, &buf[4], 0);
842 strcpy(buf, bstr("er_name"));
845 strcpy(er_name, buf);
847 strcpy(buf, bstr("er_password"));
850 strcpy(er_password, buf);
852 strcpy(buf, bstr("er_dirname"));
855 strcpy(er_dirname, buf);
857 strcpy(buf, bstr("type"));
858 er_flags &= !(QR_PRIVATE | QR_PASSWORDED | QR_GUESSNAME);
860 if (!strcmp(buf, "invonly")) {
861 er_flags |= (QR_PRIVATE);
863 if (!strcmp(buf, "guessname")) {
864 er_flags |= (QR_PRIVATE | QR_GUESSNAME);
866 if (!strcmp(buf, "passworded")) {
867 er_flags |= (QR_PRIVATE | QR_PASSWORDED);
869 if (!strcmp(bstr("prefonly"), "yes")) {
870 er_flags |= QR_PREFONLY;
872 er_flags &= ~QR_PREFONLY;
875 if (!strcmp(bstr("readonly"), "yes")) {
876 er_flags |= QR_READONLY;
878 er_flags &= ~QR_READONLY;
881 if (!strcmp(bstr("network"), "yes")) {
882 er_flags |= QR_NETWORK;
884 er_flags &= ~QR_NETWORK;
887 if (!strcmp(bstr("directory"), "yes")) {
888 er_flags |= QR_DIRECTORY;
890 er_flags &= ~QR_DIRECTORY;
893 if (!strcmp(bstr("ulallowed"), "yes")) {
894 er_flags |= QR_UPLOAD;
896 er_flags &= ~QR_UPLOAD;
899 if (!strcmp(bstr("dlallowed"), "yes")) {
900 er_flags |= QR_DOWNLOAD;
902 er_flags &= ~QR_DOWNLOAD;
905 if (!strcmp(bstr("visdir"), "yes")) {
906 er_flags |= QR_VISDIR;
908 er_flags &= ~QR_VISDIR;
911 strcpy(buf, bstr("anon"));
913 er_flags &= ~(QR_ANONONLY | QR_ANONOPT);
914 if (!strcmp(buf, "anononly"))
915 er_flags |= QR_ANONONLY;
916 if (!strcmp(buf, "anon2"))
917 er_flags |= QR_ANONOPT;
920 if (!strcmp(bstr("bump"), "yes"))
923 er_floor = atoi(bstr("er_floor"));
925 sprintf(buf, "SETR %s|%s|%s|%u|%d|%d",
926 er_name, er_password, er_dirname, er_flags, bump, er_floor);
930 display_error(&buf[4]);
933 gotoroom(er_name, 0);
935 if (strlen(er_roomaide) > 0) {
936 sprintf(buf, "SETA %s", er_roomaide);
940 display_error(&buf[4]);
950 * display the form for entering a new room
952 void display_entroom(void)
960 display_error(&buf[4]);
965 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
966 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
967 wprintf("<B>Enter (create) a new room</B>\n");
968 wprintf("</FONT></TD></TR></TABLE>\n");
970 wprintf("<FORM METHOD=\"POST\" ACTION=\"/entroom\">\n");
972 wprintf("<UL><LI>Name of room: ");
973 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" MAXLENGTH=\"19\">\n");
975 wprintf("<LI>Type of room:<UL>\n");
977 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
978 wprintf("CHECKED > Public room\n");
980 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
981 wprintf("> Private - guess name\n");
983 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
984 wprintf("> Private - require password:\n");
985 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" MAXLENGTH=\"9\">\n");
987 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
988 wprintf("> Private - invitation only\n");
990 wprintf("<CENTER>\n");
991 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
992 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
993 wprintf("</CENTER>\n");
994 wprintf("</FORM>\n");
1008 char er_password[10];
1011 if (strcmp(bstr("sc"), "OK")) {
1012 display_error("Cancelled. No new room was created.");
1015 strcpy(er_name, bstr("er_name"));
1016 strcpy(er_type, bstr("type"));
1017 strcpy(er_password, bstr("er_password"));
1020 if (!strcmp(er_type, "guessname"))
1022 if (!strcmp(er_type, "passworded"))
1024 if (!strcmp(er_type, "invonly"))
1027 sprintf(buf, "CRE8 1|%s|%d|%s", er_name, er_num_type, er_password);
1030 if (buf[0] != '2') {
1031 display_error(&buf[4]);
1034 smart_goto(er_name);
1039 * display the screen to enter a private room
1041 void display_private(char *rname, int req_pass)
1046 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1047 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1048 wprintf("<B>Goto a private room</B>\n");
1049 wprintf("</FONT></TD></TR></TABLE>\n");
1051 wprintf("<CENTER>\n");
1052 wprintf("If you know the name of a hidden (guess-name) or\n");
1053 wprintf("passworded room, you can enter that room by typing\n");
1054 wprintf("its name below. Once you gain access to a private\n");
1055 wprintf("room, it will appear in your regular room listings\n");
1056 wprintf("so you don't have to keep returning here.\n");
1057 wprintf("<BR><BR>");
1059 wprintf("<FORM METHOD=\"POST\" ACTION=\"/goto_private\">\n");
1061 wprintf("<TABLE border><TR><TD>");
1062 wprintf("Enter room name:</TD><TD>");
1063 wprintf("<INPUT TYPE=\"text\" NAME=\"gr_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", rname);
1066 wprintf("</TD></TR><TR><TD>");
1067 wprintf("Enter room password:</TD><TD>");
1068 wprintf("<INPUT TYPE=\"password\" NAME=\"gr_pass\" MAXLENGTH=\"9\">\n");
1070 wprintf("</TD></TR></TABLE>\n");
1072 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1073 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1074 wprintf("</FORM>\n");
1079 * goto a private room
1081 void goto_private(void)
1086 if (strcasecmp(bstr("sc"), "OK")) {
1087 display_main_menu();
1090 strcpy(hold_rm, WC->wc_roomname);
1091 strcpy(buf, "GOTO ");
1092 strcat(buf, bstr("gr_name"));
1094 strcat(buf, bstr("gr_pass"));
1098 if (buf[0] == '2') {
1099 smart_goto(bstr("gr_name"));
1102 if (!strncmp(buf, "540", 3)) {
1103 display_private(bstr("gr_name"), 1);
1107 wprintf("%s\n", &buf[4]);
1114 * display the screen to zap a room
1116 void display_zap(void)
1120 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1121 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1122 wprintf("<B>Zap (forget) the current room</B>\n");
1123 wprintf("</FONT></TD></TR></TABLE>\n");
1125 wprintf("If you select this option, <em>%s</em> will ", WC->wc_roomname);
1126 wprintf("disappear from your room list. Is this what you wish ");
1127 wprintf("to do?<BR>\n");
1129 wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\">\n");
1130 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1131 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1132 wprintf("</FORM>\n");
1143 char final_destination[256];
1145 /* If the forget-room routine fails for any reason, we fall back
1146 * to the current room; otherwise, we go to the Lobby
1148 strcpy(final_destination, WC->wc_roomname);
1150 if (!strcasecmp(bstr("sc"), "OK")) {
1151 serv_printf("GOTO %s", WC->wc_roomname);
1153 if (buf[0] != '2') {
1154 ExpressMessageCat(&buf[4]);
1158 if (buf[0] != '2') {
1159 ExpressMessageCat(&buf[4]);
1161 strcpy(final_destination, "_BASEROOM_");
1165 smart_goto(final_destination);
1172 * Confirm deletion of the current room
1174 void confirm_delete_room(void)
1178 serv_puts("KILL 0");
1180 if (buf[0] != '2') {
1181 display_error(&buf[4]);
1185 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1186 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1187 wprintf("<B>Confirm deletion of room</B>\n");
1188 wprintf("</FONT></TD></TR></TABLE>\n");
1190 wprintf("<CENTER>");
1191 wprintf("<FORM METHOD=\"POST\" ACTION=\"/delete_room\">\n");
1193 wprintf("Are you sure you want to delete <FONT SIZE=+1>");
1194 escputs(WC->wc_roomname);
1195 wprintf("</FONT>?<BR>\n");
1197 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Delete\">");
1198 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1200 wprintf("</FORM></CENTER>\n");
1206 * Delete the current room
1208 void delete_room(void)
1213 strcpy(sc, bstr("sc"));
1215 if (strcasecmp(sc, "Delete")) {
1216 display_error("Cancelled. This room was not deleted.");
1219 serv_puts("KILL 1");
1221 if (buf[0] != '2') {
1222 display_error(&buf[4]);
1224 smart_goto("_BASEROOM_");