Recycling Center #57

Parent #5Owner #29Flags readSource hellcore/hellcore.db

Aliases: Recycling Center, Center

31 verbs · 48 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
_recreatethis none thisrxd#5735
_recyclethis none thisrxd#5743
_createthis none thisrxd#5724
addhistthis none thisrxd#577
show*-historythis none nonerxd#579
requestany out of/from inside/from thisrxd#5728
setup_toadthis none thisrxd#5716
add_orphanthis none thisrxd#573
remove_orphanthis none thisrxd#573
validthis none thisrxd#574
init_for_corethis none thisrxd#576
resurrectthis none thisrxd#5716
reclaim_lost_soulsthis none thisrxd#5716
look_selfthis none thisrxd#5713
gcthis none thisrxd#5725
movetothis none thisrxd#571
kill_all_tasksthis none thisrxd#5715
occupantsthis none thisrxd#570
_recreate_oldthis none thisrxd#5716
server_startedthis none thisrxd#5711
update_countthis none thisrxd#5711
watchthis none nonerxd#579
watch_tellthis none thisrxd#5754
do_player_watchthis none thisrxd#5740
_wwwthis none thisrxd#574
_handle_bad_garbagethis none thisrxd#5732
setup_new_object_asthis none thisrxd#5714
fossilizethis none thisrxd#5714
defossilizethis none thisrxd#5735
flush_to_fossilsthis none thisrxd#5729
enterfuncthis none thisrxd#579

Properties

PropertyDefinerFlagsOwnerValue
orphans#57r#29{}
announce_removal_msg#57rc#29""
nhist#57#2950
history#57#29{}
lost_souls#57rc#29{}
rcount_current#57rc#29369
rcount_history#57rc#29
list of 30{5, 2, 7, 30, 1, 5, 6, 1, 35, 6, 5, 4, 12, 48, 3, 9, 11, 4, 50, 4, 6, 7, 3, 58, 5, 12, 9, 46, 12, 5}
rcount_length#57rc#2930
count_period_secs#57rc#2930
keep_stats#57rc#291
rhistory#57rc#29{}
max_rhistory#57rc#291000
watchers#57rc#29{}
furnace#57rc#29#188453
stat_spawn#57rc#295328364
stat_recycle#57rc#29369
use_backup#57rc#290
update_task#57rc#29350382959
handed#5rc#29<clear>
wield_msg#5rc#29<clear>
unwield_msg#5rc#29<clear>
size#5rc#29<clear>
look_place_msg#5rc#29<clear>
value#5rc#29<clear>
get_msg#5rc#29<clear>
drop_msg#5rc#29<clear>
get_fail_msg#5rc#29<clear>
junk_ok#5rc#29<clear>
floats#5rc#29<clear>
long_name_msg#5rc#29<clear>
article#5rc#29<clear>
setup_list#5rc#29<clear>
health#5rc#29<clear>
health_max#5rc#29<clear>
min_skill#5rc#29<clear>
skill#5rc#29<clear>
recipe_for#5rc#29<clear>
carried_msg#5rc#29<clear>
aliases#1rc#29{"Recycling Center", "Center"}
description#1rc#29"Object reuse. Call $recycler:_create() to create an object (semantics the same as create()), $recycler:_recycle() to recycle an object. Will create a new object if nothing available in its contents. Note underscores, to avoid builtin :recycle() verb called when objects are recycled. Uses $building_utils:recreate() to prepare objects."
object_size#1r#29{160727, 1298433815}
hidden_verbs#1rc#29<clear>
phelp_msg#1rc#29<clear>
weight#1rc#29<clear>
owner_verbs#1rc#29<clear>
plural_name#1rc#29<clear>
client_image#1rc#29<clear>
listening#1rc#29<clear>

Ancestry

Ancestors (nearest first): #5 generic thing#1 root

Children: none

Call graph

