Revert "tilde_utils: Add set_programmer"

This reverts commit 9ff42a234f3f70b0ef888a3854f3f5795df9cc30.
This commit is contained in:
rbiv 2025-09-06 12:49:34 +00:00
parent 9ff42a234f
commit 0c9b3c0152

View File

@ -2,7 +2,7 @@
@property #0.tilde_utils #170 @property #0.tilde_utils #170
@describe $tilde_utils as "This is the Tilde Utilities utility package. See `help $tilde_utils' for more details." @describe $tilde_utils as "This is the Tilde Utilities utility package. See `help $tilde_utils' for more details."
@set $tilde_utils.help_msg to {"Mirrored functions:", " curl (STR <url> [, INT <include_headers>, INT timeout]) -- See `help curl()`", " exec (LIST command[, STR input][, LIST environment variables]) -- See `help eval()`", "", "$wiz_utils:", "", ":set_programmer(object) object.programmer = 1;"," chparent object to $prog", " send mail to $prog_log"} @set $tilde_utils.help_msg to {"Mirrored functions:", " curl (STR <url> [, INT <include_headers>, INT timeout]) -- See `help curl()`", " exec (LIST command[, STR input][, LIST environment variables]) -- See `help eval()`"}
@verb $tilde_utils:exec tnt @verb $tilde_utils:exec tnt
@program $tilde_utils:exec @program $tilde_utils:exec
@ -27,38 +27,3 @@ else
return curl (url); return curl (url);
endif endif
. .
@verb $tilde_utils:set_programmer tnt
@program $tilde_utils:set_programmer
"This code is taken from $wiz_utils:set_programmer, but has the wiz check removed, and a guest check added.";
":set_programmer(victim[,mail from]) => 1 or error.";
"Sets victim.programmer, chparents victim to $prog if necessary, and sends mail to $new_prog_log, mail is from optional second arg or caller_perms().";
whodunnit = caller_perms();
{victim, ?mailfrom = whodunnit} = args;
if (!(valid(victim) && (is_player(victim) && $object_utils:isa(victim, $player))))
return E_INVARG;
elseif ($object_utils:isa(victim, $guest))
return E_INVARG;
elseif (victim.programmer)
return E_NONE;
elseif ($wiz_utils:check_prog_restricted(victim))
return E_INVARG;
elseif (typeof(e = `victim.programmer = 1 ! ANY') == ERR)
return e;
else
$quota_utils:adjust_quota_for_programmer(victim);
if (!$object_utils:isa(victim, $prog))
if (typeof(e = `chparent(victim, $prog) ! ANY') == ERR)
"...this isn't really supposed to happen but it could...";
player:notify(tostr("chparent(", victim, ",", $prog, ") failed: ", e));
player:notify("Check for common properties.");
endif
else
player:notify(tostr(victim.name, " was already a child of ", parent(victim).name, " (", parent(victim), ")"));
endif
if (!$mail_agent:send_message(mailfrom, {$new_prog_log, victim}, tostr("@programmer ", victim.name, " (", victim, ")"), tostr("I just gave ", victim.name, " a programmer bit."))[1])
$mail_agent:send_message(mailfrom, {$new_prog_log}, tostr("@programmer ", victim.name, " (", victim, ")"), tostr("I just gave ", victim.name, " a programmer bit."));
endif
return 1;
endif
.