Subject: Checking if a player is logged in

From: [email-masked] (Billy Chambless)
Date: Wed, 22 Sep 1993 09:18:52 -0700

I've pored over dumps of the generic player, but...is
there a property or a flag to easily check if a player is logged in?
I'm working on several verbs that need to know if the player is on.

---

From: [email-masked] (Erik Ostrom)
Date: Wed, 22 Sep 1993 05:21:47 -0700

> I'm working on several verbs that need to know if the player is on.

p in connected_players() => true iff p is logged in

idle_seconds(p) => true iff p is logged in, but can only be used in a !d verb

The former is probably clearer, if marginally less efficient; and the
idea of worrying about this degree of performance difference in
MOO-Code is kind of silly.  It's possible that a
something:is_logged_in() verb would be nice for clarity, since this is
fairly often wanted information.

--Erik/JF

---

From: Judy Anderson <[email-masked]>
Date: Wed, 22 Sep 1993 10:27:05 -0700

$object_utils:connected(object)

Probably not in your core, completely trivial:

$object_utils:"connected"   this none this
 1:  ":connected(object) => true iff object is a connected player.";
 2:  "equivalent to (object in connected_players()) perhaps with less server overhead";
 3:  "use object:is_listening() if you want to allow for puppets and other non-player objects that still 'care' about what's said.";
 4:  return 1 + connected_seconds(@args);

Don't forget to make it !d

---

From: Larry Masinter <[email-masked]>
Date: Wed, 22 Sep 1993 10:31:45 -0700

Frequently, what people want is 

  something:is_listening()

which is used to tell if something somehow cares whether it hears
messages. I installed this for use by the generic announcer, following
dog, etc.

The idea is that a player :is_listening if the player is logged on.
A puppet :is_listening if it is forwarding to something that
:is_listening, a vehicle or portable room :is_listening if it is
passing messages inward to something that :is_listening, etc.