calls n57_0 #57:_recreate n57_6 #57:setup_toad n57_0->n57_6 n57_25 #57:_handle_bad_garbage n57_0->n57_25 n103_24 #103:report_error n57_0->n103_24 n57_7 #57:add_orphan n57_6->n57_7 n21_2 #21:recreate n57_6->n21_2 n57_8 #57:remove_orphan n57_6->n57_8 n17_2 #17:set_owner n57_6->n17_2 n57_1 #57:_recycle n57_25->n57_1 n20_59 #20:name_and_number n57_25->n20_59 n20_5 #20:from_list n57_25->n20_5 n42_0 #42:controls n57_1->n42_0 n57_1->n57_7 n57_22 #57:watch_tell n57_1->n57_22 n57_1->n21_2 n57_1->n57_8 n57_1->n17_2 n57_22->n103_24 n20_1 #20:left n57_22->n20_1 n51_63 #51:format_caller n57_22->n51_63 n20_2 #20:right n57_22->n20_2 n20_0 #20:space n57_22->n20_0 n57_2 #57:_create n57_2->n57_0 n57_2->n103_24 n57_2->n57_22 n73_3 #73:bi_create n57_2->n73_3 n57_26 #57:setup_new_object_as n57_2->n57_26 n57_26->n103_24 n57_4 #57:show*-history n57_4->n42_0 n6_9 #6:notify n57_4->n6_9 n107_43 #107:tell n57_4->n107_43 n57_5 #57:request n57_5->n57_6 n57_5->n107_43 n20_19 #20:match_object n57_5->n20_19 n45_5 #45:isa n57_5->n45_5 n45_3 #45:has_callable_verb n57_5->n45_3 n20_34 #20:pronoun_sub n57_5->n20_34 n57_10 #57:init_for_core n1_22 #1:init_for_core n57_10->n1_22 n57_11 #57:resurrect n57_11->n57_1 n57_11->n17_2 n57_11->n73_3 n57_12 #57:reclaim_lost_souls n48_8 #48:suspend_if_needed n57_12->n48_8 n57_13 #57:look_self n47_15 #47:sort_suspended n57_13->n47_15 n1_11 #1:tell_lines n57_13->n1_11 n20_60 #20:columnize_suspended n57_13->n20_60 n1_9 #1:look_self n57_13->n1_9 n57_14 #57:gc n57_14->n57_1 n57_14->n20_59 n57_15 #57:moveto n1_13 #1:moveto n57_15->n1_13 n57_18 #57:_recreate_old n57_18->n57_6 n57_19 #57:server_started n57_20 #57:update_count n57_19->n57_20 n57_21 #57:watch n57_21->n107_43 n57_23 #57:do_player_watch n57_21->n57_23 n57_23->n20_1 n57_29 #57:flush_to_fossils n57_29->n107_43 n57_30 #57:enterfunc n57_30->n103_24

Source

_recreate

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

Source

