10 #include <sys/types.h>
12 #include <sys/socket.h>
15 #include <netinet/in.h>
31 char floorlist[128][256];
35 * load the list of floors
37 void load_floorlist(void)
42 for (a = 0; a < 128; ++a)
48 strcpy(floorlist[0], "Main Floor");
51 while (serv_gets(buf), strcmp(buf, "000")) {
52 extract(floorlist[extract_int(buf, 0)], buf, 1);
58 * remove a room from the march list
60 void remove_march(char *aaa)
62 struct march *mptr, *mptr2;
64 if (WC->march == NULL)
67 if (!strcasecmp(WC->march->march_name, aaa)) {
68 mptr = WC->march->next;
74 for (mptr = WC->march; mptr != NULL; mptr = mptr->next) {
75 if (!strcasecmp(mptr->march_name, aaa)) {
76 mptr2->next = mptr->next;
89 void room_tree_list(struct roomlisting *rp)
97 if (rp->lnext != NULL) {
98 room_tree_list(rp->lnext);
100 strcpy(rmname, rp->rlname);
103 wprintf("<A HREF=\"/dotgoto&room=");
108 if ((f & QR_DIRECTORY) && (f & QR_NETWORK))
110 else if (f & QR_DIRECTORY)
112 else if (f & QR_NETWORK)
116 wprintf("</A><TT> </TT>\n");
118 if (rp->rnext != NULL) {
119 room_tree_list(rp->rnext);
126 * Room ordering stuff (compare first by floor, then by order)
128 int rordercmp(struct roomlisting *r1, struct roomlisting *r2)
130 if ((r1 == NULL) && (r2 == NULL))
136 if (r1->rlfloor < r2->rlfloor)
138 if (r1->rlfloor > r2->rlfloor)
140 if (r1->rlorder < r2->rlorder)
142 if (r1->rlorder > r2->rlorder)
149 * Common code for all room listings
151 void listrms(char *variety)
156 struct roomlisting *rl = NULL;
157 struct roomlisting *rp;
158 struct roomlisting *rs;
161 /* Ask the server for a room list */
168 while (serv_gets(buf), strcmp(buf, "000")) {
170 rp = malloc(sizeof(struct roomlisting));
171 extract(rp->rlname, buf, 0);
172 rp->rlflags = extract_int(buf, 1);
173 rp->rlfloor = extract_int(buf, 2);
174 rp->rlorder = extract_int(buf, 3);
183 if (rordercmp(rp, rs) < 0) {
184 if (rs->lnext == NULL) {
191 if (rs->rnext == NULL) {
203 /* If no rooms were listed, print an nbsp to make the cell
204 * borders show up anyway.
206 if (num_rooms == 0) wprintf(" ");
218 * list all rooms by floor
220 void list_all_rooms_by_floor(void)
229 wprintf("<TABLE width=100% border><TR><TH>Floor</TH>");
230 wprintf("<TH>Rooms with new messages</TH>");
231 wprintf("<TH>Rooms with no new messages</TH></TR>\n");
233 for (a = 0; a < 128; ++a)
234 if (floorlist[a][0] != 0) {
236 /* Floor name column */
239 serv_printf("OIMG _floorpic_|%d", a);
244 wprintf("<IMG SRC=\"/image&name=_floorpic_&parm=%d\" ALT=\"%s\">",
245 a, &floorlist[a][0]);
247 escputs(&floorlist[a][0]);
252 /* Rooms with new messages column */
254 sprintf(buf, "LKRN %d", a);
256 wprintf("</TD>\n<TD>");
258 /* Rooms with old messages column */
259 sprintf(buf, "LKRO %d", a);
261 wprintf("</TD></TR>\n");
263 wprintf("</TABLE>\n");
269 * list all forgotten rooms
271 void zapped_list(void)
274 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
275 wprintf("SIZE=+1 COLOR=\"FFFFFF\"");
276 wprintf("<B>Zapped (forgotten) rooms</B>\n");
277 wprintf("</TD></TR></TABLE><BR>\n");
279 wprintf("<BR><BR>\n");
280 wprintf("Click on any room to un-zap it and goto that room.\n");
286 * read this room's info file (set v to 1 for verbose mode)
298 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
304 void embed_room_banner(char *got) {
307 static int remember_new_mail = (-1);
309 /* We need to have the information returned by a GOTO server command.
310 * If it isn't supplied, we fake it by issuing our own GOTO.
313 serv_printf("GOTO %s", WC->wc_roomname);
318 /* Check for new mail. */
319 WC->new_mail = extract_int(&got[4], 9);
321 /* Now start spewing HTML. */
322 wprintf("<CENTER><TABLE border=0><TR>");
324 if ((strlen(WC->ugname) > 0) && (strcasecmp(WC->ugname, WC->wc_roomname))) {
325 wprintf("<TD VALIGN=TOP><A HREF=\"/ungoto\">");
326 wprintf("<IMG SRC=\"/static/back.gif\" BORDER=0></A></TD>");
328 wprintf("<TD VALIGN=TOP><FONT SIZE=+2>%s</FONT><BR>", WC->wc_roomname);
329 wprintf("%d new of %d messages</TD>\n",
330 extract_int(&got[4], 1),
331 extract_int(&got[4], 2));
333 /* Display room graphic. The server doesn't actually
334 * need the room name, but we supply it in order to
335 * keep the browser from using a cached graphic from
338 serv_puts("OIMG _roompic_");
342 wprintf("<IMG SRC=\"/image&name=_roompic_&room=");
343 urlescputs(WC->wc_roomname);
348 wprintf("<TD VALIGN=TOP>");
352 /* Let the user know if new mail has arrived */
353 if ( (WC->new_mail > remember_new_mail) && (WC->new_mail>0) ) {
354 wprintf("<TD VALIGN=TOP>"
355 "<IMG SRC=\"/static/mail.gif\" border=0 "
356 "ALT=\"You have new mail\">"
357 "<BR><BLINK>%d</BLINK></TD>", WC->new_mail);
358 remember_new_mail = WC->new_mail;
361 wprintf("<TD VALIGN=TOP><A HREF=\"/gotonext\">");
362 wprintf("<IMG SRC=\"/static/forward.gif\" border=0></A></TD>");
363 wprintf("</TR></TABLE></CENTER>\n");
371 * generic routine to take the session to a new room
373 * display_name values: 0 = goto only
374 * 1 = goto and display
377 void gotoroom(char *gname, int display_name)
380 static long ls = (-1L);
385 wprintf("Pragma: no-cache\n");
386 wprintf("Cache-Control: no-store\n");
388 wprintf("<HTML><HEAD>\n"
389 "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n"
391 wprintf("BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\n");
393 if (display_name != 2) {
394 /* store ungoto information */
395 strcpy(WC->ugname, WC->wc_roomname);
398 /* move to the new room */
399 serv_printf("GOTO %s", gname);
402 serv_puts("GOTO _BASEROOM_");
407 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
412 extract(WC->wc_roomname, &buf[4], 0);
413 WC->room_flags = extract_int(&buf[4], 4);
414 /* highest_msg_read = extract_int(&buf[4],6);
415 maxmsgnum = extract_int(&buf[4],5);
416 is_mail = (char) extract_int(&buf[4],7); */
417 ls = extract_long(&buf[4], 6);
420 WC->is_room_aide = WC->is_aide;
422 WC->is_room_aide = (char) extract_int(&buf[4], 8);
424 remove_march(WC->wc_roomname);
425 if (!strcasecmp(gname, "_BASEROOM_"))
428 /* Display the room banner */
430 embed_room_banner(buf);
433 strcpy(WC->wc_roomname, WC->wc_roomname);
438 * Locate the room on the march list which we most want to go to. Each room
439 * is measured given a "weight" of preference based on various factors.
441 char *pop_march(int desired_floor)
443 static char TheRoom[64];
445 int TheOrder = 32767;
448 struct march *mptr = NULL;
450 strcpy(TheRoom, "_BASEROOM_");
451 if (WC->march == NULL)
454 for (mptr = WC->march; mptr != NULL; mptr = mptr->next) {
456 if ((strcasecmp(mptr->march_name, "_BASEROOM_")))
457 weight = weight + 10000;
458 if (mptr->march_floor == desired_floor)
459 weight = weight + 5000;
461 weight = weight + ((128 - (mptr->march_floor)) * 128);
462 weight = weight + (128 - (mptr->march_order));
464 if (weight > TheWeight) {
466 strcpy(TheRoom, mptr->march_name);
467 TheFloor = mptr->march_floor;
468 TheOrder = mptr->march_order;
476 /* Goto next room having unread messages.
477 * We want to skip over rooms that the user has already been to, and take the
478 * user back to the lobby when done. The room we end up in is placed in
479 * newroom - which is set to 0 (the lobby) initially.
480 * We start the search in the current room rather than the beginning to prevent
481 * two or more concurrent users from dragging each other back to the same room.
486 struct march *mptr, *mptr2;
489 /* First check to see if the march-mode list is already allocated.
490 * If it is, pop the first room off the list and go there.
493 if (WC->march == NULL) {
497 while (serv_gets(buf), strcmp(buf, "000")) {
498 mptr = (struct march *) malloc(sizeof(struct march));
500 extract(mptr->march_name, buf, 0);
501 mptr->march_floor = extract_int(buf, 2);
502 mptr->march_order = extract_int(buf, 3);
503 if (WC->march == NULL) {
507 while (mptr2->next != NULL)
512 /* add _BASEROOM_ to the end of the march list, so the user will end up
513 * in the system base room (usually the Lobby>) at the end of the loop
515 mptr = (struct march *) malloc(sizeof(struct march));
517 strcpy(mptr->march_name, "_BASEROOM_");
518 if (WC->march == NULL) {
522 while (mptr2->next != NULL)
527 * ...and remove the room we're currently in, so a <G>oto doesn't make us
528 * walk around in circles
530 remove_march(WC->wc_roomname);
532 if (WC->march != NULL) {
533 strcpy(next_room, pop_march(-1));
535 strcpy(next_room, "_BASEROOM_");
539 smart_goto(next_room);
543 void smart_goto(char *next_room) {
544 gotoroom(next_room, 0);
551 * mark all messages in current room as having been read
553 void slrp_highest(void)
558 serv_puts("SLRP HIGHEST");
561 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
568 * un-goto the previous room
574 if (!strcmp(WC->ugname, "")) {
575 smart_goto(WC->wc_roomname);
578 serv_printf("GOTO %s", WC->ugname);
581 smart_goto(WC->wc_roomname);
584 if (WC->uglsn >= 0L) {
585 serv_printf("SLRP %ld", WC->uglsn);
588 strcpy(buf, WC->ugname);
589 strcpy(WC->ugname, "");
594 * display the form for editing a room
596 void display_editroom(void)
600 char er_password[10];
602 char er_roomaide[26];
611 display_error(&buf[4]);
614 extract(er_name, &buf[4], 0);
615 extract(er_password, &buf[4], 1);
616 extract(er_dirname, &buf[4], 2);
617 er_flags = extract_int(&buf[4], 3);
618 er_floor = extract_int(&buf[4], 4);
623 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
624 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
625 wprintf("<B>Room administration</B>\n");
626 wprintf("</FONT></TD></TR></TABLE>\n");
629 "<LI><A HREF=\"/confirm_delete_room\">\n"
630 "Delete this room</A>\n"
631 "<LI><A HREF=\"/display_editroompic\">\n"
632 "Set or change the graphic for this room's banner</A>\n"
633 "<LI><A HREF=\"/display_editinfo\">\n"
634 "Edit this room's Info file</A>\n"
637 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
638 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
639 wprintf("<B>Room editing</B>\n");
640 wprintf("</FONT></TD></TR></TABLE>\n");
642 wprintf("<FORM METHOD=\"POST\" ACTION=\"/editroom\">\n");
644 wprintf("<UL><LI>Name of room: ");
645 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", er_name);
647 wprintf("<LI>Resides on floor: ");
649 wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
650 for (i = 0; i < 128; ++i)
651 if (strlen(floorlist[i]) > 0) {
654 wprintf("SELECTED ");
655 wprintf("VALUE=\"%d\">", i);
656 escputs(floorlist[i]);
657 wprintf("</OPTION>\n");
659 wprintf("</SELECT>\n");
661 wprintf("<LI>Type of room:<UL>\n");
663 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
664 if ((er_flags & QR_PRIVATE) == 0)
666 wprintf("> Public room\n");
668 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
669 if ((er_flags & QR_PRIVATE) &&
670 (er_flags & QR_GUESSNAME))
672 wprintf("> Private - guess name\n");
674 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
675 if ((er_flags & QR_PRIVATE) &&
676 (er_flags & QR_PASSWORDED))
678 wprintf("> Private - require password:\n");
679 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" VALUE=\"%s\" MAXLENGTH=\"9\">\n", er_password);
681 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
682 if ((er_flags & QR_PRIVATE)
683 && ((er_flags & QR_GUESSNAME) == 0)
684 && ((er_flags & QR_PASSWORDED) == 0))
686 wprintf("> Private - invitation only\n");
688 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"bump\" VALUE=\"yes\" ");
689 wprintf("> If private, cause current users to forget room\n");
693 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"prefonly\" VALUE=\"yes\" ");
694 if (er_flags & QR_PREFONLY)
696 wprintf("> Preferred users only\n");
698 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"readonly\" VALUE=\"yes\" ");
699 if (er_flags & QR_READONLY)
701 wprintf("> Read-only room\n");
703 /* directory stuff */
704 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"directory\" VALUE=\"yes\" ");
705 if (er_flags & QR_DIRECTORY)
707 wprintf("> File directory room\n");
709 wprintf("<UL><LI>Directory name: ");
710 wprintf("<INPUT TYPE=\"text\" NAME=\"er_dirname\" VALUE=\"%s\" MAXLENGTH=\"14\">\n", er_dirname);
712 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"ulallowed\" VALUE=\"yes\" ");
713 if (er_flags & QR_UPLOAD)
715 wprintf("> Uploading allowed\n");
717 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"dlallowed\" VALUE=\"yes\" ");
718 if (er_flags & QR_DOWNLOAD)
720 wprintf("> Downloading allowed\n");
722 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"visdir\" VALUE=\"yes\" ");
723 if (er_flags & QR_VISDIR)
725 wprintf("> Visible directory</UL>\n");
727 /* end of directory stuff */
729 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"network\" VALUE=\"yes\" ");
730 if (er_flags & QR_NETWORK)
732 wprintf("> Network shared room\n");
734 /* start of anon options */
736 wprintf("<LI>Anonymous messages<UL>\n");
738 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"no\" ");
739 if (((er_flags & QR_ANONONLY) == 0)
740 && ((er_flags & QR_ANONOPT) == 0))
742 wprintf("> No anonymous messages\n");
744 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anononly\" ");
745 if (er_flags & QR_ANONONLY)
747 wprintf("> All messages are anonymous\n");
749 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anon2\" ");
750 if (er_flags & QR_ANONOPT)
752 wprintf("> Prompt user when entering messages</UL>\n");
754 /* end of anon options */
756 wprintf("<LI>Room aide: \n");
760 wprintf("<EM>%s</EM>\n", &buf[4]);
762 extract(er_roomaide, &buf[4], 0);
763 wprintf("<INPUT TYPE=\"text\" NAME=\"er_roomaide\" VALUE=\"%s\" MAXLENGTH=\"25\">\n", er_roomaide);
766 wprintf("</UL><CENTER>\n");
767 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
768 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
769 wprintf("</CENTER>\n");
776 * save new parameters for a room
782 char er_password[10];
784 char er_roomaide[26];
790 if (strcmp(bstr("sc"), "OK")) {
791 display_error("Cancelled. Changes were not saved.");
798 display_error(&buf[4]);
801 extract(er_name, &buf[4], 0);
802 extract(er_password, &buf[4], 1);
803 extract(er_dirname, &buf[4], 2);
804 er_flags = extract_int(&buf[4], 3);
806 strcpy(er_roomaide, bstr("er_roomaide"));
807 if (strlen(er_roomaide) == 0) {
811 strcpy(er_roomaide, "");
813 extract(er_roomaide, &buf[4], 0);
816 strcpy(buf, bstr("er_name"));
819 strcpy(er_name, buf);
821 strcpy(buf, bstr("er_password"));
824 strcpy(er_password, buf);
826 strcpy(buf, bstr("er_dirname"));
829 strcpy(er_dirname, buf);
831 strcpy(buf, bstr("type"));
832 er_flags &= !(QR_PRIVATE | QR_PASSWORDED | QR_GUESSNAME);
834 if (!strcmp(buf, "invonly")) {
835 er_flags |= (QR_PRIVATE);
837 if (!strcmp(buf, "guessname")) {
838 er_flags |= (QR_PRIVATE | QR_GUESSNAME);
840 if (!strcmp(buf, "passworded")) {
841 er_flags |= (QR_PRIVATE | QR_PASSWORDED);
843 if (!strcmp(bstr("prefonly"), "yes")) {
844 er_flags |= QR_PREFONLY;
846 er_flags &= ~QR_PREFONLY;
849 if (!strcmp(bstr("readonly"), "yes")) {
850 er_flags |= QR_READONLY;
852 er_flags &= ~QR_READONLY;
855 if (!strcmp(bstr("network"), "yes")) {
856 er_flags |= QR_NETWORK;
858 er_flags &= ~QR_NETWORK;
861 if (!strcmp(bstr("directory"), "yes")) {
862 er_flags |= QR_DIRECTORY;
864 er_flags &= ~QR_DIRECTORY;
867 if (!strcmp(bstr("ulallowed"), "yes")) {
868 er_flags |= QR_UPLOAD;
870 er_flags &= ~QR_UPLOAD;
873 if (!strcmp(bstr("dlallowed"), "yes")) {
874 er_flags |= QR_DOWNLOAD;
876 er_flags &= ~QR_DOWNLOAD;
879 if (!strcmp(bstr("visdir"), "yes")) {
880 er_flags |= QR_VISDIR;
882 er_flags &= ~QR_VISDIR;
885 strcpy(buf, bstr("anon"));
887 er_flags &= ~(QR_ANONONLY | QR_ANONOPT);
888 if (!strcmp(buf, "anononly"))
889 er_flags |= QR_ANONONLY;
890 if (!strcmp(buf, "anon2"))
891 er_flags |= QR_ANONOPT;
894 if (!strcmp(bstr("bump"), "yes"))
897 er_floor = atoi(bstr("er_floor"));
899 sprintf(buf, "SETR %s|%s|%s|%u|%d|%d",
900 er_name, er_password, er_dirname, er_flags, bump, er_floor);
904 display_error(&buf[4]);
907 gotoroom(er_name, 0);
909 if (strlen(er_roomaide) > 0) {
910 sprintf(buf, "SETA %s", er_roomaide);
914 display_error(&buf[4]);
924 * display the form for entering a new room
926 void display_entroom(void)
934 display_error(&buf[4]);
939 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
940 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
941 wprintf("<B>Enter (create) a new room</B>\n");
942 wprintf("</FONT></TD></TR></TABLE>\n");
944 wprintf("<FORM METHOD=\"POST\" ACTION=\"/entroom\">\n");
946 wprintf("<UL><LI>Name of room: ");
947 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" MAXLENGTH=\"19\">\n");
949 wprintf("<LI>Type of room:<UL>\n");
951 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
952 wprintf("CHECKED > Public room\n");
954 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
955 wprintf("> Private - guess name\n");
957 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
958 wprintf("> Private - require password:\n");
959 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" MAXLENGTH=\"9\">\n");
961 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
962 wprintf("> Private - invitation only\n");
964 wprintf("<CENTER>\n");
965 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
966 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
967 wprintf("</CENTER>\n");
968 wprintf("</FORM>\n");
982 char er_password[10];
985 if (strcmp(bstr("sc"), "OK")) {
986 display_error("Cancelled. No new room was created.");
989 strcpy(er_name, bstr("er_name"));
990 strcpy(er_type, bstr("type"));
991 strcpy(er_password, bstr("er_password"));
994 if (!strcmp(er_type, "guessname"))
996 if (!strcmp(er_type, "passworded"))
998 if (!strcmp(er_type, "invonly"))
1001 sprintf(buf, "CRE8 1|%s|%d|%s", er_name, er_num_type, er_password);
1004 if (buf[0] != '2') {
1005 display_error(&buf[4]);
1008 smart_goto(er_name);
1013 * display the screen to enter a private room
1015 void display_private(char *rname, int req_pass)
1020 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1021 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1022 wprintf("<B>Goto a private room</B>\n");
1023 wprintf("</FONT></TD></TR></TABLE>\n");
1025 wprintf("<CENTER>\n");
1026 wprintf("If you know the name of a hidden (guess-name) or\n");
1027 wprintf("passworded room, you can enter that room by typing\n");
1028 wprintf("its name below. Once you gain access to a private\n");
1029 wprintf("room, it will appear in your regular room listings\n");
1030 wprintf("so you don't have to keep returning here.\n");
1031 wprintf("<BR><BR>");
1033 wprintf("<FORM METHOD=\"POST\" ACTION=\"/goto_private\">\n");
1035 wprintf("<TABLE border><TR><TD>");
1036 wprintf("Enter room name:</TD><TD>");
1037 wprintf("<INPUT TYPE=\"text\" NAME=\"gr_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", rname);
1040 wprintf("</TD></TR><TR><TD>");
1041 wprintf("Enter room password:</TD><TD>");
1042 wprintf("<INPUT TYPE=\"password\" NAME=\"gr_pass\" MAXLENGTH=\"9\">\n");
1044 wprintf("</TD></TR></TABLE>\n");
1046 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1047 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1048 wprintf("</FORM>\n");
1053 * goto a private room
1055 void goto_private(void)
1060 if (strcasecmp(bstr("sc"), "OK")) {
1061 display_main_menu();
1064 strcpy(hold_rm, WC->wc_roomname);
1065 strcpy(buf, "GOTO ");
1066 strcat(buf, bstr("gr_name"));
1068 strcat(buf, bstr("gr_pass"));
1072 if (buf[0] == '2') {
1073 smart_goto(bstr("gr_name"));
1076 if (!strncmp(buf, "540", 3)) {
1077 display_private(bstr("gr_name"), 1);
1081 wprintf("%s\n", &buf[4]);
1088 * display the screen to zap a room
1090 void display_zap(void)
1094 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1095 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1096 wprintf("<B>Zap (forget) the current room</B>\n");
1097 wprintf("</FONT></TD></TR></TABLE>\n");
1099 wprintf("If you select this option, <em>%s</em> will ", WC->wc_roomname);
1100 wprintf("disappear from your room list. Is this what you wish ");
1101 wprintf("to do?<BR>\n");
1103 wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\">\n");
1104 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1105 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1106 wprintf("</FORM>\n");
1117 char final_destination[256];
1119 /* If the forget-room routine fails for any reason, we fall back
1120 * to the current room; otherwise, we go to the Lobby
1122 strcpy(final_destination, WC->wc_roomname);
1124 if (!strcasecmp(bstr("sc"), "OK")) {
1125 serv_printf("GOTO %s", WC->wc_roomname);
1127 if (buf[0] != '2') {
1128 /* ExpressMessageCat(&buf[4]); FIXME */
1132 if (buf[0] != '2') {
1133 /* ExpressMessageCat(&buf[4]); FIXME */
1135 strcpy(final_destination, "_BASEROOM_");
1139 smart_goto(final_destination);
1146 * Confirm deletion of the current room
1148 void confirm_delete_room(void)
1152 serv_puts("KILL 0");
1154 if (buf[0] != '2') {
1155 display_error(&buf[4]);
1159 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1160 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1161 wprintf("<B>Confirm deletion of room</B>\n");
1162 wprintf("</FONT></TD></TR></TABLE>\n");
1164 wprintf("<CENTER>");
1165 wprintf("<FORM METHOD=\"POST\" ACTION=\"/delete_room\">\n");
1167 wprintf("Are you sure you want to delete <FONT SIZE=+1>");
1168 escputs(WC->wc_roomname);
1169 wprintf("</FONT>?<BR>\n");
1171 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Delete\">");
1172 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1174 wprintf("</FORM></CENTER>\n");
1180 * Delete the current room
1182 void delete_room(void)
1187 strcpy(sc, bstr("sc"));
1189 if (strcasecmp(sc, "Delete")) {
1190 display_error("Cancelled. This room was not deleted.");
1193 serv_puts("KILL 1");
1195 if (buf[0] != '2') {
1196 display_error(&buf[4]);
1198 smart_goto("_BASEROOM_");