MOO-cows Mailing List Archive
Re: Bb's Wish List (Sept 96)
--- "Seth I. Rich" wrote:
> - connected_seconds() should return the number of seconds a not-yet-connected
> player object as been connected. I don't see why idle_seconds() should
> and connected_seconds() shouldn't. This can be very useful in this day of
> using MOO to handle strange and miraculous network utilities.
You could, of course, keep an index of connection times from $do_login_command,
but does seem silly that connected_seconds() doesn't handle it. I tend to
bypass the problem entirely by having a 'connection object' that gets @created
when a player logs in, do_login_command instantly attaches a connection to it,
and then verbs on the object itself handle the rest of the interaction
($www.object:GET any any any, for example)
> - connection_object(OBJ player) should, for an object which has an active
> network connection, return the listening object through which that object
> is connected. If foo (#234) is connected, I'd like to know if foo came in
> through $login or $httpd or wherever -- so, for example, I can throw the
> right kind of text his way in $handle_uncaught_error.
This can be done in-db as follows (from $handle_uncaught_error):
port = tonum($string_utils:explode(connection_name(player)));
listener = $list_utils:assoc(port, listeners(), 2);
However, yes, a function would be nice. Perhaps unlisten() should also be able
to accept an Object, so you can boot objects.
BTW, my server patch for non-overrideable verbs has been behaving nicely on a
medium-to-large size MOO for the past month or so, so I think it is probably
not going to crash anything. I'll be making it available as soon as I can find
an anon FTP site or WWW space to put it on.
Subject Index |