1"Return a toad (child of #1, owned by $hacker) from this.contents.  Move it to #-1.  Recreate as a mchild of args[1], or of #1 if no args are given.  Chown to caller_perms() or args[2] if present.";
2cp = caller_perms();
3{?what = #1, ?who = cp} = args;
4if (!(cp.wizard || (who == cp)))
5raise(E_PERM);
6elseif (!(valid(what) && is_player(who)))
7raise(E_INVARG);
8elseif ((((who != what.owner) && (!what.f)) && (!who.wizard)) && (!cp.wizard))
9raise(E_PERM);
10endif
11first = first_in(this);
12if (!valid(first))
13return E_NONE;
14endif
15allc = {first};
16tried_allcontents = 0;
17while (allc)
18potential = allc[1];
19if (((potential.owner == #29) && (parent(potential) == $garbage)) && (!children(potential)))
20return this:setup_toad(potential, who, what);
21else
22try
23this:_handle_bad_garbage(potential);
24except e (ANY)
25$rpg:report_error(e, {}, $nets.bugnet);
26endtry
27endif
28yield;
29allc = allc[2..$];
30if ((!allc) && (!tried_allcontents))
31allc = this.contents[2..$];
32tried_allcontents = 1;
33endif
34endwhile
35return E_NONE;

_recycle

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

Source

1"Take the object in args[1], and turn it into a child of #1 owned by $hacker.";
2"If the object is a player, decline.";
3item = args[1];
4from_tomb = item.location == $tomb;
5if (!$perm_utils:controls(caller_perms(), item))
6raise(E_PERM);
7elseif (is_player(item))
8raise(E_INVARG);
9endif
10if (is_connected(item))
11boot_player(item);
12endif
13if (item.f)
14return E_INVARG;
15endif
16"this:addhist(caller_perms(), item);";
17lastcall = callers(1)[1];
18if ((lastcall[4] == $rpg) && (lastcall[2] == "junk"))
19lastcall = callers(1)[2];
20endif
21this:add_orphan(item);
22if (this.watchers)
23this:watch_tell("-", item.name, parent(item), item.location);
24endif
25"store data for tracking";
26recycle_state = {item, item.location, lastcall, item.name, player};
27"recreate as garbage";
28$building_utils:recreate(item, $garbage);
29if (!from_tomb)
30"this:kill_all_tasks(item)";
31endif
32this.rcount_current = this.rcount_current + 1;
33this:remove_orphan(item);
34"...";
35$wiz_utils:set_owner(item, #29);
36item.name = tostr("Recyclable ", item);
37item.previous_state = recycle_state;
38if (this.use_backup)
39`move(item, $backup_recycler) ! ANY => 0';
40else
41`move(item, this) ! ANY => 0';
42endif
43this.stat_recycle = this.stat_recycle + 1;

_create

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

Source

1if (!valid(args[1]))
2raise(E_INVARG, "invalid parent to create a child");
3endif
4try
5set_task_perms(caller_perms());
6except e (ANY)
7$rpg:report_error(e);
8return e[1];
9endtry
10new = this:_recreate(@args);
11if (typeof(new) != OBJ)
12new = $quota_utils:bi_create(@args);
13if ((typeof(new) != OBJ) || (!is_a(new, #1)))
14raise(E_QUOTA, tostr("Got ", new, " from $quota_utils:bi_create!"));
15endif
16parent = args[1];
17this:setup_new_object_as(new, parent);
18endif
19if (this.watchers)
20p = parent(new);
21this:watch_tell("+", p.name, new);
22endif
23move(new, $womb);
24return new;

addhist

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

none

Source

1if (caller == this)
2h = this.history;
3if ((len = length(h)) > this.nhist)
4h = h[len - this.nhist..len];
5endif
6this.history = {@h, args};
7endif

show*-history

Spec this none noneFlags rxdOwner #361Definer #57

Referenced by

none

Source

1if ($perm_utils:controls(valid(caller_perms()) ? caller_perms() | player, this))
2for x in (this.history)
3pname = valid(x[1]) ? x[1].name | "A recycled player";
4oname = valid(x[2]) ? x[2].name | "recycled";
5player:notify(tostr(pname, " (", x[1], ") recycled ", x[2], " (now ", oname, ")"));
6endfor
7else
8player:tell("Sorry.");
9endif

request

Spec any out of/from inside/from thisFlags rxdOwner #361Definer #57

Referenced by

none

Source

1"added check that obj is already $garbage - Bits 12/16/5";
2if (!(caller_perms() in {player, #-1}))
3raise(E_PERM);
4endif
5dobj = valid(dobj) ? dobj | $string_utils:match_object(dobjstr, player.location);
6if (!valid(dobj))
7dobj = (n = toint(dobjstr)) ? toobj(n) | #-1;
8endif
9if (!valid(dobj))
10player:tell("Couldn't parse ", dobjstr, " as a valid object number.");
11elseif (!(dobj in this.contents))
12player:tell("Couldn't find ", dobj, " in ", this.name, ".");
13elseif (!$object_utils:isa(dobj, $garbage))
14player:tell("Sorry, that isn't recyclable.");
15elseif ($object_utils:has_callable_verb(this, "request_refused") && (msg = this:request_refused(player, dobj)))
16player:tell("Sorry, can't do that:  ", msg);
17else
18if (typeof(emsg = this:setup_toad(dobj, player, $root_class)) != ERR)
19dobj:moveto(player);
20dobj.aliases = {dobj.name = "Object " + tostr(dobj)};
21player:tell("You now have ", dobj, " ready for @recreation.");
22if (this.announce_removal_msg)
23player.location:announce($string_utils:pronoun_sub(this.announce_removal_msg));
24endif
25else
26player:tell(emsg);
27endif
28endif

setup_toad

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

Source

1"this:setup_toad(objnum,new_owner,parent)";
2"Called by :_create and :request.";
3if (caller != this)
4return E_PERM;
5endif
6{potential, who, what} = args;
7$wiz_utils:set_owner(potential, who);
8move(potential, #-1);
9set_task_perms({@callers(), {#-1, "", player}}[2][3]);
10"... if :initialize crashes...";
11this:add_orphan(potential);
12$building_utils:recreate(potential, what);
13this:remove_orphan(potential);
14"... if we don't get this far, the object stays on the orphan list...";
15"... orphan list should be checked periodically...";
16return potential;

add_orphan

Spec this none thisFlags rxdOwner #29Definer #57

Referenced by

Source

1if (caller == this)
2this.orphans = setadd(this.orphans, args[1]);
3endif

remove_orphan

Spec this none thisFlags rxdOwner #29Definer #57

Referenced by

Source

1if (caller == this)
2this.orphans = setremove(this.orphans, args[1]);
3endif

valid

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

Source

1"Usage:  valid(object)";
2"True if object is a descendant of #1.";
3"You really ought to just use is_a(what, #1) yourself to avoid the verb call.";
4return is_a(args[1], #1);

init_for_core

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

none

Source

1if (caller_perms().wizard)
2this.orphans = {};
3this.history = {};
4this.lost_souls = {};
5pass();
6endif

resurrect

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

none

Source

1who = caller_perms();
2if (!valid(parent = {@args, $garbage}[1]))
3return E_INVARG;
4elseif (!who.wizard)
5return E_PERM;
6elseif (typeof(o = renumber($quota_utils:bi_create(parent, $hacker))) == ERR)
7"..death...";
8elseif (parent == $garbage)
9$recycler:_recycle(o);
10else
11o.aliases = {o.name = tostr("Resurrectee ", o)};
12$wiz_utils:set_owner(o, who);
13move(o, who);
14endif
15reset_max_object();
16return o;

reclaim_lost_souls

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

none

Source

1"this is just here for legacy purposes, go away";
2return;
3if (!caller_perms().wizard)
4raise(E_PERM);
5endif
6fork (1800)
7this:(verb)();
8endfork
9for x in (this.lost_souls)
10this.lost_souls = setremove(this.lost_souls, x);
11if ((valid(x) && (typeof(x.owner.owned_objects) == LIST)) && (!(x in x.owner.owned_objects)))
12x.owner.owned_objects = setadd(x.owner.owned_objects, x);
13$quota_utils:summarize_one_user(x.owner);
14endif
15$command_utils:suspend_if_needed(0);
16endfor

look_self

Spec this none thisFlags rxdOwner #29Definer #57

Referenced by

none

Source

1if (prepstr in {"in", "inside", "into"})
2recycler = this;
3linelen = ((linelen = abs(player.linelen)) < 20) ? 78 | linelen;
4intercolumn_gap = 2;
5c_width = length(tostr(max_object())) + intercolumn_gap;
6n_columns = (linelen + (c_width - 1)) / c_width;
7things = $list_utils:sort_suspended(0, this.contents);
8header = tostr(this.name, " (", this, ") contains:");
9player:tell_lines({header, @$string_utils:columnize_suspended(0, things, n_columns)});
10else
11return pass(@args);
12endif
13"This code contributed by Mickey.";

gc

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

Source

1new_orphans = {};
2for o in (this.orphans)
3if (valid(o))
4if (o == $garbage)
5continue;
6endif
7if (!(o.location in {#-1, this}))
8msg = tostr("Recycler orphan in weird location: ", $su:nn(o), " in ", $su:nn(o.location), ".");
9$nets.bugnet:announce(#-1, msg, 1);
10continue;
11endif
12new_orphans = {@new_orphans, o};
13endif
14yield;
15endfor
16this.orphans = new_orphans;
17for o in (this.orphans)
18move(o, #-1);
19this:_recycle(o);
20suspend(1);
21endfor
22return;
23if (this.orphans)
24$nets.bugnet:announce(#-1, "$recycler:gc -- still orphaned: " + $su:nn(this.orphans), 1);
25endif

moveto

Spec this none thisFlags rxdOwner #29Definer #57

Referenced by

none

Source

1pass(#-1);

kill_all_tasks

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

none

Source

1"kill_all_tasks ( object being recycled )";
2" -- kill all tasks involving this now-recycled object";
3((caller == this) || (caller == #0)) || raise(E_PERM);
4{object} = args;
5(typeof(object) == OBJ) || raise(E_INVARG);
6fork (0)
7for t in (queued_tasks())
8for c in (`task_stack(t[1]) ! E_INVARG => {}')
9if (object in c)
10kill_task(t[1]);
11continue t;
12endif
13endfor
14endfor
15endfork

occupants

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

none

Source

No program (verb defined but unprogrammed).

_recreate_old

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

none

Source

1"Copied from Recycling Center (#63):_recreate by Satan (#2) Fri Sep  7 14:49:44 2007 CDT";
2"Return a toad (child of #1, owned by $hacker) from this.contents.  Move it to #-1.  Recreate as a child of args[1], or of #1 if no args are given.  Chown to caller_perms() or args[2] if present.";
3{?what = #1, ?who = caller_perms()} = args;
4if (!(caller_perms().wizard || (who == caller_perms())))
5return E_PERM;
6elseif (!(valid(what) && is_player(who)))
7return E_INVARG;
8elseif ((((who != what.owner) && (!what.f)) && (!who.wizard)) && (!caller_perms().wizard))
9return E_PERM;
10endif
11for potential in (this.contents)
12if (((potential.owner == $hacker) && (parent(potential) == $garbage)) && (!children(potential)))
13return this:setup_toad(potential, who, what);
14endif
15endfor
16return E_NONE;

server_started

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

none

Source

1if (caller != #0)
2raise(E_PERM);
3endif
4if (this.keep_stats && (!task_valid(this.update_task)))
5fork ud (0)
6this:update_count();
7endfork
8this.update_task = ud;
9elseif (!this.keep_stats)
10task_valid(task = this.update_task) && kill_task(task);
11endif

update_count

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

Source

1while (this.keep_stats)
2suspend(this.count_period_secs);
3this.rcount_history = {@this.rcount_history, this.rcount_current};
4if (this.rcount_current > 30)
5this.furnace:alert(this.rcount_current);
6endif
7this.rcount_current = 0;
8if (length(this.rcount_history) > this.rcount_length)
9this.rcount_history = this.rcount_history[($ - this.rcount_length) + 1..$];
10endif
11endwhile

watch

Spec this none noneFlags rxdOwner #361Definer #57

Referenced by

none

Source

1if (!player.programmer)
2player:tell("LOOK AWAY, MORTAL!!11");
3return;
4endif
5if (this.watchers)
6player:tell("[ ", this.watchers[1].name, " is currently watching. To minimize lag, only one person at a time can watch the sausages being made. ]");
7return;
8endif
9this:do_player_watch(player);

watch_tell

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

Source

1untold = this.watchers;
2for w in (untold)
3if ("watch_tell" in verbs(w))
4try
5w:watch_tell(@args);
6except e (ANY)
7$rpg:report_error(e);
8endtry
9untold = setremove(untold, w);
10endif
11endfor
12if (!untold)
13return;
14endif
15{sign, itemname, parent, ?location = ""} = args;
16callinfo = callers(1)[2];
17if ((callinfo[4] == $rpg) && (callinfo[2] == "junk"))
18callinfo = callers(1)[3];
19endif
20who = callinfo[5];
21if (callinfo[5] == #2)
22who = "";
23elseif (!is_a(callinfo[5], $player))
24who = "NPC";
25else
26who = who.name;
27endif
28verbthis = callinfo[1];
29verbloc = valid(verbthis) ? verbthis.location | #-1;
30w = {1, 16, 7, 12, 29, 5};
31w_b = {18, 20, 7, 20, 7};
32"+-, Item Name, Parent, Player, Verb, Task";
33"nothing, ThisName, ThisNum, Location, LocNum";
34color = (sign == "+") ? $ansi.yellow | $ansi.red;
35s = {color, $ansi.bold_on, sign, " "};
36s = {@s, $su:left(itemname, -w[2]), " "};
37s = {@s, $su:left(parent, w[3]), " "};
38s = {@s, $su:left(who, -w[4]), " "};
39s = {@s, $su:left($code_utils:format_caller(callinfo), -w[5]), " "};
40s = {@s, "%", $su:right(task_id(), -(w[6] - 1)), $ansi.reset};
41s_b = {color, $su:space(w_b[1] + 1)};
42nn = (`verbthis.name ! ANY => ""' + " ") + tostr(verbthis);
43if (length(nn) > ((w_b[2] + w_b[3]) + 1))
44s_b = {@s_b, $su:left(`verbthis.name ! ANY => ""', -w_b[2]), " "};
45s_b = {@s_b, $su:left(verbthis, w_b[3]), "  "};
46else
47s_b = {@s_b, $su:left(nn, (w_b[2] + w_b[3]) + 1), "  "};
48endif
49s_b = {@s_b, $su:left(`verbloc.name ! ANY => ""', -w_b[4]), " "};
50s_b = {@s_b, tostr(verbloc), $ansi.reset};
51for w in (untold)
52w:tell(@s);
53w:tell(@s_b);
54endfor

do_player_watch

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

Source

1{target} = args;
2this.watchers = setadd(this.watchers, target);
3target:tell($ansi.cyan, "[ Type 'done' to stop watching. ]", $ansi.reset);
4widths = {1, 16, 7, 12, 29, 7};
5widths_b = {18, 20, 8, 20, 7};
6headings = {"", "Item Name", "Parent", "Player", "Verb", "Task"};
7headings_b = {"", "Caller", "", "Location", "#"};
8header = "";
9header_b = "";
10for i in [1..length(headings)]
11header = (header + $su:left(headings[i], widths[i])) + " ";
12endfor
13for i in [1..length(headings_b)]
14header_b = (header_b + $su:left(headings_b[i], widths_b[i])) + " ";
15endfor
16target:tell($ansi.debugbold, header, $ansi.reset);
17target:tell($ansi.debugbold, header_b, $ansi.reset);
18watch_task = task_id();
19fork (0)
20while (1)
21suspend(10);
22if (!task_valid(watch_task))
23break;
24endif
25target:tell($ansi.debugbold, header, $ansi.reset);
26target:tell($ansi.debugbold, header_b, $ansi.reset);
27endwhile
28endfork
29while (1)
30try
31line = read();
32if (line[1..min(4, $)] == "done")
33this.watchers = setremove(this.watchers, player);
34target:tell($ansi.cyan, "[ Finished watching. ]", $ansi.reset);
35break;
36endif
37except error (ANY)
38return error[1];
39endtry
40endwhile

_www

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

none

Source

1output = tostr("spawn:", this.stat_spawn, " recycle:", this.stat_recycle);
2this.stat_spawn = 0;
3this.stat_recycle = 0;
4return {output};

_handle_bad_garbage

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

Source

1"Handle contents of the recycler which cannot be recycled.";
2if (caller != this)
3raise(E_PERM);
4endif
5{what} = args;
6msg = {tostr("Object ", what, " was found in the $recycler but could not be used to create a new object. The problems were:")};
7if (what.owner != #29)
8msg = {@msg, tostr(" - .owner = ", $su:nn(what.owner), " (should be #29.)")};
9endif
10if (parent(what) != $garbage)
11msg = {@msg, tostr(" - parent = ", $su:nn(parent(what)), " (should be $garbage.)")};
12endif
13if (children(what) != {})
14msg = {@msg, tostr(" - object had ", length(children(what)), " children (should be 0)")};
15endif
16rhistory = `what.previous_state ! ANY';
17if (typeof(rhistory) == ERR)
18msg = {@msg, "", tostr("A '", rhistory, "' error was received when the item's previous state was queried.")};
19elseif (rhistory)
20how = tostr("Object was '", rhistory[4], "', recycled by ", rhistory[3][4], ":", rhistory[3][2], " (", rhistory[3][6], ").");
21msg = {@msg, "", how};
22else
23msg = {@msg, "", "The origin of the object is unknown."};
24endif
25move(what, #-1);
26recycle_error = `$recycler:_recycle(what) ! ANY => 1';
27if (recycle_error)
28msg = {@msg, "The object was moved to #-1."};
29else
30msg = {@msg, "The object was moved to #-1, and then re-recycled."};
31endif
32$nets.prognet:sys_announce("Improper recycle: " + $su:from_list(msg, ", "));

setup_new_object_as

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

Source

1{o, parent} = args;
2chparent(o, parent);
3o.name = "";
4o.r = 1;
5o.f = 0;
6o.w = 0;
7if (has_callable_verb(o, "initialize"))
8try
9o:initialize();
10except e (ANY)
11$rpg:report_error(e);
12endtry
13endif
14return o;

fossilize

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

none

Source

1if (!caller_perms().wizard)
2raise(E_PERM);
3endif
4{what} = args;
5if ((!is_a(what, $garbage)) && (!is_a(what, $fossil)))
6raise(E_INVARG);
7endif
8dest = $fossil;
9while (length(c = dest.contents) >= 800)
10dest = c[random($)];
11yield;
12endwhile
13chparent(what, dest);
14move(what, dest);

defossilize

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

none

Source

1if (!caller_perms().wizard)
2raise(E_PERM);
3endif
4{?n = 1} = args;
5done = 0;
6where = $fossil;
7while (1)
8if (c = where.contents)
9where = c[random($)];
10else
11break;
12endif
13yield;
14endwhile
15if (where == $fossil)
16return 0;
17endif
18where = where.location;
19"guaranteed to have contents";
20if (!valid(where))
21return 0;
22endif
23contents = where.contents;
24while (contents && (done < n))
25{what, @contents} = contents;
26if (what.contents || children(what))
27yield;
28continue;
29endif
30chparent(what, $garbage);
31move(what, $recycler);
32done = done + 1;
33yield;
34endwhile
35return done;

flush_to_fossils

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

none

Source

1if (!caller_perms().wizard)
2raise(E_PERM);
3endif
4current_target = #-1;
5can_do = 0;
6done = 0;
7while (valid(x = first_in(this)))
8if ((x.location == this) && (parent(x) == $garbage))
9if (!valid(current_target))
10current_target = $fossil;
11while (length(f = current_target.contents) >= 800)
12current_target = f[random($)];
13yield;
14endwhile
15can_do = 800 - length(f);
16endif
17chparent(x, current_target);
18move(x, current_target);
19can_do = can_do - 1;
20if (!can_do)
21current_target = #-1;
22endif
23endif
24done = done + 1;
25if ((done % 10000) == 0)
26player:tell(ctime(), " -- done ", done);
27endif
28yield;
29endwhile

enterfunc

Spec this none thisFlags rxdOwner #361Definer #57

Referenced by

none

Source

1try
2realcall = callers(1)[2];
3if (realcall[1] != this)
4mover = tostr(realcall[5], ":", realcall[2], " (this = ", realcall[1], ")");
5$nets.bugnet:announce(#-1, tostr("RECYCLER MISUSE: ", mover, " put something into the recycler directly! Don't do this!"), 1);
6endif
7except e (ANY)
8$rpg:report_error(e, "recycler enterfunc");
9endtry