dbm/
misc/
old-docs/
Introduction
------------

	For a long time it had been a pipe dream to run TinyMUD databases under
TeenyMUD. One day on (EVIL!)Mud it was asked of Xibo and I if a db converter 
was available, which it wasn't at the time. Upon a suggestion of Xibo's, locks
were converted, and the converter sprang into life as a simple, single file,
C program that cnverts everything from the order of the strings to locks, and
a routine/command within the TeenyMUD dbm that does one final pass of 
database conversion to move exits around.
	Databases like the commonly available `small.db', `tinybase.db' and
the `Classic' TinyMUD database have successfully been converted in the past,
and the converter supports all known TinyMUD database types through TinyMUD
release 1.5.5, with `garbage' objects and 1.5.4f style timestamping.


Compiling the converter
-----------------------

	Simply typing `make convert' from the the main directory will compile
a converter capable of converting standard TinyMUD databases through version
1.5.4. If you need to convert a 1.5.4f or 1.5.5 database with timestamps,
or a 1.5.5 database that contains garbage objects, you must type the
command to compile the converter yourself.
	There are three compile time options for the converter:
		-DGARBAGE	supports 1.5.5 style garbage entries
		-DTIMESTAMPS	supports 1.5.4f/1.5.5 style timestamping
		-DPIPE		pipes final output through the `compress'
				program
	If you wish to use any of these options, you must compile the
converter from the command line, i.e. the command
	cc -O -s -DGARBAGE -DTIMESTAMPS misc/convert.c -o tiny-convert
would be appropriate if you wished to convert a TinyMUD 1.5.5 database
that included the 1.5.5 optional timestamping.


Using the converter
-------------------

	Converting a TinyMUD database to one readable by TeenyMUD 1.2 is
a two step process, the first being running the `tiny-convert' or `convert'
program on it, and the second being executing the command `fix-exits' from
within the dbm.
	The converter program excepts the following command line arguments
when executed: <input db> <output db> [<temp db>] [<#>].
	The first is the filename of the TinyMUD database you wish to 
convert, while the second argument is the name of the file you want the
final databse to end up in. These two arguments are required, while the
second two are not. The third argument is where to keep the `work' or
`temp' db, and defaults to /tmp/cnvt<pid>. Note that this file can be
quite large if you're converting a large db, so put it somewhere with a
lot of free space available. The fourth argument is a number reflecting how
many objects to offset things. This is used for merging databases, and
is explained further along in this document.  Be very sure to use different
filenames for your input and output db, it's fairly important.
	After running a TinyMUD database through the converter program,
one must now produce a bit/index style database to load into the dbm
program. Do this by booting up a TeenyMUD server with the textdump
that was produced by the converter (using the -t flag to teenymud), and
shuting the server down. Then simply start the dbm program using the bits 
and index files, and type the command `fix-exits' at the dbm> prompt, 
followed by the dbm `quit' command.  You can then reboot your TeenyMUD 
server using the bits/index files and proceed, running with a fully 
converted TinyMUD database.


Merging a TinyMUD extract into an existing TeenyMUD database
------------------------------------------------------------

	This process is very convoluted, invovled, and has only succesfully
been done one time prior to this writing. It is not recommended that someone
without a lot of experience with TeenyMUD even attempt this! Warnings aside,
be sure to have a couple backups of your existing TeenyMUD textdump.
	First, look at the tail end of your TeenyMUD textdump to figure out
what the very last object number in your database is. Never assume, always
check first. Then, look at the start of the TinyMUD extract and remove any
"Limbo", i.e. room #0, that may be in it, so that only the objects you want
to merge are in the file (they must be sequential!).
	Now, run the TinyMUD extract through the converter program, using
all four arguments (the second one is ignored, just specify "/dev/null"
or somesuch), with the fourth argument specifing how many objects to offset
the output file. So, if the last object in your TeenyMUD textdump was #1500,
and the TinyMUD extract started with #3, you'd want an offset of 1498 objects,
so that the resulting output file would begin with object number #1501.
	Now, start up an editor, editing your TeenyMUD textdump. Go to the
end of the textdump file, and insert (read in) the output file from the
converter program right before the "*** End of dump***" line in the
textdump. If your converter was compiled to convert a TinyMUD database
that contained timestamps, it produced output in TeenyMUD version 2 format,
if not, it produced output in version 1 format. You'll need to specify the
format version directly before the first object of the converted TinyMUD
extract within the TeenyMUD textdump. Do this by inserting a line of
"~1" or "~2", without quotes, depending on how the converter was compiled.
	Then go to the start of the TeenyMUD textdump, and find the line that
starts with a "%" sign. This line contains the total number of objects in the
database, and must be increased to reflect the number of objects that were
in the converted and merged TinyMUD extract.
	You should then be able to boot up a server with the textdump,
produce a set of bits and index files, and do the `fix-exits' command in
the dbm on them. Then you should have a merged database fit for use in
the bits/index files.
	If any errors occur during the merging process, it's best to start
reading and understanding source code. If you don't know C, you shouldn't
have been attempting this proceedure to begin with.