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");
262 * list all forgotten rooms
264 void zapped_list(void) {
265 printf("HTTP/1.0 200 OK\n");
266 output_headers(1, "bottom");
267 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
268 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
269 wprintf("<B>Zapped (forgotten) rooms</B>\n");
270 wprintf("</FONT></TD></TR></TABLE><BR>\n");
272 wprintf("<BR><BR>\n");
273 wprintf("Click on any room to un-zap it and goto that room.\n");
279 * read this room's info file (set v to 1 for verbose mode)
287 if (buf[0]=='1') fmout(NULL);
289 if (v==1) wprintf("<EM>%s</EM><BR>\n",&buf[4]);
295 * generic routine to take the session to a new room
297 * display_name values: 0 = goto only
298 * 1 = goto and display
301 void gotoroom(char *gname, int display_name)
304 static long ls = (-1L);
308 printf("HTTP/1.0 200 OK\n");
309 output_headers(0, "top");
310 wprintf("<HTML><HEAD></HEAD>\n<BODY ");
312 /* automatically fire up a read-new-msgs in the bottom frame */
314 wprintf("onload=location=\"/readnew\" ");
316 wprintf("BACKGROUND=\"/image&name=background\" TEXT=\"#000000\" LINK=\"#004400\">\n");
319 if (display_name != 2) {
320 /* store ungoto information */
321 strcpy(ugname, wc_roomname);
325 /* move to the new room */
326 serv_printf("GOTO %s", gname);
329 serv_puts("GOTO _BASEROOM_");
334 wprintf("<EM>%s</EM><BR>\n",&buf[4]);
340 extract(wc_roomname,&buf[4],0);
341 room_flags = extract_int(&buf[4],4);
342 /* highest_msg_read = extract_int(&buf[4],6);
343 maxmsgnum = extract_int(&buf[4],5);
344 is_mail = (char) extract_int(&buf[4],7); */
345 ls = extract_long(&buf[4], 6);
347 if (is_aide) is_room_aide = is_aide;
348 else is_room_aide = (char) extract_int(&buf[4],8);
350 remove_march(wc_roomname);
351 if (!strcasecmp(gname,"_BASEROOM_")) remove_march(gname);
353 /* Display the room banner */
355 wprintf("<CENTER><TABLE border=0><TR>");
357 if ( (strlen(ugname)>0) && (strcasecmp(ugname,wc_roomname)) ) {
358 wprintf("<TD VALIGN=TOP><A HREF=\"/ungoto\">");
359 wprintf("<IMG SRC=\"/static/back.gif\" BORDER=0></A></TD>");
362 wprintf("<TD VALIGN=TOP><FONT FACE=\"Arial,Helvetica,sans-serif\"><H1>%s</H1>",wc_roomname);
363 wprintf("%d new of %d messages</FONT></TD>\n",
364 extract_int(&buf[4],1),
365 extract_int(&buf[4],2));
367 /* Display room graphic. The server doesn't actually
368 * need the room name, but we supply it in order to
369 * keep the browser from using a cached graphic from
372 serv_puts("OIMG _roompic_");
375 wprintf("<TD><FONT FACE=\"Arial,Helvetica,sans-serif\">");
376 wprintf("<IMG SRC=\"/image&name=_roompic_&room=");
377 escputs(wc_roomname);
378 wprintf("\"></FONT></TD>");
383 wprintf("<TD VALIGN=TOP><FONT FACE=\"Arial,Helvetica,sans-serif\">");
385 wprintf("</FONT></TD>");
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");
394 strcpy(wc_roomname, wc_roomname);
399 * Locate the room on the march list which we most want to go to. Each room
400 * is measured given a "weight" of preference based on various factors.
402 char *pop_march(int desired_floor) {
403 static char TheRoom[64];
405 int TheOrder = 32767;
408 struct march *mptr = NULL;
410 strcpy(TheRoom, "_BASEROOM_");
411 if (march == NULL) return(TheRoom);
413 for (mptr = march; mptr != NULL; mptr = mptr->next) {
415 if ((strcasecmp(mptr->march_name, "_BASEROOM_")))
416 weight = weight + 10000;
417 if (mptr->march_floor == desired_floor)
418 weight = weight + 5000;
420 weight = weight + ((128-(mptr->march_floor))*128);
421 weight = weight + (128-(mptr->march_order));
423 if (weight > TheWeight) {
425 strcpy(TheRoom, mptr->march_name);
426 TheFloor = mptr->march_floor;
427 TheOrder = mptr->march_order;
435 /* Goto next room having unread messages.
436 * We want to skip over rooms that the user has already been to, and take the
437 * user back to the lobby when done. The room we end up in is placed in
438 * newroom - which is set to 0 (the lobby) initially.
439 * We start the search in the current room rather than the beginning to prevent
440 * two or more concurrent users from dragging each other back to the same room.
442 void gotonext(void) {
444 struct march *mptr,*mptr2;
447 /* First check to see if the march-mode list is already allocated.
448 * If it is, pop the first room off the list and go there.
455 while (serv_gets(buf), strcmp(buf,"000")) {
456 mptr = (struct march *) malloc(sizeof(struct march));
458 extract(mptr->march_name,buf,0);
459 mptr->march_floor = extract_int(buf, 2);
460 mptr->march_order = extract_int(buf, 3);
466 while (mptr2->next != NULL)
472 /* add _BASEROOM_ to the end of the march list, so the user will end up
473 * in the system base room (usually the Lobby>) at the end of the loop
475 mptr = (struct march *) malloc(sizeof(struct march));
477 strcpy(mptr->march_name,"_BASEROOM_");
483 while (mptr2->next != NULL)
488 * ...and remove the room we're currently in, so a <G>oto doesn't make us
489 * walk around in circles
491 remove_march(wc_roomname);
496 strcpy(next_room, pop_march(-1));
499 strcpy(next_room,"_BASEROOM_");
501 gotoroom(next_room,1);
507 * mark all messages in current room as having been read
509 void slrp_highest(void) {
513 serv_puts("SLRP HIGHEST");
516 wprintf("<EM>%s</EM><BR>\n",&buf[4]);
523 * un-goto the previous room
528 if (!strcmp(ugname, "")) {
529 gotoroom(wc_roomname, 1);
532 serv_printf("GOTO %s", ugname);
535 gotoroom(wc_roomname, 1);
539 serv_printf("SLRP %ld",uglsn);
548 * display the form for editing a room
550 void display_editroom(void) {
553 char er_password[10];
555 char er_roomaide[26];
564 display_error(&buf[4]);
568 extract(er_name,&buf[4],0);
569 extract(er_password,&buf[4],1);
570 extract(er_dirname,&buf[4],2);
571 er_flags=extract_int(&buf[4],3);
572 er_floor=extract_int(&buf[4],4);
575 printf("HTTP/1.0 200 OK\n");
576 output_headers(1, "bottom");
578 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
579 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
580 wprintf("<B>Edit this room</B>\n");
581 wprintf("</FONT></TD></TR></TABLE>\n");
583 wprintf("<FORM METHOD=\"POST\" ACTION=\"/editroom\">\n");
585 wprintf("<UL><LI>Name of room: ");
586 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n",er_name);
588 wprintf("<LI>Resides on floor: ");
590 wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
591 for (i=0; i<128; ++i) if (strlen(floorlist[i])>0) {
593 if (i == er_floor) wprintf("SELECTED ");
594 wprintf("VALUE=\"%d\">", i);
595 escputs(floorlist[i]);
596 wprintf("</OPTION>\n");
598 wprintf("</SELECT>\n");
600 wprintf("<LI>Type of room:<UL>\n");
602 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
603 if ((er_flags & QR_PRIVATE) == 0) wprintf("CHECKED ");
604 wprintf("> Public room\n");
606 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
607 if ((er_flags & QR_PRIVATE)&&
608 (er_flags & QR_GUESSNAME)) wprintf("CHECKED ");
609 wprintf("> Private - guess name\n");
611 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
612 if ((er_flags & QR_PRIVATE)&&
613 (er_flags & QR_PASSWORDED)) wprintf("CHECKED ");
614 wprintf("> Private - require password:\n");
615 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" VALUE=\"%s\" MAXLENGTH=\"9\">\n",er_password);
617 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
618 if ( (er_flags & QR_PRIVATE)
619 && ((er_flags & QR_GUESSNAME) == 0)
620 && ((er_flags & QR_PASSWORDED) == 0) )
622 wprintf("> Private - invitation only\n");
624 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"bump\" VALUE=\"yes\" ");
625 wprintf("> If private, cause current users to forget room\n");
629 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"prefonly\" VALUE=\"yes\" ");
630 if (er_flags & QR_PREFONLY) wprintf("CHECKED ");
631 wprintf("> Preferred users only\n");
633 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"readonly\" VALUE=\"yes\" ");
634 if (er_flags & QR_READONLY) wprintf("CHECKED ");
635 wprintf("> Read-only room\n");
637 /* directory stuff */
638 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"directory\" VALUE=\"yes\" ");
639 if (er_flags & QR_DIRECTORY) wprintf("CHECKED ");
640 wprintf("> File directory room\n");
642 wprintf("<UL><LI>Directory name: ");
643 wprintf("<INPUT TYPE=\"text\" NAME=\"er_dirname\" VALUE=\"%s\" MAXLENGTH=\"14\">\n",er_dirname);
645 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"ulallowed\" VALUE=\"yes\" ");
646 if (er_flags & QR_UPLOAD) wprintf("CHECKED ");
647 wprintf("> Uploading allowed\n");
649 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"dlallowed\" VALUE=\"yes\" ");
650 if (er_flags & QR_DOWNLOAD) wprintf("CHECKED ");
651 wprintf("> Downloading allowed\n");
653 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"visdir\" VALUE=\"yes\" ");
654 if (er_flags & QR_VISDIR) wprintf("CHECKED ");
655 wprintf("> Visible directory</UL>\n");
657 /* end of directory stuff */
659 wprintf("<LI><INPUT TYPE=\"checkbox\" NAME=\"network\" VALUE=\"yes\" ");
660 if (er_flags & QR_NETWORK) wprintf("CHECKED ");
661 wprintf("> Network shared room\n");
663 /* start of anon options */
665 wprintf("<LI>Anonymous messages<UL>\n");
667 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"no\" ");
668 if ( ((er_flags & QR_ANONONLY)==0)
669 && ((er_flags & QR_ANONOPT)==0)) wprintf("CHECKED ");
670 wprintf("> No anonymous messages\n");
672 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anononly\" ");
673 if (er_flags & QR_ANONONLY) wprintf("CHECKED ");
674 wprintf("> All messages are anonymous\n");
676 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"anon\" VALUE=\"anon2\" ");
677 if (er_flags & QR_ANONOPT) wprintf("CHECKED ");
678 wprintf("> Prompt user when entering messages</UL>\n");
680 /* end of anon options */
682 wprintf("<LI>Room aide: \n");
686 wprintf("<EM>%s</EM>\n",&buf[4]);
689 extract(er_roomaide,&buf[4],0);
690 wprintf("<INPUT TYPE=\"text\" NAME=\"er_roomaide\" VALUE=\"%s\" MAXLENGTH=\"25\">\n",er_roomaide);
693 wprintf("</UL><CENTER>\n");
694 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
695 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
696 wprintf("</CENTER>\n");
703 * save new parameters for a room
705 void editroom(void) {
708 char er_password[10];
710 char er_roomaide[26];
716 if (strcmp(bstr("sc"),"OK")) {
717 display_error("Cancelled. Changes were not saved.");
725 display_error(&buf[4]);
729 extract(er_name,&buf[4],0);
730 extract(er_password,&buf[4],1);
731 extract(er_dirname,&buf[4],2);
732 er_flags=extract_int(&buf[4],3);
734 strcpy(er_roomaide,bstr("er_roomaide"));
735 if (strlen(er_roomaide)==0) {
739 strcpy(er_roomaide,"");
742 extract(er_roomaide,&buf[4],0);
746 strcpy(buf,bstr("er_name")); buf[20] = 0;
747 if (strlen(buf)>0) strcpy(er_name,buf);
749 strcpy(buf,bstr("er_password")); buf[10] = 0;
750 if (strlen(buf)>0) strcpy(er_password,buf);
752 strcpy(buf,bstr("er_dirname")); buf[15] = 0;
753 if (strlen(buf)>0) strcpy(er_dirname,buf);
755 strcpy(buf,bstr("type"));
756 er_flags &= !(QR_PRIVATE|QR_PASSWORDED|QR_GUESSNAME);
758 if (!strcmp(buf,"invonly")) {
759 er_flags |= (QR_PRIVATE);
761 if (!strcmp(buf,"guessname")) {
762 er_flags |= (QR_PRIVATE | QR_GUESSNAME);
764 if (!strcmp(buf,"passworded")) {
765 er_flags |= (QR_PRIVATE | QR_PASSWORDED);
768 if (!strcmp(bstr("prefonly"),"yes")) {
769 er_flags |= QR_PREFONLY;
772 er_flags &= ~QR_PREFONLY;
775 if (!strcmp(bstr("readonly"),"yes")) {
776 er_flags |= QR_READONLY;
779 er_flags &= ~QR_READONLY;
782 if (!strcmp(bstr("network"),"yes")) {
783 er_flags |= QR_NETWORK;
786 er_flags &= ~QR_NETWORK;
789 if (!strcmp(bstr("directory"),"yes")) {
790 er_flags |= QR_DIRECTORY;
793 er_flags &= ~QR_DIRECTORY;
796 if (!strcmp(bstr("ulallowed"),"yes")) {
797 er_flags |= QR_UPLOAD;
800 er_flags &= ~QR_UPLOAD;
803 if (!strcmp(bstr("dlallowed"),"yes")) {
804 er_flags |= QR_DOWNLOAD;
807 er_flags &= ~QR_DOWNLOAD;
810 if (!strcmp(bstr("visdir"),"yes")) {
811 er_flags |= QR_VISDIR;
814 er_flags &= ~QR_VISDIR;
817 strcpy(buf,bstr("anon"));
819 er_flags &= ~(QR_ANONONLY | QR_ANONOPT);
820 if (!strcmp(buf,"anononly")) er_flags |= QR_ANONONLY;
821 if (!strcmp(buf,"anon2")) er_flags |= QR_ANONOPT;
824 if (!strcmp(bstr("bump"),"yes")) bump = 1;
826 er_floor = atoi(bstr("er_floor"));
828 sprintf(buf,"SETR %s|%s|%s|%u|%d|%d",
829 er_name,er_password,er_dirname,er_flags,bump,er_floor);
833 display_error(&buf[4]);
836 gotoroom(er_name, 0);
838 if (strlen(er_roomaide)>0) {
839 sprintf(buf,"SETA %s",er_roomaide);
843 display_error(&buf[4]);
848 gotoroom(er_name, 1);
854 * display the form for entering a new room
856 void display_entroom(void) {
863 display_error(&buf[4]);
867 printf("HTTP/1.0 200 OK\n");
868 output_headers(1, "bottom");
870 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=000077><TR><TD>");
871 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
872 wprintf("<B>Enter (create) a new room</B>\n");
873 wprintf("</FONT></TD></TR></TABLE>\n");
875 wprintf("<FORM METHOD=\"POST\" ACTION=\"/entroom\">\n");
877 wprintf("<UL><LI>Name of room: ");
878 wprintf("<INPUT TYPE=\"text\" NAME=\"er_name\" MAXLENGTH=\"19\">\n");
880 wprintf("<LI>Type of room:<UL>\n");
882 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"public\" ");
883 wprintf("CHECKED > Public room\n");
885 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"guessname\" ");
886 wprintf("> Private - guess name\n");
888 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"passworded\" ");
889 wprintf("> Private - require password:\n");
890 wprintf("<INPUT TYPE=\"text\" NAME=\"er_password\" MAXLENGTH=\"9\">\n");
892 wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
893 wprintf("> Private - invitation only\n");
895 wprintf("<CENTER>\n");
896 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
897 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
898 wprintf("</CENTER>\n");
899 wprintf("</FORM>\n");
912 char er_password[10];
915 if (strcmp(bstr("sc"),"OK")) {
916 display_error("Cancelled. No new room was created.");
920 strcpy(er_name,bstr("er_name"));
921 strcpy(er_type,bstr("type"));
922 strcpy(er_password,bstr("er_password"));
925 if (!strcmp(er_type,"guessname")) er_num_type = 1;
926 if (!strcmp(er_type,"passworded")) er_num_type = 2;
927 if (!strcmp(er_type,"invonly")) er_num_type = 3;
929 sprintf(buf,"CRE8 1|%s|%d|%s",er_name,er_num_type,er_password);
933 display_error(&buf[4]);
936 gotoroom(er_name, 1);
941 * display the screen to enter a private room
943 void display_private(char *rname, int req_pass)
946 printf("HTTP/1.0 200 OK\n");
947 output_headers(1, "bottom");
949 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
950 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
951 wprintf("<B>Goto a private room</B>\n");
952 wprintf("</FONT></TD></TR></TABLE>\n");
954 wprintf("<CENTER>\n");
955 wprintf("If you know the name of a hidden (guess-name) or\n");
956 wprintf("passworded room, you can enter that room by typing\n");
957 wprintf("its name below. Once you gain access to a private\n");
958 wprintf("room, it will appear in your regular room listings\n");
959 wprintf("so you don't have to keep returning here.\n");
962 wprintf("<FORM METHOD=\"POST\" ACTION=\"/goto_private\">\n");
964 wprintf("<TABLE border><TR><TD>");
965 wprintf("Enter room name:</TD><TD>");
966 wprintf("<INPUT TYPE=\"text\" NAME=\"gr_name\" VALUE=\"%s\" MAXLENGTH=\"19\">\n",rname);
969 wprintf("</TD></TR><TR><TD>");
970 wprintf("Enter room password:</TD><TD>");
971 wprintf("<INPUT TYPE=\"password\" NAME=\"gr_pass\" MAXLENGTH=\"9\">\n");
974 wprintf("</TD></TR></TABLE>\n");
976 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
977 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
978 wprintf("</FORM>\n");
983 * goto a private room
985 void goto_private(void) {
989 if (strcasecmp(bstr("sc"),"OK")) {
994 strcpy(hold_rm,wc_roomname);
996 strcat(buf,bstr("gr_name"));
998 strcat(buf,bstr("gr_pass"));
1003 gotoroom(bstr("gr_name"),1);
1007 if (!strncmp(buf,"540",3)) {
1008 display_private(bstr("gr_name"),1);
1012 printf("HTTP/1.0 200 OK\n");
1013 output_headers(1, "bottom");
1014 wprintf("%s\n",&buf[4]);
1021 * display the screen to zap a room
1023 void display_zap(void) {
1024 printf("HTTP/1.0 200 OK\n");
1025 output_headers(1, "bottom");
1027 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1028 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1029 wprintf("<B>Zap (forget) the current room</B>\n");
1030 wprintf("</FONT></TD></TR></TABLE>\n");
1032 wprintf("If you select this option, <em>%s</em> will ", wc_roomname);
1033 wprintf("disappear from your room list. Is this what you wish ");
1034 wprintf("to do?<BR>\n");
1036 wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\">\n");
1037 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
1038 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1039 wprintf("</FORM>\n");
1050 if (strcmp(bstr("sc"),"OK")) {
1051 display_main_menu();
1055 serv_printf("GOTO %s", wc_roomname);
1057 if (buf[0] != '2') {
1058 display_error(&buf[4]);
1064 if (buf[0] != '2') {
1065 display_error(&buf[4]);
1069 gotoroom(bstr("_BASEROOM_"),1);
1076 * Confirm deletion of the current room
1078 void confirm_delete_room(void) {
1081 serv_puts("KILL 0");
1083 if (buf[0] != '2') {
1084 display_error(&buf[4]);
1088 printf("HTTP/1.0 200 OK\n");
1089 output_headers(1, "bottom");
1090 wprintf("<TABLE WIDTH=100% BORDER=0 BGCOLOR=770000><TR><TD>");
1091 wprintf("<FONT SIZE=+1 COLOR=\"FFFFFF\"");
1092 wprintf("<B>Confirm deletion of room</B>\n");
1093 wprintf("</FONT></TD></TR></TABLE>\n");
1095 wprintf("<CENTER>");
1096 wprintf("<FORM METHOD=\"POST\" ACTION=\"/delete_room\">\n");
1098 wprintf("Are you sure you want to delete <FONT SIZE=+1>");
1099 escputs(wc_roomname);
1100 wprintf("</FONT>?<BR>\n");
1102 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Delete\">");
1103 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
1105 wprintf("</FORM></CENTER>\n");
1111 * Delete the current room
1113 void delete_room(void) {
1117 strcpy(sc, bstr("sc"));
1119 if (strcasecmp(sc, "Delete")) {
1120 display_error("Cancelled. This room was not deleted.");
1124 serv_puts("KILL 1");
1126 if (buf[0] != '2') {
1127 display_error(&buf[4]);
1130 gotoroom("_BASEROOM_", 1);