connection as indicated by WHO.
The caller can use the function on himself, but using on any other
- player requires privileged power such as Wizard, Royalty or SEE_ALL.
+ player requires special powers.
See also: Connection Functions
& SENT()
function.
& LWHO()
lwho()
+ lwho(<viewer>)
+ lwhoid(<viewer>)
- This returns a list of the dbref numbers for all currently-connected
+ lwho() returns a list of the dbref numbers for all currently-connected
players. When mortals use this function, the dbref numbers of DARK
- directors or royalty do NOT appear on the dbref list.
+ privileged players do NOT appear on the dbref list.
If lwho() is given an argument, and used by an object that can see
DARK and Hidden players, lwho() returns the output of lwho() from
<viewer>'s point of view.
- See also: mwho()
+ lwohid() returns a list of objid's instead.
+
+See also: mwho(), xwho()
+
& MAP()
map([<object>/]<attribute>,<list>[,<delim>][, <osep>])
See also: anonymous attributes
& MWHO()
mwho()
+ mwhoid()
This returns a list of the dbref numbers for all current-connected,
non-hidden players. It's exactly the same as lwho() used by a
mortal, and is suitable for use on privileged global objects who
need an unprivileged who-list.
+
+ mwhoid() gives a list of objids instead of dbrefs.
+
& ALIAS()
alias(<player>[,<new alias>])
Returns the dbref number of the object, which must be in the same
room as the object executing num.
+& NWHO()
+ nwho()
+
+ This returns a count of all currently-connected players. When
+ mortals use this function, DARK privileged players are NOT counted.
+
+See also: lwho(), nmwho(), xwho()
+
& OBJ()
obj(<object>)
inputs is equivalent to true(1). See BOOLEAN VALUES.
See also: and(), or(), not(), nor()
+& XWHO()
+ xwho(<start>, <count>)
+ xmwho(<start>, <count>)
+ xwhoid(<start>, <count>)
+ xmwhoid(<start>, <count>)
+
+ xwho() fetches <count> or fewer player dbrefs from the list of connected
+ players. It is useful when the number of players connected causes lwho()
+ or pemits in +who $-commands to exceed buffer limits.
+
+ It is equivalent to extract(lwho(),<start>,<count>).
+
+ xmwho() is identical, except it is limited to non-DARK and non-HIDE
+ players.
+
+ xwhoid() and xmwhoid() return objids instead of dbrefs.
+
+See also: lwho(), mwho(), nwho()
+
& ZEMIT()
zemit(<zone>, <message>)
nszemit(<zone>, <message>)
/* LWHO() function - really belongs elsewhere but needs stuff declared here */
+FUNCTION(fun_nwho) {
+ DESC *d;
+ int count = 0;
+ int powered = (*(called_as + 1) != 'M') && Priv_Who(executor);
+
+ DESC_ITER_CONN(d) {
+ if (!Hidden(d) || (powered && CanSee(executor, d->player)))
+ count++;
+ }
+ safe_integer(count, buff, bp);
+}
+
/* ARGSUSED */
FUNCTION(fun_lwho)
{
DESC *d;
dbref victim;
- int first, powered = (*called_as == 'L') && Priv_Who(executor);
+ int first;
+ int start, count;
+ int powered = !(strchr(called_as, 'M') != NULL) && Priv_Who(executor);
+ int xwho = *called_as == 'X';
+ int objid = strchr(called_as, 'D') != NULL;
first = 1;
- if(nargs && args[0] && *args[0]) {
+ if(!xwho && nargs && args[0] && *args[0]) {
if(!powered) {
safe_str(T(e_perm), buff, bp);
return;
if(!Priv_Who(victim))
powered = 0;
} else victim = executor;
-
+
+ if(xwho) {
+ if (!is_strict_integer(args[0]) || !is_strict_integer(args[1])) {
+ safe_str(T(e_int), buff, bp);
+ return;
+ }
+
+ start = parse_integer(args[0]) - 1;
+ count = parse_integer(args[1]);
+ /* Reset values to be in range if they're not */
+ if(start < 0)
+ start = 0;
+ if(count < 1)
+ count = 1;
+ }
+
DESC_ITER_CONN(d) {
if (!Hidden(d) || (powered && CanSee(victim,d->player))) {
+ if(xwho && start) {
+ start--;
+ continue;
+ } else if(xwho && !count)
+ break;
+ else if(xwho && count)
+ count--;
+
if (first)
first = 0;
else
safe_chr(' ', buff, bp);
safe_dbref(d->player, buff, bp);
+ if(objid) {
+ safe_chr(':', buff, bp);
+ safe_integer(CreTime(d->player), buff, bp);
+ }
}
}
}
{"LVPLAYERS", fun_dbwalker, 1, 1, FN_REG},
{"LVTHINGS", fun_dbwalker, 1, 1, FN_REG},
{"LWHO", fun_lwho, 0, 1, FN_REG},
+ {"LWHOID", fun_lwho, 0, 1, FN_REG},
{"MAIL", fun_mail, 0, 2, FN_REG},
{"MAILFROM", fun_mailfrom, 1, 2, FN_REG},
{"MAILSTATS", fun_mailstats, 1, 1, FN_REG},
{"MUL", fun_mul, 2, INT_MAX, FN_REG},
{"MUNGE", fun_munge, 3, 5, FN_REG},
{"MWHO", fun_lwho, 0, 0, FN_REG},
+ {"MWHOID", fun_lwho, 0, 0, FN_REG},
{"NAME", fun_name, 0, 2, FN_REG},
{"NAMEGRAB", fun_namegrab, 2, 3, FN_REG},
{"NAMEGRABALL", fun_namegraball, 2, 3, FN_REG},
{"NSPEMIT", fun_pemit, 2, -2, FN_REG},
{"NSREMIT", fun_remit, 2, -2, FN_REG},
{"NSZEMIT", fun_zemit, 2, -2, FN_REG},
+ {"NWHO", fun_nwho, 0, 0, FN_REG},
+ {"NMWHO", fun_nwho, 0, 0, FN_REG},
{"NUM", fun_num, 1, 1, FN_REG},
{"NULL", fun_null, 1, INT_MAX, FN_REG},
{"OBJ", fun_obj, 1, 1, FN_REG},
{"XVEXITS", fun_dbwalker, 3, 3, FN_REG},
{"XVPLAYERS", fun_dbwalker, 3, 3, FN_REG},
{"XVTHINGS", fun_dbwalker, 3, 3, FN_REG},
+ {"XWHO", fun_lwho, 2, 2, FN_REG},
+ {"XWHOID", fun_lwho, 2, 2, FN_REG},
+ {"XMWHO", fun_lwho, 2, 2, FN_REG},
+ {"XMWHOID", fun_lwho, 2, 2, FN_REG},
{"ZEMIT", fun_zemit, 2, -2, FN_REG},
{"ZFUN", fun_zfun, 1, 11, FN_REG},
{"ZONE", fun_zone, 1, 2, FN_REG},