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)
55 for (a = 0; a < 128; ++a)
61 strcpy(floorlist[0], "Main Floor");
64 while (serv_gets(buf), strcmp(buf, "000")) {
65 extract(floorlist[extract_int(buf, 0)], buf, 1);
71 * remove a room from the march list
73 void remove_march(char *aaa)
75 struct march *mptr, *mptr2;
80 if (!strcasecmp(march->march_name, aaa)) {
87 for (mptr = march; mptr != NULL; mptr = mptr->next) {
88 if (!strcasecmp(mptr->march_name, aaa)) {
89 mptr2->next = mptr->next;
102 void room_tree_list(struct roomlisting *rp)
110 if (rp->lnext != NULL) {
111 room_tree_list(rp->lnext);
113 strcpy(rmname, rp->rlname);
116 wprintf("<A HREF=\"/dotgoto&room=");
118 wprintf("\" TARGET=\"top\">");
120 if ((f & QR_DIRECTORY) && (f & QR_NETWORK))
122 else if (f & QR_DIRECTORY)
124 else if (f & QR_NETWORK)
128 wprintf("</A><TT> </TT>\n");
130 if (rp->rnext != NULL) {
131 room_tree_list(rp->rnext);
138 * Room ordering stuff (compare first by floor, then by order)
140 int rordercmp(struct roomlisting *r1, struct roomlisting *r2)
142 if ((r1 == NULL) && (r2 == NULL))
148 if (r1->rlfloor < r2->rlfloor)
150 if (r1->rlfloor > r2->rlfloor)
152 if (r1->rlorder < r2->rlorder)
154 if (r1->rlorder > r2->rlorder)
161 * Common code for all room listings
163 void listrms(char *variety)
168 struct roomlisting *rl = NULL;
169 struct roomlisting *rp;
170 struct roomlisting *rs;
173 /* Ask the server for a room list */
180 while (serv_gets(buf), strcmp(buf, "000")) {
182 rp = malloc(sizeof(struct roomlisting));
183 extract(rp->rlname, buf, 0);
184 rp->rlflags = extract_int(buf, 1);
185 rp->rlfloor = extract_int(buf, 2);
186 rp->rlorder = extract_int(buf, 3);
195 if (rordercmp(rp, rs) < 0) {
196 if (rs->lnext == NULL) {
203 if (rs->rnext == NULL) {
215 /* If no rooms were listed, print an nbsp to make the cell
216 * borders show up anyway.
218 if (num_rooms == 0) wprintf(" ");
230 * list all rooms by floor
232 void list_all_rooms_by_floor(void)
239 printf("HTTP/1.0 200 OK\n");
242 wprintf("<TABLE width=100% border><TR><TH>Floor</TH>");
243 wprintf("<TH><FONT FACE=\"Arial,Helvetica,sans-serif\">Rooms with new messages</FONT></TH>");
244 wprintf("<TH><FONT FACE=\"Arial,Helvetica,sans-serif\">Rooms with no new messages</FONT></TH></TR>\n");
246 for (a = 0; a < 128; ++a)
247 if (floorlist[a][0] != 0) {
249 /* Floor name column */
250 wprintf("<TR><TD><FONT FACE=\"Arial,Helvetica,sans-serif\">");
252 serv_printf("OIMG _floorpic_|%d", a);
257 wprintf("<IMG SRC=\"/image&name=_floorpic_&parm=%d\" ALT=\"%s\">",
258 a, &floorlist[a][0]);
260 escputs(&floorlist[a][0]);
263 wprintf("</FONT></TD>");
265 /* Rooms with new messages column */
266 wprintf("<TD><FONT FACE=\"Arial,Helvetica,sans-serif\">");
267 sprintf(buf, "LKRN %d", a);
269 wprintf("</FONT></TD>\n<TD><FONT FACE=\"Arial,Helvetica,sans-serif\">");
271 /* Rooms with old messages column */
272 sprintf(buf, "LKRO %d", a);
274 wprintf("</FONT></TD></TR>\n");
276 wprintf("</TABLE>\n");
282 * list all forgotten rooms
284 void zapped_list(void)
286 printf("HTTP/1.0 200 OK\n");
288 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
289 wprintf("<FONT FACE=\"Arial,Helvetica,sans-serif\" SIZE=+1 COLOR=\"FFFFFF\"");
290 wprintf("<B>Zapped (forgotten) rooms</B>\n");
291 wprintf("</FONT></TD></TR></TABLE><BR>\n");
293 wprintf("<BR><BR>\n");
294 wprintf("Click on any room to un-zap it and goto that room.\n");
300 * read this room's info file (set v to 1 for verbose mode)
312 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
318 * generic routine to take the session to a new room
320 * display_name values: 0 = goto only
321 * 1 = goto and display
324 void gotoroom(char *gname, int display_name)
327 static long ls = (-1L);
331 printf("HTTP/1.0 200 OK\n");
333 wprintf("<HTML><HEAD></HEAD>\n<BODY ");
335 /* automatically fire up a read-new-msgs in the bottom frame */
337 wprintf("onload=parent.frames.bottom.location=\"/readnew\" ");
339 wprintf("BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\n");
341 if (display_name != 2) {
342 /* store ungoto information */
343 strcpy(ugname, wc_roomname);
346 /* move to the new room */
347 serv_printf("GOTO %s", gname);
350 serv_puts("GOTO _BASEROOM_");
355 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
360 extract(wc_roomname, &buf[4], 0);
361 room_flags = extract_int(&buf[4], 4);
362 /* highest_msg_read = extract_int(&buf[4],6);
363 maxmsgnum = extract_int(&buf[4],5);
364 is_mail = (char) extract_int(&buf[4],7); */
365 ls = extract_long(&buf[4], 6);
368 is_room_aide = is_aide;
370 is_room_aide = (char) extract_int(&buf[4], 8);
372 remove_march(wc_roomname);
373 if (!strcasecmp(gname, "_BASEROOM_"))
376 /* Display the room banner */
378 wprintf("<CENTER><TABLE border=0><TR>");
380 if ((strlen(ugname) > 0) && (strcasecmp(ugname, wc_roomname))) {
381 wprintf("<TD VALIGN=TOP><A HREF=\"/ungoto\">");
382 wprintf("<IMG SRC=\"/static/back.gif\" BORDER=0></A></TD>");
384 wprintf("<TD VALIGN=TOP><FONT FACE=\"Arial,Helvetica,sans-serif\"><FONT SIZE=+2>%s</FONT><BR>", wc_roomname);
385 wprintf("%d new of %d messages</FONT></TD>\n",
386 extract_int(&buf[4], 1),
387 extract_int(&buf[4], 2));
389 /* Display room graphic. The server doesn't actually
390 * need the room name, but we supply it in order to
391 * keep the browser from using a cached graphic from
394 serv_puts("OIMG _roompic_");
397 wprintf("<TD><FONT FACE=\"Arial,Helvetica,sans-serif\">");
398 wprintf("<IMG SRC=\"/image&name=_roompic_&room=");
399 escputs(wc_roomname);
400 wprintf("\"></FONT></TD>");
404 wprintf("<TD VALIGN=TOP><FONT FACE=\"Arial,Helvetica,sans-serif\">");
406 wprintf("</FONT></TD>");
408 wprintf("<TD VALIGN=TOP><A HREF=\"/gotonext\">");
409 wprintf("<IMG SRC=\"/static/forward.gif\" border=0></A></TD>");
410 wprintf("</TR></TABLE></CENTER>\n");
414 strcpy(wc_roomname, wc_roomname);
419 * Locate the room on the march list which we most want to go to. Each room
420 * is measured given a "weight" of preference based on various factors.
422 char *pop_march(int desired_floor)
424 static char TheRoom[64];
426 int TheOrder = 32767;
429 struct march *mptr = NULL;
431 strcpy(TheRoom, "_BASEROOM_");
435 for (mptr = march; mptr != NULL; mptr = mptr->next) {
437 if ((strcasecmp(mptr->march_name, "_BASEROOM_")))
438 weight = weight + 10000;
439 if (mptr->march_floor == desired_floor)
440 weight = weight + 5000;
442 weight = weight + ((128 - (mptr->march_floor)) * 128);
443 weight = weight + (128 - (mptr->march_order));
445 if (weight > TheWeight) {
447 strcpy(TheRoom, mptr->march_name);
448 TheFloor = mptr->march_floor;
449 TheOrder = mptr->march_order;
457 /* Goto next room having unread messages.
458 * We want to skip over rooms that the user has already been to, and take the
459 * user back to the lobby when done. The room we end up in is placed in
460 * newroom - which is set to 0 (the lobby) initially.
461 * We start the search in the current room rather than the beginning to prevent
462 * two or more concurrent users from dragging each other back to the same room.
467 struct march *mptr, *mptr2;
470 /* First check to see if the march-mode list is already allocated.
471 * If it is, pop the first room off the list and go there.
478 while (serv_gets(buf), strcmp(buf, "000")) {
479 mptr = (struct march *) malloc(sizeof(struct march));
481 extract(mptr->march_name, buf, 0);
482 mptr->march_floor = extract_int(buf, 2);
483 mptr->march_order = extract_int(buf, 3);
488 while (mptr2->next != NULL)
493 /* add _BASEROOM_ to the end of the march list, so the user will end up
494 * in the system base room (usually the Lobby>) at the end of the loop
496 mptr = (struct march *) malloc(sizeof(struct march));
498 strcpy(mptr->march_name, "_BASEROOM_");
503 while (mptr2->next != NULL)
508 * ...and remove the room we're currently in, so a <G>oto doesn't make us
509 * walk around in circles
511 remove_march(wc_roomname);
514 strcpy(next_room, pop_march(-1));
516 strcpy(next_room, "_BASEROOM_");
518 gotoroom(next_room, 1);
524 * mark all messages in current room as having been read
526 void slrp_highest(void)
531 serv_puts("SLRP HIGHEST");
534 wprintf("<EM>%s</EM><BR>\n", &buf[4]);
541 * un-goto the previous room
547 if (!strcmp(ugname, "")) {
548 gotoroom(wc_roomname, 1);
551 serv_printf("GOTO %s", ugname);
554 gotoroom(wc_roomname, 1);
558 serv_printf("SLRP %ld", uglsn);
567 * display the form for editing a room
569 void display_editroom(void)
573 char er_password[10];
575 char er_roomaide[26];
584 display_error(&buf[4]);
587 extract(er_name, &buf[4], 0);
588 extract(er_password, &buf[4], 1);
589 extract(er_dirname, &buf[4], 2);
590 er_flags = extract_int(&buf[4], 3);
591 er_floor = extract_int(&buf[4], 4);
594 printf("HTTP/1.0 200 OK\n");
597 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
598 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
599 wprintf("<B>Edit this room</B>\n");
600 wprintf("</FONT></TD></TR></TABLE>\n");
602 wprintf("<FORM METHOD=\"POST\" ACTION=\"/editroom\">\n");
604 wprintf("<UL><LI>Name of room: ");
605 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", er_name);
607 wprintf("<LI>Resides on floor: ");
609 wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
610 for (i = 0; i < 128; ++i)
611 if (strlen(floorlist[i]) > 0) {
614 wprintf("SELECTED ");
615 wprintf("VALUE=\"%d\">", i);
616 escputs(floorlist[i]);
617 wprintf("</OPTION>\n");
619 wprintf("</SELECT>\n");
621 wprintf("<LI>Type of room:<UL>\n");
623 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
624 if ((er_flags & QR_PRIVATE) == 0)
626 wprintf("> Public room\n");
628 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
629 if ((er_flags & QR_PRIVATE) &&
630 (er_flags & QR_GUESSNAME))
632 wprintf("> Private - guess name\n");
634 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
635 if ((er_flags & QR_PRIVATE) &&
636 (er_flags & QR_PASSWORDED))
638 wprintf("> Private - require password:\n");
639 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" VALUE=\"%s\" MAXLENGTH=\"9\">\n", er_password);
641 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
642 if ((er_flags & QR_PRIVATE)
643 && ((er_flags & QR_GUESSNAME) == 0)
644 && ((er_flags & QR_PASSWORDED) == 0))
646 wprintf("> Private - invitation only\n");
648 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"bump\" VALUE=\"yes\" ");
649 wprintf("> If private, cause current users to forget room\n");
653 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"prefonly\" VALUE=\"yes\" ");
654 if (er_flags & QR_PREFONLY)
656 wprintf("> Preferred users only\n");
658 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"readonly\" VALUE=\"yes\" ");
659 if (er_flags & QR_READONLY)
661 wprintf("> Read-only room\n");
663 /* directory stuff */
664 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"directory\" VALUE=\"yes\" ");
665 if (er_flags & QR_DIRECTORY)
667 wprintf("> File directory room\n");
669 wprintf("<UL><LI>Directory name: ");
670 wprintf("<INPUT TYPE=\"text\" NAME=\"er_dirname\" VALUE=\"%s\" MAXLENGTH=\"14\">\n", er_dirname);
672 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"ulallowed\" VALUE=\"yes\" ");
673 if (er_flags & QR_UPLOAD)
675 wprintf("> Uploading allowed\n");
677 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"dlallowed\" VALUE=\"yes\" ");
678 if (er_flags & QR_DOWNLOAD)
680 wprintf("> Downloading allowed\n");
682 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"visdir\" VALUE=\"yes\" ");
683 if (er_flags & QR_VISDIR)
685 wprintf("> Visible directory</UL>\n");
687 /* end of directory stuff */
689 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"network\" VALUE=\"yes\" ");
690 if (er_flags & QR_NETWORK)
692 wprintf("> Network shared room\n");
694 /* start of anon options */
696 wprintf("<LI>Anonymous messages<UL>\n");
698 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"no\" ");
699 if (((er_flags & QR_ANONONLY) == 0)
700 && ((er_flags & QR_ANONOPT) == 0))
702 wprintf("> No anonymous messages\n");
704 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anononly\" ");
705 if (er_flags & QR_ANONONLY)
707 wprintf("> All messages are anonymous\n");
709 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anon2\" ");
710 if (er_flags & QR_ANONOPT)
712 wprintf("> Prompt user when entering messages</UL>\n");
714 /* end of anon options */
716 wprintf("<LI>Room aide: \n");
720 wprintf("<EM>%s</EM>\n", &buf[4]);
722 extract(er_roomaide, &buf[4], 0);
723 wprintf("<INPUT TYPE=\"text\" NAME=\"er_roomaide\" VALUE=\"%s\" MAXLENGTH=\"25\">\n", er_roomaide);
726 wprintf("</UL><CENTER>\n");
727 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
728 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
729 wprintf("</CENTER>\n");
736 * save new parameters for a room
742 char er_password[10];
744 char er_roomaide[26];
750 if (strcmp(bstr("sc"), "OK")) {
751 display_error("Cancelled. Changes were not saved.");
758 display_error(&buf[4]);
761 extract(er_name, &buf[4], 0);
762 extract(er_password, &buf[4], 1);
763 extract(er_dirname, &buf[4], 2);
764 er_flags = extract_int(&buf[4], 3);
766 strcpy(er_roomaide, bstr("er_roomaide"));
767 if (strlen(er_roomaide) == 0) {
771 strcpy(er_roomaide, "");
773 extract(er_roomaide, &buf[4], 0);
776 strcpy(buf, bstr("er_name"));
779 strcpy(er_name, buf);
781 strcpy(buf, bstr("er_password"));
784 strcpy(er_password, buf);
786 strcpy(buf, bstr("er_dirname"));
789 strcpy(er_dirname, buf);
791 strcpy(buf, bstr("type"));
792 er_flags &= !(QR_PRIVATE | QR_PASSWORDED | QR_GUESSNAME);
794 if (!strcmp(buf, "invonly")) {
795 er_flags |= (QR_PRIVATE);
797 if (!strcmp(buf, "guessname")) {
798 er_flags |= (QR_PRIVATE | QR_GUESSNAME);
800 if (!strcmp(buf, "passworded")) {
801 er_flags |= (QR_PRIVATE | QR_PASSWORDED);
803 if (!strcmp(bstr("prefonly"), "yes")) {
804 er_flags |= QR_PREFONLY;
806 er_flags &= ~QR_PREFONLY;
809 if (!strcmp(bstr("readonly"), "yes")) {
810 er_flags |= QR_READONLY;
812 er_flags &= ~QR_READONLY;
815 if (!strcmp(bstr("network"), "yes")) {
816 er_flags |= QR_NETWORK;
818 er_flags &= ~QR_NETWORK;
821 if (!strcmp(bstr("directory"), "yes")) {
822 er_flags |= QR_DIRECTORY;
824 er_flags &= ~QR_DIRECTORY;
827 if (!strcmp(bstr("ulallowed"), "yes")) {
828 er_flags |= QR_UPLOAD;
830 er_flags &= ~QR_UPLOAD;
833 if (!strcmp(bstr("dlallowed"), "yes")) {
834 er_flags |= QR_DOWNLOAD;
836 er_flags &= ~QR_DOWNLOAD;
839 if (!strcmp(bstr("visdir"), "yes")) {
840 er_flags |= QR_VISDIR;
842 er_flags &= ~QR_VISDIR;
845 strcpy(buf, bstr("anon"));
847 er_flags &= ~(QR_ANONONLY | QR_ANONOPT);
848 if (!strcmp(buf, "anononly"))
849 er_flags |= QR_ANONONLY;
850 if (!strcmp(buf, "anon2"))
851 er_flags |= QR_ANONOPT;
854 if (!strcmp(bstr("bump"), "yes"))
857 er_floor = atoi(bstr("er_floor"));
859 sprintf(buf, "SETR %s|%s|%s|%u|%d|%d",
860 er_name, er_password, er_dirname, er_flags, bump, er_floor);
864 display_error(&buf[4]);
867 gotoroom(er_name, 0);
869 if (strlen(er_roomaide) > 0) {
870 sprintf(buf, "SETA %s", er_roomaide);
874 display_error(&buf[4]);
878 gotoroom(er_name, 1);
884 * display the form for entering a new room
886 void display_entroom(void)
894 display_error(&buf[4]);
897 printf("HTTP/1.0 200 OK\n");
900 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
901 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
902 wprintf("<B>Enter (create) a new room</B>\n");
903 wprintf("</FONT></TD></TR></TABLE>\n");
905 wprintf("<FORM METHOD=\"POST\" ACTION=\"/entroom\">\n");
907 wprintf("<UL><LI>Name of room: ");
908 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" MAXLENGTH=\"19\">\n");
910 wprintf("<LI>Type of room:<UL>\n");
912 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
913 wprintf("CHECKED > Public room\n");
915 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
916 wprintf("> Private - guess name\n");
918 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
919 wprintf("> Private - require password:\n");
920 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" MAXLENGTH=\"9\">\n");
922 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
923 wprintf("> Private - invitation only\n");
925 wprintf("<CENTER>\n");
926 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
927 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
928 wprintf("</CENTER>\n");
929 wprintf("</FORM>\n");
943 char er_password[10];
946 if (strcmp(bstr("sc"), "OK")) {
947 display_error("Cancelled. No new room was created.");
950 strcpy(er_name, bstr("er_name"));
951 strcpy(er_type, bstr("type"));
952 strcpy(er_password, bstr("er_password"));
955 if (!strcmp(er_type, "guessname"))
957 if (!strcmp(er_type, "passworded"))
959 if (!strcmp(er_type, "invonly"))
962 sprintf(buf, "CRE8 1|%s|%d|%s", er_name, er_num_type, er_password);
966 display_error(&buf[4]);
969 gotoroom(er_name, 1);
974 * display the screen to enter a private room
976 void display_private(char *rname, int req_pass)
979 printf("HTTP/1.0 200 OK\n");
982 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
983 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
984 wprintf("<B>Goto a private room</B>\n");
985 wprintf("</FONT></TD></TR></TABLE>\n");
987 wprintf("<CENTER>\n");
988 wprintf("If you know the name of a hidden (guess-name) or\n");
989 wprintf("passworded room, you can enter that room by typing\n");
990 wprintf("its name below. Once you gain access to a private\n");
991 wprintf("room, it will appear in your regular room listings\n");
992 wprintf("so you don't have to keep returning here.\n");
995 wprintf("<FORM METHOD=\"POST\" ACTION=\"/goto_private\">\n");
997 wprintf("<TABLE border><TR><TD>");
998 wprintf("Enter room name:</TD><TD>");
999 wprintf("<INPUT TYPE=\"text\" NAME=\"gr_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n", rname);
1002 wprintf("</TD></TR><TR><TD>");
1003 wprintf("Enter room password:</TD><TD>");
1004 wprintf("<INPUT TYPE=\"password\" NAME=\"gr_pass\" MAXLENGTH=\"9\">\n");
1006 wprintf("</TD></TR></TABLE>\n");
1008 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1009 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1010 wprintf("</FORM>\n");
1015 * goto a private room
1017 void goto_private(void)
1022 if (strcasecmp(bstr("sc"), "OK")) {
1023 display_main_menu();
1026 strcpy(hold_rm, wc_roomname);
1027 strcpy(buf, "GOTO ");
1028 strcat(buf, bstr("gr_name"));
1030 strcat(buf, bstr("gr_pass"));
1034 if (buf[0] == '2') {
1035 gotoroom(bstr("gr_name"), 1);
1038 if (!strncmp(buf, "540", 3)) {
1039 display_private(bstr("gr_name"), 1);
1042 printf("HTTP/1.0 200 OK\n");
1044 wprintf("%s\n", &buf[4]);
1051 * display the screen to zap a room
1053 void display_zap(void)
1055 printf("HTTP/1.0 200 OK\n");
1058 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1059 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1060 wprintf("<B>Zap (forget) the current room</B>\n");
1061 wprintf("</FONT></TD></TR></TABLE>\n");
1063 wprintf("If you select this option, <em>%s</em> will ", wc_roomname);
1064 wprintf("disappear from your room list. Is this what you wish ");
1065 wprintf("to do?<BR>\n");
1067 wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\">\n");
1068 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1069 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1070 wprintf("</FORM>\n");
1082 if (strcmp(bstr("sc"), "OK")) {
1083 display_main_menu();
1086 serv_printf("GOTO %s", wc_roomname);
1088 if (buf[0] != '2') {
1089 display_error(&buf[4]);
1094 if (buf[0] != '2') {
1095 display_error(&buf[4]);
1098 gotoroom(bstr("_BASEROOM_"), 1);
1105 * Confirm deletion of the current room
1107 void confirm_delete_room(void)
1111 serv_puts("KILL 0");
1113 if (buf[0] != '2') {
1114 display_error(&buf[4]);
1117 printf("HTTP/1.0 200 OK\n");
1119 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1120 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1121 wprintf("<B>Confirm deletion of room</B>\n");
1122 wprintf("</FONT></TD></TR></TABLE>\n");
1124 wprintf("<CENTER>");
1125 wprintf("<FORM METHOD=\"POST\" ACTION=\"/delete_room\">\n");
1127 wprintf("Are you sure you want to delete <FONT SIZE=+1>");
1128 escputs(wc_roomname);
1129 wprintf("</FONT>?<BR>\n");
1131 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Delete\">");
1132 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1134 wprintf("</FORM></CENTER>\n");
1140 * Delete the current room
1142 void delete_room(void)
1147 strcpy(sc, bstr("sc"));
1149 if (strcasecmp(sc, "Delete")) {
1150 display_error("Cancelled. This room was not deleted.");
1153 serv_puts("KILL 1");
1155 if (buf[0] != '2') {
1156 display_error(&buf[4]);
1158 gotoroom("_BASEROOM_", 1);