fuzzball
fuzzball copied to clipboard
Make 'dbcat' command
This is necessary to have a 'mergable' database.
My recommendation is to use python and to extend the fuzzball python lib I've already started with the ability to read and manipulate FB DB's because I think that would be cool to have. However, any modern and common scripting language is fine.
Python lib lives here: https://github.com/tanabi/pyfuzzball
Anyway, the idea is as follows. You'd run the command thusly:
dbcat advancedb.db std-db.new > std-db.newer
This would concatenate advancedb.db and std-db.new together. In order for this to work, there must be a marker object in std-db.new.
When std-db is initially built from advancedb (or whatever base DB), create a marker object with a property called @/DBCAT-MARKER:yes
When run, dbcat will scan std-db.new and find the lowest numbered object with the DBCAT-MARKER prop. All objects below that marker will be truncated, and the DB in the first parameter of dbcat (advancedb.db) will be injected there. The script will then re-number the rest of the database, moving the numbers up or down as needed. Be wary that links and other references must be maintained and adjusted as well.
This includes references in somewhat hidden places, such as in properties as both ref properties and things like: {list:whatever,#12345}
properties with references in them.
Further, because we are repeatedly wiping #0 out and rebuilding it, we may want to use the marker object for other things that need to be copied back onto #0 -- registration properties, for instance, and links that can simply be copied and attached to #0 as needed.
MUF code will be copied over, and I suppose we should filter DBREF's in them too.
In the end, though, we'll have a way to automatically frankenstein a MUCK together, updating the base DB while keeping the rest (largely) intact.