reaper feature #100

Parent #74Owner #2Flags readSource QuestCore.db

Aliases: reaper feature

10 verbs · 27 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
init_for_corethis none thisrxd#1007
@gathernone none nonerxd#10012
@save @unsaveany none nonerxd#10010
@doomednone none nonerxd#10010
@protectednone none nonerxd#1007
do_reapthis none thisrxd#10040
@harvestnone any anyrxd#10023
@update-reg*istrationnone none nonerxd#10048
@retire*-fullyany at/to anyrxd#10025
@moosize @moo-sizenone none nonerxd#1002

Properties

PropertyDefinerFlagsOwnerValue
reapables#100r#2{}
holdables#100r#2{#2, #36, #71, #38}
grim_reaper#100rc#2#36
weeks_til_reap#100rc#25
warehouse#74r#36<clear>
help_msg#74rc#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#74r#36{"@gather", "@harvest", "@save", "@doomed", "@protected", "@update-reg", "@retire", "@moosize"}
feature_ok#74r#36<clear>
drop_failed_msg#5rc#2<clear>
drop_succeeded_msg#5rc#2<clear>
odrop_failed_msg#5rc#2<clear>
odrop_succeeded_msg#5rc#2<clear>
otake_succeeded_msg#5rc#2<clear>
otake_failed_msg#5rc#2<clear>
take_succeeded_msg#5rc#2<clear>
take_failed_msg#5rc#2<clear>
value_base#102r#2<clear>
damage_base#102r#2<clear>
x_loc#102r#36<clear>
y_loc#102r#36<clear>
ansi_title#102r#36<clear>
obvious#102r#36<clear>
build_help#102rc#2<clear>
key#1c#20
aliases#1rc#2{"reaper feature"}
description#1rc#2"Verbs to help with the clean removal of player objects."
object_size#1r#36{11025, 1539462952}

Ancestry

Ancestors (nearest first): #74 Generic Feature Object#5 generic thing#102 subthing#1 Root Class

Children: none

Call graph

calls n100_0 #100:init_for_core n74_8 #74:init_for_core n100_0->n74_8 n100_1 #100:@gather n52_25 #52:descendants_suspended n100_1->n52_25 n52_5 #52:isa n100_1->n52_5 n6_18 #6:tell n100_1->n6_18 n100_2 #100:@save n100_2->n6_18 n20_20 #20:match_player n100_2->n20_20 n20_59 #20:name_and_number n100_2->n20_59 n100_3 #100:@doomed n100_3->n6_18 n100_3->n20_59 n6_79 #6:tell_lines n100_3->n6_79 n20_4 #20:columnize n100_3->n20_4 n100_4 #100:@protected n100_4->n6_18 n100_4->n20_59 n100_4->n6_79 n100_4->n20_4 n100_5 #100:do_reap n100_5->n6_18 n100_5->n20_59 n20_38 #20:explode n100_5->n20_38 n24_3 #24:set_property_owner n100_5->n24_3 n6_10 #6:notify n100_5->n6_10 n24_2 #24:set_owner n100_5->n24_2 n56_4 #56:yes_or_no n100_5->n56_4 n24_4 #24:unset_player n100_5->n24_4 n21_2 #21:recreate n100_5->n21_2 n63_1 #63:_recycle n100_5->n63_1 n100_6 #100:@harvest n100_6->n6_18 n100_6->n20_59 n100_6->n100_5 n100_6->n56_4 n46_2 #46:send_message n100_6->n46_2 n100_7 #100:@update-reg*istration n100_7->n6_18 n100_7->n20_59 n100_7->n56_4 n20_9 #20:trim n100_7->n20_9 n37_2 #37:find_all n100_7->n37_2 n37_8 #37:delete2 n100_7->n37_8 n37_0 #37:find n100_7->n37_0 n37_7 #37:delete n100_7->n37_7 n16_1 #16:add n100_7->n16_1 n16_6 #16:prune n100_7->n16_6 n100_8 #100:@retire*-fully n100_8->n52_5 n100_8->n6_18 n100_8->n20_20 n100_8->n100_5 n100_8->n56_4 n100_9 #100:@moosize n100_9->n6_18

Source

init_for_core

Spec this none thisFlags rxdOwner #2Definer #100

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

Spec none none noneFlags rxdOwner #2Definer #100

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

Spec any none noneFlags rxdOwner #2Definer #100

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

Spec none none noneFlags rxdOwner #2Definer #100

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

Spec none none noneFlags rxdOwner #2Definer #100

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

Spec this none thisFlags rxdOwner #2Definer #100

Referenced by

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..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

Spec none any anyFlags rxdOwner #2Definer #100

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

Spec none none noneFlags rxdOwner #2Definer #100

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

Spec any at/to anyFlags rxdOwner #2Definer #100

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

Spec none none noneFlags rxdOwner #2Definer #100

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.");