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)
295 wprintf("<FONT SIZE=-1>");
301 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
307 void embed_room_banner(char *got) {
310 static int remember_new_mail = (-1);
312 /* We need to have the information returned by a GOTO server command.
313 * If it isn't supplied, we fake it by issuing our own GOTO.
316 serv_printf("GOTO %s", WC->wc_roomname);
321 /* Check for new mail. */
322 WC->new_mail = extract_int(&got[4], 9);
324 /* Now start spewing HTML. */
325 wprintf("<CENTER><TABLE width=100%% border=0 cellpadding=5><TR>");
327 if ((strlen(WC->ugname) > 0) && (strcasecmp(WC->ugname, WC->wc_roomname))) {
328 wprintf("<TD VALIGN=TOP><A HREF=\"/ungoto\">");
329 wprintf("<IMG SRC=\"/static/back.gif\" BORDER=0>");
330 wprintf("<BR><FONT SIZE=-2>Previous room</FONT></A></TD>");
332 wprintf("<TD VALIGN=TOP BGCOLOR=444455>");
333 wprintf("<FONT SIZE=+2 COLOR=FFFFEE>%s</FONT><BR>", WC->wc_roomname);
334 wprintf("<FONT COLOR=DDDDCC>%d new of %d messages</FONT></TD>\n",
335 extract_int(&got[4], 1),
336 extract_int(&got[4], 2));
338 /* Display room graphic. The server doesn't actually
339 * need the room name, but we supply it in order to
340 * keep the browser from using a cached graphic from
343 serv_puts("OIMG _roompic_");
347 wprintf("<IMG SRC=\"/image&name=_roompic_&room=");
348 urlescputs(WC->wc_roomname);
353 wprintf("<TD VALIGN=TOP>");
357 /* Let the user know if new mail has arrived */
358 if ( (WC->new_mail > remember_new_mail) && (WC->new_mail>0) ) {
359 wprintf("<TD VALIGN=TOP>"
360 "<IMG SRC=\"/static/mail.gif\" border=0 "
361 "ALT=\"You have new mail\">"
362 "<BR><BLINK>%d</BLINK>", WC->new_mail);
363 wprintf("<FONT SIZE=-2> new mail messages</FONT></TD>");
364 remember_new_mail = WC->new_mail;
367 wprintf("<TD VALIGN=TOP><A HREF=\"/gotonext\">");
368 wprintf("<IMG SRC=\"/static/forward.gif\" border=0>");
369 wprintf("<BR><FONT SIZE=-2>Next room</FONT></A></TD>");
370 wprintf("</TR></TABLE></CENTER>\n");
378 * generic routine to take the session to a new room
380 * display_name values: 0 = goto only
381 * 1 = goto and display
384 void gotoroom(char *gname, int display_name)
387 static long ls = (-1L);
392 wprintf("Pragma: no-cache\n");
393 wprintf("Cache-Control: no-store\n");
395 wprintf("<HTML><HEAD>\n"
396 "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n"
398 wprintf("BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\n");
400 if (display_name != 2) {
401 /* store ungoto information */
402 strcpy(WC->ugname, WC->wc_roomname);
405 /* move to the new room */
406 serv_printf("GOTO %s", gname);
409 serv_puts("GOTO _BASEROOM_");
414 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
419 extract(WC->wc_roomname, &buf[4], 0);
420 WC->room_flags = extract_int(&buf[4], 4);
421 /* highest_msg_read = extract_int(&buf[4],6);
422 maxmsgnum = extract_int(&buf[4],5);
423 is_mail = (char) extract_int(&buf[4],7); */
424 ls = extract_long(&buf[4], 6);
427 WC->is_room_aide = WC->is_aide;
429 WC->is_room_aide = (char) extract_int(&buf[4], 8);
431 remove_march(WC->wc_roomname);
432 if (!strcasecmp(gname, "_BASEROOM_"))
435 /* Display the room banner */
437 embed_room_banner(buf);
440 strcpy(WC->wc_roomname, WC->wc_roomname);
445 * Locate the room on the march list which we most want to go to. Each room
446 * is measured given a "weight" of preference based on various factors.
448 char *pop_march(int desired_floor)
450 static char TheRoom[64];
452 int TheOrder = 32767;
455 struct march *mptr = NULL;
457 strcpy(TheRoom, "_BASEROOM_");
458 if (WC->march == NULL)
461 for (mptr = WC->march; mptr != NULL; mptr = mptr->next) {
463 if ((strcasecmp(mptr->march_name, "_BASEROOM_")))
464 weight = weight + 10000;
465 if (mptr->march_floor == desired_floor)
466 weight = weight + 5000;
468 weight = weight + ((128 - (mptr->march_floor)) * 128);
469 weight = weight + (128 - (mptr->march_order));
471 if (weight > TheWeight) {
473 strcpy(TheRoom, mptr->march_name);
474 TheFloor = mptr->march_floor;
475 TheOrder = mptr->march_order;
483 /* Goto next room having unread messages.
484 * We want to skip over rooms that the user has already been to, and take the
485 * user back to the lobby when done. The room we end up in is placed in
486 * newroom - which is set to 0 (the lobby) initially.
487 * We start the search in the current room rather than the beginning to prevent
488 * two or more concurrent users from dragging each other back to the same room.
493 struct march *mptr, *mptr2;
496 /* First check to see if the march-mode list is already allocated.
497 * If it is, pop the first room off the list and go there.
500 if (WC->march == NULL) {
504 while (serv_gets(buf), strcmp(buf, "000")) {
505 mptr = (struct march *) malloc(sizeof(struct march));
507 extract(mptr->march_name, buf, 0);
508 mptr->march_floor = extract_int(buf, 2);
509 mptr->march_order = extract_int(buf, 3);
510 if (WC->march == NULL) {
514 while (mptr2->next != NULL)
519 /* add _BASEROOM_ to the end of the march list, so the user will end up
520 * in the system base room (usually the Lobby>) at the end of the loop
522 mptr = (struct march *) malloc(sizeof(struct march));
524 strcpy(mptr->march_name, "_BASEROOM_");
525 if (WC->march == NULL) {
529 while (mptr2->next != NULL)
534 * ...and remove the room we're currently in, so a <G>oto doesn't make us
535 * walk around in circles
537 remove_march(WC->wc_roomname);
539 if (WC->march != NULL) {
540 strcpy(next_room, pop_march(-1));
542 strcpy(next_room, "_BASEROOM_");
546 smart_goto(next_room);
550 void smart_goto(char *next_room) {
551 gotoroom(next_room, 0);
558 * mark all messages in current room as having been read
560 void slrp_highest(void)
565 serv_puts("SLRP HIGHEST");
568 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
575 * un-goto the previous room
581 if (!strcmp(WC->ugname, "")) {
582 smart_goto(WC->wc_roomname);
585 serv_printf("GOTO %s", WC->ugname);
588 smart_goto(WC->wc_roomname);
591 if (WC->uglsn >= 0L) {
592 serv_printf("SLRP %ld", WC->uglsn);
595 strcpy(buf, WC->ugname);
596 strcpy(WC->ugname, "");
601 * display the form for editing a room
603 void display_editroom(void)
607 char er_password[10];
609 char er_roomaide[26];
618 display_error(&buf[4]);
621 extract(er_name, &buf[4], 0);
622 extract(er_password, &buf[4], 1);
623 extract(er_dirname, &buf[4], 2);
624 er_flags = extract_int(&buf[4], 3);
625 er_floor = extract_int(&buf[4], 4);
630 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
631 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
632 wprintf("<B>Room administration</B>\n");
633 wprintf("</FONT></TD></TR></TABLE>\n");
636 "<LI><A HREF=\"/confirm_delete_room\">\n"
637 "Delete this room</A>\n"
638 "<LI><A HREF=\"/display_editroompic\">\n"
639 "Set or change the graphic for this room's banner</A>\n"
640 "<LI><A HREF=\"/display_editinfo\">\n"
641 "Edit this room's Info file</A>\n"
644 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
645 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
646 wprintf("<B>Room editing</B>\n");
647 wprintf("</FONT></TD></TR></TABLE>\n");
649 wprintf("<FORM METHOD=\"POST\" ACTION=\"/editroom\">\n");
651 wprintf("<UL><LI>Name of room: ");
652 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", er_name);
654 wprintf("<LI>Resides on floor: ");
656 wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
657 for (i = 0; i < 128; ++i)
658 if (strlen(floorlist[i]) > 0) {
661 wprintf("SELECTED ");
662 wprintf("VALUE=\"%d\">", i);
663 escputs(floorlist[i]);
664 wprintf("</OPTION>\n");
666 wprintf("</SELECT>\n");
668 wprintf("<LI>Type of room:<UL>\n");
670 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
671 if ((er_flags & QR_PRIVATE) == 0)
673 wprintf("> Public room\n");
675 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
676 if ((er_flags & QR_PRIVATE) &&
677 (er_flags & QR_GUESSNAME))
679 wprintf("> Private - guess name\n");
681 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
682 if ((er_flags & QR_PRIVATE) &&
683 (er_flags & QR_PASSWORDED))
685 wprintf("> Private - require password:\n");
686 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" VALUE=\"%s\" MAXLENGTH=\"9\">\n", er_password);
688 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
689 if ((er_flags & QR_PRIVATE)
690 && ((er_flags & QR_GUESSNAME) == 0)
691 && ((er_flags & QR_PASSWORDED) == 0))
693 wprintf("> Private - invitation only\n");
695 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"bump\" VALUE=\"yes\" ");
696 wprintf("> If private, cause current users to forget room\n");
700 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"prefonly\" VALUE=\"yes\" ");
701 if (er_flags & QR_PREFONLY)
703 wprintf("> Preferred users only\n");
705 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"readonly\" VALUE=\"yes\" ");
706 if (er_flags & QR_READONLY)
708 wprintf("> Read-only room\n");
710 /* directory stuff */
711 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"directory\" VALUE=\"yes\" ");
712 if (er_flags & QR_DIRECTORY)
714 wprintf("> File directory room\n");
716 wprintf("<UL><LI>Directory name: ");
717 wprintf("<INPUT TYPE=\"text\" NAME=\"er_dirname\" VALUE=\"%s\" MAXLENGTH=\"14\">\n", er_dirname);
719 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"ulallowed\" VALUE=\"yes\" ");
720 if (er_flags & QR_UPLOAD)
722 wprintf("> Uploading allowed\n");
724 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"dlallowed\" VALUE=\"yes\" ");
725 if (er_flags & QR_DOWNLOAD)
727 wprintf("> Downloading allowed\n");
729 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"visdir\" VALUE=\"yes\" ");
730 if (er_flags & QR_VISDIR)
732 wprintf("> Visible directory</UL>\n");
734 /* end of directory stuff */
736 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"network\" VALUE=\"yes\" ");
737 if (er_flags & QR_NETWORK)
739 wprintf("> Network shared room\n");
741 /* start of anon options */
743 wprintf("<LI>Anonymous messages<UL>\n");
745 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"no\" ");
746 if (((er_flags & QR_ANONONLY) == 0)
747 && ((er_flags & QR_ANONOPT) == 0))
749 wprintf("> No anonymous messages\n");
751 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anononly\" ");
752 if (er_flags & QR_ANONONLY)
754 wprintf("> All messages are anonymous\n");
756 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anon2\" ");
757 if (er_flags & QR_ANONOPT)
759 wprintf("> Prompt user when entering messages</UL>\n");
761 /* end of anon options */
763 wprintf("<LI>Room aide: \n");
767 wprintf("<EM>%s</EM>\n", &buf[4]);
769 extract(er_roomaide, &buf[4], 0);
770 wprintf("<INPUT TYPE=\"text\" NAME=\"er_roomaide\" VALUE=\"%s\" MAXLENGTH=\"25\">\n", er_roomaide);
773 wprintf("</UL><CENTER>\n");
774 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
775 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
776 wprintf("</CENTER>\n");
783 * save new parameters for a room
789 char er_password[10];
791 char er_roomaide[26];
797 if (strcmp(bstr("sc"), "OK")) {
798 display_error("Cancelled. Changes were not saved.");
805 display_error(&buf[4]);
808 extract(er_name, &buf[4], 0);
809 extract(er_password, &buf[4], 1);
810 extract(er_dirname, &buf[4], 2);
811 er_flags = extract_int(&buf[4], 3);
813 strcpy(er_roomaide, bstr("er_roomaide"));
814 if (strlen(er_roomaide) == 0) {
818 strcpy(er_roomaide, "");
820 extract(er_roomaide, &buf[4], 0);
823 strcpy(buf, bstr("er_name"));
826 strcpy(er_name, buf);
828 strcpy(buf, bstr("er_password"));
831 strcpy(er_password, buf);
833 strcpy(buf, bstr("er_dirname"));
836 strcpy(er_dirname, buf);
838 strcpy(buf, bstr("type"));
839 er_flags &= !(QR_PRIVATE | QR_PASSWORDED | QR_GUESSNAME);
841 if (!strcmp(buf, "invonly")) {
842 er_flags |= (QR_PRIVATE);
844 if (!strcmp(buf, "guessname")) {
845 er_flags |= (QR_PRIVATE | QR_GUESSNAME);
847 if (!strcmp(buf, "passworded")) {
848 er_flags |= (QR_PRIVATE | QR_PASSWORDED);
850 if (!strcmp(bstr("prefonly"), "yes")) {
851 er_flags |= QR_PREFONLY;
853 er_flags &= ~QR_PREFONLY;
856 if (!strcmp(bstr("readonly"), "yes")) {
857 er_flags |= QR_READONLY;
859 er_flags &= ~QR_READONLY;
862 if (!strcmp(bstr("network"), "yes")) {
863 er_flags |= QR_NETWORK;
865 er_flags &= ~QR_NETWORK;
868 if (!strcmp(bstr("directory"), "yes")) {
869 er_flags |= QR_DIRECTORY;
871 er_flags &= ~QR_DIRECTORY;
874 if (!strcmp(bstr("ulallowed"), "yes")) {
875 er_flags |= QR_UPLOAD;
877 er_flags &= ~QR_UPLOAD;
880 if (!strcmp(bstr("dlallowed"), "yes")) {
881 er_flags |= QR_DOWNLOAD;
883 er_flags &= ~QR_DOWNLOAD;
886 if (!strcmp(bstr("visdir"), "yes")) {
887 er_flags |= QR_VISDIR;
889 er_flags &= ~QR_VISDIR;
892 strcpy(buf, bstr("anon"));
894 er_flags &= ~(QR_ANONONLY | QR_ANONOPT);
895 if (!strcmp(buf, "anononly"))
896 er_flags |= QR_ANONONLY;
897 if (!strcmp(buf, "anon2"))
898 er_flags |= QR_ANONOPT;
901 if (!strcmp(bstr("bump"), "yes"))
904 er_floor = atoi(bstr("er_floor"));
906 sprintf(buf, "SETR %s|%s|%s|%u|%d|%d",
907 er_name, er_password, er_dirname, er_flags, bump, er_floor);
911 display_error(&buf[4]);
914 gotoroom(er_name, 0);
916 if (strlen(er_roomaide) > 0) {
917 sprintf(buf, "SETA %s", er_roomaide);
921 display_error(&buf[4]);
931 * display the form for entering a new room
933 void display_entroom(void)
941 display_error(&buf[4]);
946 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
947 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
948 wprintf("<B>Enter (create) a new room</B>\n");
949 wprintf("</FONT></TD></TR></TABLE>\n");
951 wprintf("<FORM METHOD=\"POST\" ACTION=\"/entroom\">\n");
953 wprintf("<UL><LI>Name of room: ");
954 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" MAXLENGTH=\"19\">\n");
956 wprintf("<LI>Type of room:<UL>\n");
958 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
959 wprintf("CHECKED > Public room\n");
961 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
962 wprintf("> Private - guess name\n");
964 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
965 wprintf("> Private - require password:\n");
966 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" MAXLENGTH=\"9\">\n");
968 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
969 wprintf("> Private - invitation only\n");
971 wprintf("<CENTER>\n");
972 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
973 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
974 wprintf("</CENTER>\n");
975 wprintf("</FORM>\n");
989 char er_password[10];
992 if (strcmp(bstr("sc"), "OK")) {
993 display_error("Cancelled. No new room was created.");
996 strcpy(er_name, bstr("er_name"));
997 strcpy(er_type, bstr("type"));
998 strcpy(er_password, bstr("er_password"));
1001 if (!strcmp(er_type, "guessname"))
1003 if (!strcmp(er_type, "passworded"))
1005 if (!strcmp(er_type, "invonly"))
1008 sprintf(buf, "CRE8 1|%s|%d|%s", er_name, er_num_type, er_password);
1011 if (buf[0] != '2') {
1012 display_error(&buf[4]);
1015 smart_goto(er_name);
1020 * display the screen to enter a private room
1022 void display_private(char *rname, int req_pass)
1027 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1028 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1029 wprintf("<B>Goto a private room</B>\n");
1030 wprintf("</FONT></TD></TR></TABLE>\n");
1032 wprintf("<CENTER>\n");
1033 wprintf("If you know the name of a hidden (guess-name) or\n");
1034 wprintf("passworded room, you can enter that room by typing\n");
1035 wprintf("its name below. Once you gain access to a private\n");
1036 wprintf("room, it will appear in your regular room listings\n");
1037 wprintf("so you don't have to keep returning here.\n");
1038 wprintf("<BR><BR>");
1040 wprintf("<FORM METHOD=\"POST\" ACTION=\"/goto_private\">\n");
1042 wprintf("<TABLE border><TR><TD>");
1043 wprintf("Enter room name:</TD><TD>");
1044 wprintf("<INPUT TYPE=\"text\" NAME=\"gr_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", rname);
1047 wprintf("</TD></TR><TR><TD>");
1048 wprintf("Enter room password:</TD><TD>");
1049 wprintf("<INPUT TYPE=\"password\" NAME=\"gr_pass\" MAXLENGTH=\"9\">\n");
1051 wprintf("</TD></TR></TABLE>\n");
1053 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1054 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1055 wprintf("</FORM>\n");
1060 * goto a private room
1062 void goto_private(void)
1067 if (strcasecmp(bstr("sc"), "OK")) {
1068 display_main_menu();
1071 strcpy(hold_rm, WC->wc_roomname);
1072 strcpy(buf, "GOTO ");
1073 strcat(buf, bstr("gr_name"));
1075 strcat(buf, bstr("gr_pass"));
1079 if (buf[0] == '2') {
1080 smart_goto(bstr("gr_name"));
1083 if (!strncmp(buf, "540", 3)) {
1084 display_private(bstr("gr_name"), 1);
1088 wprintf("%s\n", &buf[4]);
1095 * display the screen to zap a room
1097 void display_zap(void)
1101 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1102 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1103 wprintf("<B>Zap (forget) the current room</B>\n");
1104 wprintf("</FONT></TD></TR></TABLE>\n");
1106 wprintf("If you select this option, <em>%s</em> will ", WC->wc_roomname);
1107 wprintf("disappear from your room list. Is this what you wish ");
1108 wprintf("to do?<BR>\n");
1110 wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\">\n");
1111 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1112 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1113 wprintf("</FORM>\n");
1124 char final_destination[256];
1126 /* If the forget-room routine fails for any reason, we fall back
1127 * to the current room; otherwise, we go to the Lobby
1129 strcpy(final_destination, WC->wc_roomname);
1131 if (!strcasecmp(bstr("sc"), "OK")) {
1132 serv_printf("GOTO %s", WC->wc_roomname);
1134 if (buf[0] != '2') {
1135 /* ExpressMessageCat(&buf[4]); FIXME */
1139 if (buf[0] != '2') {
1140 /* ExpressMessageCat(&buf[4]); FIXME */
1142 strcpy(final_destination, "_BASEROOM_");
1146 smart_goto(final_destination);
1153 * Confirm deletion of the current room
1155 void confirm_delete_room(void)
1159 serv_puts("KILL 0");
1161 if (buf[0] != '2') {
1162 display_error(&buf[4]);
1166 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1167 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1168 wprintf("<B>Confirm deletion of room</B>\n");
1169 wprintf("</FONT></TD></TR></TABLE>\n");
1171 wprintf("<CENTER>");
1172 wprintf("<FORM METHOD=\"POST\" ACTION=\"/delete_room\">\n");
1174 wprintf("Are you sure you want to delete <FONT SIZE=+1>");
1175 escputs(WC->wc_roomname);
1176 wprintf("</FONT>?<BR>\n");
1178 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Delete\">");
1179 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1181 wprintf("</FORM></CENTER>\n");
1187 * Delete the current room
1189 void delete_room(void)
1194 strcpy(sc, bstr("sc"));
1196 if (strcasecmp(sc, "Delete")) {
1197 display_error("Cancelled. This room was not deleted.");
1200 serv_puts("KILL 1");
1202 if (buf[0] != '2') {
1203 display_error(&buf[4]);
1205 smart_goto("_BASEROOM_");