return target;
}
-/* LWHO() function - really belongs elsewhere but needs stuff declared here */
/* ARGSUSED */
FUNCTION(fun_nwho)
DESC *d;
dbref victim;
int count = 0;
- int powered = (*(called_as + 1) != 'M') && Priv_Who(executor);
+ int powered = ((*(called_as + 1) != 'M') && Priv_Who(executor));
if (nargs && args[0] && *args[0]) {
/* An argument was given. Find the victim and choose the lowest
safe_str(T(e_notvis), buff, bp);
return;
}
- if (!Priv_Who(victim))
- powered = 0;
+
+ if (!Priv_Who(executor)
+ && !(Inherit_Powers(executor) && Priv_Who(Owner(executor))))
+ powered = 0;
}
DESC_ITER_CONN(d) {
dbref victim;
int first;
int start = 0, count = 0;
- int powered = !(strchr(called_as, 'M') != NULL) && Priv_Who(executor);
int xwho = *called_as == 'X';
int objid = (strchr(called_as, 'D') != NULL);
+ int powered = 0;
+ if (!(strchr(called_as, 'M') != NULL) && !Priv_Who(executor)
+ && !(Inherit_Powers(executor) && Priv_Who(Owner(executor))))
+ powered = 1;
+
first = 1;
if (!xwho && nargs && args[0] && *args[0]) {
if (!powered) {
safe_str(T(e_perm), buff, bp);
return;
}
- if (!Priv_Who(victim))
+ if (!Priv_Who(executor)
+ && !(Inherit_Powers(executor) && Priv_Who(Owner(executor))))
powered = 0;
} else
victim = executor;
{
DESC *d;
int first = 1;
+ dbref victim;
+ int powered = 1;
+ int online = 1;
+ int offline = 0;
if (!Priv_Who(executor)
&& !(Inherit_Powers(executor) && Priv_Who(Owner(executor)))) {
return;
}
- DESC_ITER_CONN(d) {
- if (first)
- first = 0;
- else
- safe_chr(' ', buff, bp);
- safe_integer(d->descriptor, buff, bp);
+ if (nargs && args[0] && *args[0]) {
+ /* An argument was given. Find the victim and adjust perms */
+ if ((victim = noisy_match_result(executor, args[0], NOTYPE,
+ MAT_EVERYTHING)) == NOTHING) {
+ safe_str(T(e_notvis), buff, bp);
+ return;
+ }
+ if (!Priv_Who(executor)
+ && !(Inherit_Powers(executor) && Priv_Who(Owner(executor))))
+ powered = 0;
}
+
+ if (nargs > 1 && args[1] && *args[1]) {
+ if (string_prefix("all", args[1])) {
+ offline = online = 1;
+ } else if (strlen(args[1]) < 2) {
+ safe_str(T("#-1 INVALID SECOND ARGUMENT"), buff, bp);
+ return;
+ } else if (string_prefix("online", args[1])) {
+ online = 1;
+ offline = 0;
+ } else if (string_prefix("offline", args[1])) {
+ online = 0;
+ offline = 1;
+ } else {
+ safe_str(T("#-1 INVALID SECOND ARGUMENT"), buff, bp);
+ return;
+ }
+ if (offline && !powered) {
+ safe_str(T("#-1 PERMISSION DENIED"), buff, bp);
+ return;
+ }
+ }
+
+ DESC_ITER(d) {
+ if ((d->connected && !online) || (!d->connected && !offline))
+ continue;
+ if (!powered && (d->connected && Hidden(d)))
+ continue;
+ if (first)
+ first = 0;
+ else
+ safe_chr(' ', buff, bp);
+ safe_integer(d->descriptor, buff, bp);
+ }
}
/* ARGSUSED */
{"LOCKS", fun_locks, 1, 1, FN_REG},
{"LPARENT", fun_lparent, 1, 1, FN_REG},
{"LPLAYERS", fun_dbwalker, 1, 1, FN_REG},
- {"LPORTS", fun_lports, 0, 1, FN_REG},
+ {"LPORTS", fun_lports, 0, 2, FN_REG},
{"LPOS", fun_lpos, 2, 2, FN_REG},
{"LTHINGS", fun_dbwalker, 1, 1, FN_REG},
{"LSEARCH", fun_lsearch, 1, INT_MAX, FN_REG},
{"LVEXITS", fun_dbwalker, 1, 1, FN_REG},
{"LVPLAYERS", fun_dbwalker, 1, 1, FN_REG},
{"LVTHINGS", fun_dbwalker, 1, 1, FN_REG},
- {"LWHO", fun_lwho, 0, 1, FN_REG},
+ {"LWHO", fun_lwho, 0, 2, FN_REG},
{"LWHOID", fun_lwho, 0, 1, FN_REG},
#ifdef USE_MAILER
{"MAIL", fun_mail, 0, 2, FN_REG},