[Prev][Next][Index][Thread]

# Re: object dating

- Date: Mon, 11 Sep 1995 20:34:18 PDT
- From:
- cc: MOO-Cows.PARC@xerox.com
- Content-Type: TEXT/PLAIN; charset=US-ASCII
- In-Reply-to: <v02120d02ac7a494cac2a@[198.81.209.50]>

    On Mon, 11 Sep 1995, Linda Polin wrote:

    > Is there a way to tell the date/time a player's objects were created or
    > last modified? Obj#'s recycle and so numerical order doesn't work.
    >
    > Linda

    The best way I can think of, even though it may take a while to do, is this:

    1) If you don't have $server_options, then create it (simply @create #1
    named Server Options, and put its # in a property on #0 called
    'server_options')

    2) Make a property on #1 called 'created'.  Ofcourse, make sure that it's -c.

    3) Add a property to it, called 'protect_create'.  This'll wiz-only the
    'create' builtin.

    4) Make your own create() verb in-database, #0:create.  It'll just return
    $server_options:create(@args).

    5) Make $server_options:create.  Put all your code in there to put time()
    in each object's .created property, after it calls the create() builtin
    with the caller permissions and checks for errors.  You can also put any
    other restrictions on create() in here.

    	(NOTE:  if the object being created is not a descendant of #1,
    you may want to return E_PERM or E_INVARG, since it wouldn't inherit the
    .created property)

    6) Change every reference to create() in the database to #0:create().
    I'm not sure how many times it's called in the database.  It may be only
    a couple or it may be a lot.

    If you're going to do this, I also would suggest protecting the
    'chparent' builtin and making it check to see if the object is being
    chparented to something that doesn't have the .created property (ie #-1),
    and return E_PERM or E_INVARG if so.

    Ofcourse, unless you're an accomplished MOO programmer, you would
    probably find the task of making date/time stamps a little imposing.
    Never fear, there are other ways to do it, even though I don't think that
    they are as foolproof and accurate as this one.  For instance, anyone
    can get around the #1:initialize fix by simply programming their own
    :initialize verb on the parent object.  If you do choose to try
    programming it this way, you just may learn something. :-)

    Phantom

References:

- object dating

- From: lpolin@pepperdine.edu (Linda Polin)

- Prev: Re: object dating
- Next: Re: okay as I did as pavel and a few other suggested and got this error now
- Index: MOO-cows
- Thread: MOO-cows

Home | Subject Index | Thread Index