]> code.citadel.org Git - citadel.git/blobdiff - webcit/roomops.c
* Brought over the newer string tokenizer from Citadel
[citadel.git] / webcit / roomops.c
index 2847d18ad21807b5bf0ed80f488e24615318080a..1a3c2960c9d42f403e1d1a0d0d45b7b3d72d2689 100644 (file)
@@ -28,7 +28,7 @@
 
 
 
-char floorlist[128][256];
+char floorlist[128][SIZ];
 
 
 /*
@@ -37,7 +37,7 @@ char floorlist[128][256];
 void load_floorlist(void)
 {
        int a;
-       char buf[256];
+       char buf[SIZ];
 
        for (a = 0; a < 128; ++a)
                floorlist[a][0] = 0;
@@ -150,7 +150,7 @@ int rordercmp(struct roomlisting *r1, struct roomlisting *r2)
  */
 void listrms(char *variety)
 {
-       char buf[256];
+       char buf[SIZ];
        int num_rooms = 0;
 
        struct roomlisting *rl = NULL;
@@ -220,7 +220,7 @@ void listrms(char *variety)
 void list_all_rooms_by_floor(void)
 {
        int a;
-       char buf[256];
+       char buf[SIZ];
 
        load_floorlist();
 
@@ -287,7 +287,7 @@ void zapped_list(void)
  */
 void readinfo(void)
 {
-       char buf[256];
+       char buf[SIZ];
 
        serv_puts("RINF");
        serv_gets(buf);
@@ -307,7 +307,7 @@ void readinfo(void)
  * another room.
  */
 void embed_room_graphic(void) {
-       char buf[256];
+       char buf[SIZ];
 
        serv_puts("OIMG _roompic_");
        serv_gets(buf);
@@ -339,7 +339,7 @@ void embed_newmail_button(void) {
 
 
 void embed_room_banner(char *got) {
-       char fakegot[256];
+       char fakegot[SIZ];
 
        /* We need to have the information returned by a GOTO server command.
         * If it isn't supplied, we fake it by issuing our own GOTO.
@@ -360,7 +360,6 @@ void embed_room_banner(char *got) {
        svcallback("ROOMINFO", readinfo);
        svcallback("YOUHAVEMAIL", embed_newmail_button);
 
-
        do_template("roombanner.html");
        clear_local_substs();
 }
@@ -378,7 +377,7 @@ void embed_room_banner(char *got) {
  */
 void gotoroom(char *gname, int display_name)
 {
-       char buf[256];
+       char buf[SIZ];
        static long ls = (-1L);
 
 
@@ -388,7 +387,10 @@ void gotoroom(char *gname, int display_name)
                 wprintf("Cache-Control: no-store\n");
 
                wprintf("<HTML><HEAD>\n"
+                       "<META HTTP-EQUIV=\"refresh\" CONTENT=\"500363689;\">\n"
                        "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n"
+                       "<META HTTP-EQUIV=\"expired\" CONTENT=\"28-May-1971 18:10:00 GMT\">\n"
+                       "<meta name=\"MSSmartTagsPreventParsing\" content=\"TRUE\">\n"
                        "</HEAD>\n");
                do_template("background.html");
        }
@@ -484,7 +486,7 @@ char *pop_march(int desired_floor)
  */
 void gotonext(void)
 {
-       char buf[256];
+       char buf[SIZ];
        struct march *mptr, *mptr2;
        char next_room[32];
 
@@ -554,7 +556,7 @@ void smart_goto(char *next_room) {
  */
 void slrp_highest(void)
 {
-       char buf[256];
+       char buf[SIZ];
 
        /* set pointer */
        serv_puts("SLRP HIGHEST");
@@ -571,7 +573,7 @@ void slrp_highest(void)
  */
 void ungoto(void)
 {
-       char buf[256];
+       char buf[SIZ];
 
        if (!strcmp(WC->ugname, "")) {
                smart_goto(WC->wc_roomname);
@@ -597,7 +599,7 @@ void ungoto(void)
  */
 void display_editroom(void)
 {
-       char buf[256];
+       char buf[SIZ];
        char er_name[20];
        char er_password[10];
        char er_dirname[15];
@@ -779,7 +781,7 @@ void display_editroom(void)
  */
 void editroom(void)
 {
-       char buf[256];
+       char buf[SIZ];
        char er_name[20];
        char er_password[10];
        char er_dirname[15];
@@ -925,7 +927,7 @@ void editroom(void)
  */
 void display_whok(void)
 {
-        char buf[256], room[256], username[256];
+        char buf[SIZ], room[SIZ], username[SIZ];
 
         serv_puts("GETR");
         serv_gets(buf);
@@ -1000,7 +1002,8 @@ void display_whok(void)
  */
 void display_entroom(void)
 {
-       char buf[256];
+       int i;
+       char buf[SIZ];
 
        serv_puts("CRE8 0");
        serv_gets(buf);
@@ -1035,12 +1038,32 @@ void display_entroom(void)
 
        wprintf("<LI><INPUT TYPE=\"radio\" NAME=\"type\" VALUE=\"invonly\" ");
        wprintf("> Private - invitation only\n");
+       wprintf("</UL>\n");
+
+        wprintf("<LI>Resides on floor: ");
+        load_floorlist(); 
+        wprintf("<SELECT NAME=\"er_floor\" SIZE=\"1\">\n");
+        for (i = 0; i < 128; ++i)
+                if (strlen(floorlist[i]) > 0) {
+                        wprintf("<OPTION ");
+                        wprintf("VALUE=\"%d\">", i);
+                        escputs(floorlist[i]);
+                        wprintf("</OPTION>\n");
+                }
+        wprintf("</SELECT>\n");                
+       wprintf("</UL>\n");
+
 
        wprintf("<CENTER>\n");
        wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
        wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
        wprintf("</CENTER>\n");
-       wprintf("</FORM>\n");
+       wprintf("</FORM>\n<HR>");
+       serv_printf("MESG roomaccess");
+       serv_gets(buf);
+       if (buf[0] == '1') {
+               fmout(NULL);
+       }
        wDumpContent(1);
 }
 
@@ -1051,10 +1074,11 @@ void display_entroom(void)
  */
 void entroom(void)
 {
-       char buf[256];
+       char buf[SIZ];
        char er_name[20];
        char er_type[20];
        char er_password[10];
+       int er_floor;
        int er_num_type;
 
        if (strcmp(bstr("sc"), "OK")) {
@@ -1064,6 +1088,7 @@ void entroom(void)
        strcpy(er_name, bstr("er_name"));
        strcpy(er_type, bstr("type"));
        strcpy(er_password, bstr("er_password"));
+       er_floor = atoi(bstr("er_floor"));
 
        er_num_type = 0;
        if (!strcmp(er_type, "guessname"))
@@ -1073,7 +1098,8 @@ void entroom(void)
        if (!strcmp(er_type, "invonly"))
                er_num_type = 3;
 
-       sprintf(buf, "CRE8 1|%s|%d|%s", er_name, er_num_type, er_password);
+       sprintf(buf, "CRE8 1|%s|%d|%s|%d", 
+               er_name, er_num_type, er_password, er_floor);
        serv_puts(buf);
        serv_gets(buf);
        if (buf[0] != '2') {
@@ -1130,7 +1156,7 @@ void display_private(char *rname, int req_pass)
 void goto_private(void)
 {
        char hold_rm[32];
-       char buf[256];
+       char buf[SIZ];
 
        if (strcasecmp(bstr("sc"), "OK")) {
                display_main_menu();
@@ -1188,8 +1214,8 @@ void display_zap(void)
  */
 void zap(void)
 {
-       char buf[256];
-       char final_destination[256];
+       char buf[SIZ];
+       char final_destination[SIZ];
 
        /* If the forget-room routine fails for any reason, we fall back
         * to the current room; otherwise, we go to the Lobby
@@ -1222,7 +1248,7 @@ void zap(void)
  */
 void confirm_delete_room(void)
 {
-       char buf[256];
+       char buf[SIZ];
 
        serv_puts("KILL 0");
        serv_gets(buf);
@@ -1256,8 +1282,8 @@ void confirm_delete_room(void)
  */
 void delete_room(void)
 {
-       char buf[256];
-       char sc[256];
+       char buf[SIZ];
+       char sc[SIZ];
 
        strcpy(sc, bstr("sc"));