reaper feature #100
Aliases: reaper feature
10 verbs · 28 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
init_for_core | this none this | rxd | #100 | 7 |
@gather | none none none | rxd | #100 | 12 |
@save @unsave | any none none | rxd | #100 | 10 |
@doomed | none none none | rxd | #100 | 10 |
@protected | none none none | rxd | #100 | 7 |
do_reap | this none this | rxd | #100 | 40 |
@harvest | none any any | rxd | #100 | 23 |
@update-reg*istration | none none none | rxd | #100 | 48 |
@retire*-fully | any at/to any | rxd | #100 | 25 |
@moosize @moo-size | none none none | rxd | #100 | 2 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
reapables | #100 | r | #2 | {} |
holdables | #100 | r | #2 | {#2, #36, #71, #38} |
grim_reaper | #100 | rc | #2 | #36 |
weeks_til_reap | #100 | rc | #2 | 5 |
warehouse | #74 | r | #36 | <clear> |
help_msg | #74 | rc | #2 | list of 11{"@doomed => reap list", "@protected => hold list", "@gather => creates the reap list.", "@save/@unsave <person> to hold/release candidates for reaping.", "@harvest [to <non-wiz player>] => initiates general reaping.", "@update-reg*istration cleans $registration_db", "@retire*-fully <wizard1 to wizard2> or <nonwiz1 to nonwiz2>", "", "@set the prop reaper.weeks_til_reap to determine the grace period.", "@set the prop reaper.grim_reaper to determine who gets all verbs, props, objects.", "@set the prop $sysobj.reaper to determine the individual wizard who gets to use this feature."} |
feature_verbs | #74 | r | #36 | {"@gather", "@harvest", "@save", "@doomed", "@protected", "@update-reg", "@retire", "@moosize"} |
feature_ok | #74 | r | #36 | <clear> |
drop_failed_msg | #5 | rc | #2 | <clear> |
drop_succeeded_msg | #5 | rc | #2 | <clear> |
odrop_failed_msg | #5 | rc | #2 | <clear> |
odrop_succeeded_msg | #5 | rc | #2 | <clear> |
otake_succeeded_msg | #5 | rc | #2 | <clear> |
otake_failed_msg | #5 | rc | #2 | <clear> |
take_succeeded_msg | #5 | rc | #2 | <clear> |
take_failed_msg | #5 | rc | #2 | <clear> |
value_base | #102 | r | #2 | <clear> |
damage_base | #102 | r | #2 | <clear> |
x_loc | #102 | r | #36 | <clear> |
y_loc | #102 | r | #36 | <clear> |
ansi_title | #102 | r | #36 | <clear> |
obvious | #102 | r | #36 | <clear> |
build_help | #102 | rc | #2 | <clear> |
key | #1 | c | #2 | 0 |
aliases | #1 | rc | #2 | {"reaper feature"} |
description | #1 | rc | #2 | "Verbs to help with the clean removal of player objects." |
object_size | #1 | r | #36 | {12601, -1090650497} |
html | #1 | rc | #2 | <clear> |
Ancestry
Ancestors (nearest first): #74 Generic Feature Object → #5 generic thing → #102 subthing → #1 Root Class
Children: none
Call graph
Source
init_for_core
Referenced by
none
Source
1if (caller_perms().wizard) 2this.reapables = {}; 3this.holdables = {#2, $hacker, $housekeeper, $no_one}; 4this.grim_reaper = $hacker; 5this.weeks_til_reap = 5; 6pass(@args); 7endif
@gather
Referenced by
none
Source
1"Adds oldies to the .reapables list"; 2this.reapables = {}; 3for p in ($object_utils:descendants_suspended($player)) 4(ticks_left() < 6000) && suspend(0); 5this.holdables = (p in $core_objects()) ? setadd(this.holdables, p) | this.holdables; 6if (((is_player(p) && ((time() - p.last_disconnect_time) > (this.weeks_til_reap * 604800))) && (!(p in this.holdables))) && (!p.wizard)) 7this.reapables = setadd(this.reapables, p); 8elseif ((((!is_player(p)) && (!(p in this.holdables))) && (!children(p))) && (!$object_utils:isa(p, $puppet))) 9this.reapables = setadd(this.reapables, p); 10endif 11endfor 12player:tell(length(this.reapables), " are reapable.");
@save @unsave
Referenced by
none
Source
1"Adds or removes to/from the .holdables list"; 2if (!(player.wizard && (player == $reaper))) 3return player:tell("Only the $reaper can do that!"); 4endif 5dobj = valid(dobj) ? dobj | $string_utils:match_player(dobjstr); 6if (valid(dobj) && is_player(dobj)) 7this.holdables = (verb == "@save") ? setadd(this.holdables, dobj) | setremove(this.holdables, dobj); 8return player:tell($string_utils:nn(dobj), " is ", verb, "d! Hallelujah!"); 9endif 10player:tell("Not a valid player.");
@doomed
Referenced by
none
Source
1"Lists players up for reaping."; 2loafers = {}; 3for p in (this.reapables) 4loafers = {@loafers, $string_utils:nn(p)}; 5if (length(p.owned_objects) > 1) 6player:tell(".........Inspect ", $string_utils:nn(p), " for owned objects."); 7endif 8endfor 9player:tell("Doomed:"); 10player:tell_lines($string_utils:columnize(loafers, 2));
@protected
Referenced by
none
Source
1"Lists players protected from reaping."; 2saved = {}; 3for p in (this.holdables) 4saved = {@saved, $string_utils:nn(p)}; 5endfor 6player:tell("Protected:"); 7player:tell_lines($string_utils:columnize(saved, 2));
do_reap
Referenced by
- #100:@harvest line 19:
this:do_reap - #100:@retire*-fully line 20:
this:do_reap - #100:@retire*-fully line 22:
this:do_reap
Source
1"USAGE: do_reap(doomed player, beneficiary, full monty) => if (full monty)==1, the doomed loses all objects to the beneficiary and can be recycled, otherwise just props and verbs."; 2if (!(((caller == this) && caller_perms().wizard) && (player == $reaper))) 3return E_PERM; 4endif 5who = args[1]; 6towho = args[2]; 7player:tell("Searching for verbs and props owned by ", $string_utils:nn(who), "..."); 8for x in [0..call_function("tonum", max_object())] 9if (valid(o = toobj(x))) 10for y in (verbs(o)) 11v = strsub($string_utils:explode(y, " ")[1], "*", ""); 12i = verb_info(o, v); 13if (i[1] == who) 14player:tell(v); 15$set_verb_info(o, v, listset(i, towho, 1)); 16endif 17((ticks_left() < 4000) || (seconds_left() < 4)) && suspend(0); 18endfor 19for p in (properties(o)) 20i = property_info(o, p); 21if (i[1] == who) 22player:tell(p); 23$wiz_utils:set_property_owner(o, p, towho, 1); 24endif 25((ticks_left() < 4000) || (seconds_left() < 4)) && suspend(0); 26endfor 27if (((args[3] == 1) && (o.owner == who)) && (o in who.owned_objects)) 28player:notify(tostr($wiz_utils:set_owner(o, towho) && "Object ownership changed.")); 29endif 30endif 31((ticks_left() < 4000) || (seconds_left() < 4)) && suspend(0); 32endfor 33player:tell("Finished transfering verbs and props owned by ", $string_utils:nn(who), " to ", $string_utils:nn(towho), "."); 34if ((args[3] == 1) && $command_utils:yes_or_no("You've completely stripped this player of ownership. Do you want to recycle him/her now?")) 35set_player_flag(who, 1) && "this is just to prevent an error from the next verb call"; 36$wiz_utils:unset_player(who); 37$building_utils:recreate(who, $thing); 38$recycler:_recycle(who); 39player:tell("Done."); 40endif
@harvest
Referenced by
none
Source
1"Runs through the entire db searching for verbs, properties, and objects owned by each 'who' in reapables, removing ownership before recycling the 'who'."; 2if (!iobjstr) 3iobj = this.grim_reaper; 4endif 5if (!(player.wizard && (player == $reaper))) 6return player:tell("Only the $reaper can do that!"); 7elseif (!valid(iobj)) 8return player:tell("You must choose a valid, non-wizard recipient, specified by the player's object #."); 9elseif (!is_player(iobj)) 10return player:tell("The recipient must be a player."); 11elseif (iobj.wizard) 12return player:tell("The recipient cannot be a wizard."); 13elseif (!$command_utils:yes_or_no("Did you realize that you should only do this if you are willing to erase players?")) 14return player:tell("Okay...aborted."); 15endif 16reaped = ""; 17for who in (this.reapables) 18reaped = (reaped + $string_utils:nn(who)) + ", "; 19this:do_reap(who, iobj, 1); 20endfor 21$mail_agent:send_message(player, $toad_log, "Weed'em and Reap", {reaped ? reaped[1..$ - 2] | "No one."}); 22player:tell("@update-reg if you wish to clean up the address database."); 23this.reapables = {};
@update-reg*istration
Referenced by
none
Source
1"Cleans $failed_match data from $registration_db. Adds any unregistered email addresses from players."; 2for p in ({@properties($registration_db), " "}) 3player:tell("...cleaning ", p); 4q = (p != " ") ? $string_utils:trim(p) | p; 5all = $registration_db:find_all(q); 6if ((($failed_match in all) || ({$failed_match} in all)) || ({{$failed_match}} in all)) 7player:tell("Found bad data."); 8alist = $registration_db:find_all_keys(q); 9for a in (alist) 10(ticks_left() < 4000) && suspend(0); 11$registration_db:delete2(a, $failed_match); 12(ticks_left() < 4000) && suspend(0); 13$registration_db:delete2(a, {$failed_match}); 14(ticks_left() < 4000) && suspend(0); 15$registration_db:delete2(a, {{$failed_match}}); 16endfor 17else 18alist = $registration_db:find_all_keys(q); 19for a in (alist) 20bad = 0; 21for b in ($registration_db:find(a)) 22(ticks_left() < 4000) && suspend(0); 23if ($failed_match in b) 24bad = 1; 25endif 26endfor 27if (bad) 28player:tell("Found bad data."); 29$registration_db:delete(a); 30endif 31(ticks_left() < 4000) && suspend(0); 32endfor 33endif 34(ticks_left() < 4000) && suspend(0); 35endfor 36for x in (players()) 37if (x.email_address) 38if ($registration_db:find(x.email_address) == $failed_match) 39player:tell("...adding ", $string_utils:nn(x)); 40$registration_db:add(x, x.email_address); 41endif 42endif 43(ticks_left() < 4000) && suspend(0); 44endfor 45if ($command_utils:yes_or_no("Do you want to remove old email address references from the database?")) 46$registration_db:prune(); 47endif 48player:tell("Done");
@retire*-fully
Referenced by
none
Source
1"USAGE: @retire <player #> to <player #>"; 2"Runs through the entire db searching for verbs or properties owned by dobj."; 3"Transfers them to iobj. If @retire-fully is used, the objects transfer, too."; 4dobj = valid(dobj) ? dobj | $string_utils:match_player(dobjstr); 5iobj = valid(iobj) ? iobj | $string_utils:match_player(iobjstr); 6if (!(player.wizard && (player == $reaper))) 7return player:tell("Only the $reaper can do that!"); 8elseif ((!valid(dobj)) || (!valid(iobj))) 9return player:tell("Invalid object specification."); 10elseif (!(($object_utils:isa(dobj, $player) && (!dobj.f)) && is_player(iobj))) 11return player:tell("Both objects must be players and not generic player classes."); 12elseif (dobj.wizard != iobj.wizard) 13return player:tell("Both or neither players must be wizards."); 14elseif (dobj in this.holdables) 15return player:tell("That player cannot be retired."); 16elseif (!$command_utils:yes_or_no("Do you realize that you should only do this if you are getting rid of this player?")) 17return player:tell("Okay...aborted."); 18endif 19if (verb == "@retire-fully") 20this:do_reap(dobj, iobj, 1); 21else 22this:do_reap(dobj, iobj, 0); 23dobj.wizard = 0; 24player:tell("Remember to change the player's name and password."); 25endif
@moosize @moo-size
Referenced by
none
Source
1"USAGE: @moosize => Tells the size of the last saved db in megabytes."; 2player:tell("The MOO is ", floatstr(tofloat(db_disk_size()) / tofloat(1048576), 2), " Megabytes.");