Re: Versioning w/ Oasis

From: StormeRider (silk@ici.net)
Date: 01/31/00


At 07:25 PM 1/30/00 -0800, Neal Lahndorff wrote:
>If you're going to add new fields that will change file formats, its
>a hell of a lot quicker to just alter your *edit_save_to_disk functions
>to insert default values into the new fields, save every zone, fix the
>rest of your code to read in the new format, and boom, you're done.
>No hand editing, and no need for 50 different versions of the parse_room
>function because of added fields.  Having to maintain some semblence of
>order in db.c where you need any number of version of parse_room because
>of multiple format changes would be a hideous nightmare.
>
>StormeRider wrote:
> >
> > Ie, a long time back I wrote a patch that sits on the ftp site as
> > areas.patch. It adds a few
> > more fields to the zone file format. Once you have applied the patch,
> > you must go through _every_ zone file and _by hand_ add in the
> > additional fields.
> >
> > With versioning, you can see that the version is lesser than the
> > current, so you don't try to scanf with an incorrect format, you
> > add in default values to the struct, and let the MUD
> > integrate default values, write it back out in the new version, and you
> > never have to hand edit your area files.


The way I plan on doing it is this:

* code new fields in the save, etc., functions.
* increment version #
* change the load function to read in the old version if the version is one
   less than the current, then save it right away, bringing it up to the new
   version.
* at leisure, change the load functions to only read the current version.

This way I only really need to do one reboot/copyover, not two, and I don't
have to write something to save all zones, and I don't have to do it manually.

--SR


     +------------------------------------------------------------+
     | 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