[NEWBIE]*edit_save_to_disk?

From: John Hines (jahweb@grnco.net)
Date: 06/21/00


Hello good folks,
        I have been editing a copy of VisionMUD and I seem to have a problem
with saving. The MUD every once in a while for certian builders will
totally wipe out a zones room descriptions. This is very odd for me
because the MUD does not skip a beat...no crash...no lag...nothing.
This implies to me that the code is doing what it should be.

redit_save_to_disk:

 void redit_save_to_disk(struct descriptor_data *d)
{
  int counter, counter2, realcounter;
  FILE *fp;
  struct room_data *room;
  struct extra_descr_data *ex_desc;

  sprintf(buf, "%s/%d.wld", WLD_PREFIX, zone_table[OLC_ZNUM(d)].number);
  if (!(fp = fopen(buf, "w+")))
  { mudlog("SYSERR: OLC: Cannot open room file!", BRF, LVL_BUILDER,
TRUE);
    return;
  }

  for (counter = zone_table[OLC_ZNUM(d)].number * 100;
       counter <= zone_table[OLC_ZNUM(d)].top;
       counter++)
  { realcounter = real_room(counter);
    if (realcounter >= 0)
    {
      room = (world + realcounter);

      /*. Remove the '\r\n' sequences from description .*/
      strcpy(buf1, room->description ? room->description : "Empty");
      strip_string(buf1);

      /*. Build a buffer ready to save .*/
      sprintf(buf, "#%d\n%s~\n%s~\n%d %ld %ld %ld %ld %d\n",
                counter, room->name ? room->name : "undefined", buf1,
                zone_table[room->zone].number,
                room->room_flags[0], room->room_flags[1],
                room->room_flags[2], room->room_flags[3],
                room->sector_type
      );
      /*. Save this section .*/
      fputs(buf, fp);

          /*. Again, strip out the crap .*/
          if (room->dir_option[counter2]->general_description)
          { strcpy(buf1,
room->dir_option[counter2]->general_description);
            strip_string(buf1);
          } else
          *buf1 = 0;

          /*. Figure out door flag .*/
          if (IS_SET(room->dir_option[counter2]->exit_info, EX_ISDOOR))
          { if (IS_SET(room->dir_option[counter2]->exit_info,
EX_PICKPROOF))
              temp_door_flag = 2;
            else
              temp_door_flag = 1;
          } else
              temp_door_flag = 0;
           else
            *buf2 = 0;

          /*. Ok, now build a buffer to output to file .*/
          sprintf(buf, "D%d\n%s~\n%s~\n%d %d %d\n",
                        counter2, buf1, buf2, temp_door_flag,
                        room->dir_option[counter2]->key,
                        room->dir_option[counter2]->to_room != -1 ?

world[room->dir_option[counter2]->to_room].number : -1
          );
          /*. Save this door .*/
          fputs(buf, fp);
        }
      }
      if (room->ex_description)
      { for (ex_desc = room->ex_description; ex_desc; ex_desc =
ex_desc->next)
        { /*. Home straight, just deal with extras descriptions..*/
          strcpy(buf1, ex_desc->description);
          strip_string(buf1);
          sprintf(buf, "E\n%s~\n%s~\n", ex_desc->keyword,buf1);
          fputs(buf, fp);
        }
      }
      /* save teleport info */
      if ((room->tele != NULL) && (room->tele->targ > 0)) {
//        sprintbit(room->tele->mask, teleport_bits, buf1);
        sprintf(buf, "T\n%d %ld %d %d\n",
                room->tele->targ,
                room->tele->mask,
                room->tele->time,
                room->tele->obj);
        fputs(buf, fp);
         fprintf(fp, "A\n%ld\n", room->orig_affections);

      /* save spec proc */
      if (room->func != NULL)
          fprintf(fp, "P\n%s\n",
            room_procs[get_spec_name(room_procs, room->func)].name);

      fprintf(fp, "S\n");
    }
  }
  /* write final line and close */
  fprintf(fp, "$~\n");
  fclose(fp);
  olc_remove_from_save_list(zone_table[OLC_ZNUM(d)].number,
OLC_SAVE_ROOM);
  unlock_room_descs(OLC_ZNUM(d));
}

Whats mind boggling to me is the fact that this seems to happen to one
builder. I started logging the one builder to see if he was pulling my
leg and wiping his room descs to bother me (this builder is known to
joke to the point of being obnoxious but personal opinion aside he does
work on his areas which is hard to find nowadays it seems).
Nothing...nada...zip.
I see no reason in the code above or from various logs that the
descriptions should be disappearing.


Has anyone else had a problem of this type with VisionMUD or with thier
CircleMUD OLC? or am I missing something...:/
I found nothing in the list archives and no GDB backtrace available.
Also Electricfence doesnt catch anything (not sure of the Electricfence
config...not hosted locally)

Using VisionMUD release 11 with an UNMODIFIED OLC (from VisionMUD
release, of course the coder for VisionMUD modified what looks to be
Oasis 1.6b)

Thank you
Kimorgh


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT