[DGD] upgrading to 1.2.125 + 1.2.126
Felix A. Croes
felix at dworkin.nl
Thu May 24 22:41:55 CEST 2007
Upgrading a persistent mud to 1.2.126 will take some care.
1.2.125:
First reboot into 1.2.125, then make the following changes in the
object manager: the source argument to compile() and compile_lib()
will become a (possibly empty) array of strings. Prepare for that
by changing the parameter type to string*, and by adding something
like the following code at the beginning of those functions:
/*
* these minimal changes are only needed if you actually do
* something with the source code
*/
if (sizeof(source) != 0) {
source = source[0];
} else {
source = nil;
}
After that, make sure to recompile the driver object, the auto object
and the object manager during the same execution round before you
upgrade the rest of the mudlib.
1.2.126:
Before rebooting into 1.2.126, recompile the driver object from the
new code, and make the following changes to the object manager:
- make sure that path_special() and include() can be called locally,
as well as from the driver object
- add a new function include_file() like the following:
mixed include_file(string compiled, string from, string path)
{
if (path == "/include/AUTO" && from == "/include/std.h" &&
driver->creator(compiled) != "System") {
/*
* special object-dependent include file
*/
return path_special(compiled);
}
include(from, path);
return path;
}
this will make the new interface use the old functionality.
- recompile the object manager.
At this point, the driver object and object manager are prepared,
and you can reboot into 1.2.126.
These are just the minimal changes so that your mudlib won't break
during the upgrade; to actually do something with all source array
strings, you'll have to properly add that functionality to the
object manager. Likewise, after 1.2.126 you'll no longer have to
make use of path_special(), since you'll have more control about
what source file includes which include file.
To return an include 'file' directly from the object manager, add
something like the following below 'include(from, path);' above:
{
string str;
str = read_file(path);
if (str) {
return ({ "#line 1 \"" + path + "\"\n", str });
}
}
Regards,
Dworkin
More information about the DGD
mailing list