{
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)))) {
+ if (!Priv_Who(executor)) {
safe_str(T(e_perm), buff, bp);
return;
}
- DESC_ITER_CONN(d) {
+ 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))
+ 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(e_perm), 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