MOO-cows Mailing List Archive
Re: [SERVER] chparent()
Date: Thu, 21 Mar 1996 11:04:05 PST
From: firstname.lastname@example.org (Richard Connamacher)
Content-Type: text/plain; charset="us-ascii"
At 9:13 AM 3/20/96, Ranalou wrote:
>I know that it is so with create(), but when a chparent() is done, does
>the :initialize() verb on the changed object get called? If not, why?
>And, if there is no reason why this would be a bad thing, I'd like to add
>it to the wish-list for future servers...
Doing it in the server may be a bad thing, but I've hacked an in-database
equivalent of what you said on BayMOO. Here's how it works.
parent = the parent being chaprented to
kid = what's being chparented
old_parent = the parent being chparented from
If parent is -f, E_PERM is returmed
If parent:chparent_acceptable exists and is +x, it is called, with args
== kid. If a negative value is returned, than E_PERM is returned.
The chparent is actually done.
If parent:chparent_addkid exists and is +x, it is called with args == kid.
If old_parent:chparent_rmkid exists and is +x, it is called with args == kid.
For now it's written using $server_options:chparent(), called from
$chparent(). Since BayMOO uses 1.7.8p5 (the 5 is for a ton of extra
patches we've added to it), it's all done with forks and stuff to ensure
that a chparent_addkid traceback doesn't keep chparent_rmkid from being
called. (We're looking into 1.8.0, and with TRY, and the bf wrappers, we
could make a much cleaner implimentation of it.)
-----BEGIN PGP PUBLIC KEY BLOCK-----
-----END PGP PUBLIC KEY BLOCK-----
Subject Index |