Recycling Center #57
Aliases: Recycling Center, Center
31 verbs · 48 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
_recreate | this none this | rxd | #57 | 35 |
_recycle | this none this | rxd | #57 | 43 |
_create | this none this | rxd | #57 | 24 |
addhist | this none this | rxd | #57 | 7 |
show*-history | this none none | rxd | #57 | 9 |
request | any out of/from inside/from this | rxd | #57 | 28 |
setup_toad | this none this | rxd | #57 | 16 |
add_orphan | this none this | rxd | #57 | 3 |
remove_orphan | this none this | rxd | #57 | 3 |
valid | this none this | rxd | #57 | 4 |
init_for_core | this none this | rxd | #57 | 6 |
resurrect | this none this | rxd | #57 | 16 |
reclaim_lost_souls | this none this | rxd | #57 | 16 |
look_self | this none this | rxd | #57 | 13 |
gc | this none this | rxd | #57 | 25 |
moveto | this none this | rxd | #57 | 1 |
kill_all_tasks | this none this | rxd | #57 | 15 |
occupants | this none this | rxd | #57 | 0 |
_recreate_old | this none this | rxd | #57 | 16 |
server_started | this none this | rxd | #57 | 11 |
update_count | this none this | rxd | #57 | 11 |
watch | this none none | rxd | #57 | 9 |
watch_tell | this none this | rxd | #57 | 54 |
do_player_watch | this none this | rxd | #57 | 40 |
_www | this none this | rxd | #57 | 4 |
_handle_bad_garbage | this none this | rxd | #57 | 32 |
setup_new_object_as | this none this | rxd | #57 | 14 |
fossilize | this none this | rxd | #57 | 14 |
defossilize | this none this | rxd | #57 | 35 |
flush_to_fossils | this none this | rxd | #57 | 29 |
enterfunc | this none this | rxd | #57 | 9 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
orphans | #57 | r | #29 | {} |
announce_removal_msg | #57 | rc | #29 | "" |
nhist | #57 | | #29 | 50 |
history | #57 | | #29 | {} |
lost_souls | #57 | rc | #29 | {} |
rcount_current | #57 | rc | #29 | 369 |
rcount_history | #57 | rc | #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 | #57 | rc | #29 | 30 |
count_period_secs | #57 | rc | #29 | 30 |
keep_stats | #57 | rc | #29 | 1 |
rhistory | #57 | rc | #29 | {} |
max_rhistory | #57 | rc | #29 | 1000 |
watchers | #57 | rc | #29 | {} |
furnace | #57 | rc | #29 | #188453 |
stat_spawn | #57 | rc | #29 | 5328364 |
stat_recycle | #57 | rc | #29 | 369 |
use_backup | #57 | rc | #29 | 0 |
update_task | #57 | rc | #29 | 350382959 |
handed | #5 | rc | #29 | <clear> |
wield_msg | #5 | rc | #29 | <clear> |
unwield_msg | #5 | rc | #29 | <clear> |
size | #5 | rc | #29 | <clear> |
look_place_msg | #5 | rc | #29 | <clear> |
value | #5 | rc | #29 | <clear> |
get_msg | #5 | rc | #29 | <clear> |
drop_msg | #5 | rc | #29 | <clear> |
get_fail_msg | #5 | rc | #29 | <clear> |
junk_ok | #5 | rc | #29 | <clear> |
floats | #5 | rc | #29 | <clear> |
long_name_msg | #5 | rc | #29 | <clear> |
article | #5 | rc | #29 | <clear> |
setup_list | #5 | rc | #29 | <clear> |
health | #5 | rc | #29 | <clear> |
health_max | #5 | rc | #29 | <clear> |
min_skill | #5 | rc | #29 | <clear> |
skill | #5 | rc | #29 | <clear> |
recipe_for | #5 | rc | #29 | <clear> |
carried_msg | #5 | rc | #29 | <clear> |
aliases | #1 | rc | #29 | {"Recycling Center", "Center"} |
description | #1 | rc | #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 | #1 | r | #29 | {160727, 1298433815} |
hidden_verbs | #1 | rc | #29 | <clear> |
phelp_msg | #1 | rc | #29 | <clear> |
weight | #1 | rc | #29 | <clear> |
owner_verbs | #1 | rc | #29 | <clear> |
plural_name | #1 | rc | #29 | <clear> |
client_image | #1 | rc | #29 | <clear> |
listening | #1 | rc | #29 | <clear> |
Ancestry
Ancestors (nearest first): #5 generic thing → #1 root
Children: none
Call graph
Source
_recreate
Referenced by
- #57:_create line 10:
this:_recreate
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
Referenced by
- #3:recycle line 9:
$recycler:_recycle - #3:recycle line 12:
$recycler:_recycle - #17:recursive_recycle line 14:
$recycler:_recycle - #57:resurrect line 9:
$recycler:_recycle - #57:gc line 19:
this:_recycle - #57:_handle_bad_garbage line 26:
$recycler:_recycle - #111:disintegrate line 5:
$recycler:_recycle - #119:become_adoor line 23:
$recycler:_recycle - #127:add_to line 46:
$recycler:_recycle - #127:add_to_old line 47:
$recycler:_recycle - #138:_eat line 20:
$recycler:_recycle - #141:_disperse line 6:
$recycler:_recycle - #141:_exclude_by line 4:
$recycler:_recycle - #141:wipe line 23:
$recycler:_recycle - #141:lick line 29:
$recycler:_recycle - #141:reduce_by line 5:
$recycler:_recycle - #142:respawn line 5:
$recycler:_recycle - #142:heartbeat line 12:
$recycler:_recycle - #167:biz_disband line 45:
$recycler:_recycle - #167:recycle line 9:
$recycler:_recycle - #167:recycle line 12:
$recycler:_recycle - #167:disband_cleanup line 8:
$recycler:_recycle - #167:disband_cleanup line 9:
$recycler:_recycle - #167:old_cleanup line 9:
$recycler:_recycle - #167:old_cleanup line 10:
$recycler:_recycle - #186:_clean line 24:
$recycler:_recycle - #186:_new_clean line 45:
$recycler:_recycle - #186:_new_clean line 49:
$recycler:_recycle - #256:_flow line 5:
$recycler:_recycle - #301:destroy_session line 9:
$recycler:_recycle - #302:finalize_connection line 7:
$recycler:_recycle - #306:end line 6:
$recycler:_recycle - #334:del*ete line 43:
$recycler:_recycle - #334:uninstantiate line 29:
$recycler:_recycle - #334:uninstantiate line 32:
$recycler:_recycle - #334:bury line 29:
$recycler:_recycle - #334:bury line 33:
$recycler:_recycle - #334:bury line 34:
$recycler:_recycle - #334:bury_room line 20:
$recycler:_recycle - #334:bury_room line 24:
$recycler:_recycle - #334:bury_room line 28:
$recycler:_recycle - #334:bury_exit line 6:
$recycler:_recycle - #334:bury_exit line 8:
$recycler:_recycle - #338:dump line 16:
$recycler:_recycle - #338:recycle line 2:
$recycler:_recycle - #338:entomb line 3:
$recycler:_recycle
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
Referenced by
- #21:make_exit_pair line 14:
$recycler:_create - #21:make_exit_pair line 15:
$recycler:_create - #75:bi_create line 5:
$recycler:_create - #103:spawn line 8:
$recycler:_create - #114:find_transitions line 28:
$recycler:_create - #142:award_species_quest line 16:
$recycler:_create - #167:make_forum line 2:
$recycler:_create - #167:create_channel line 2:
$recycler:_create - #189:map_area line 2:
$recycler:_create - #301:create_session line 4:
$recycler:_create - #334:dig line 51:
$recycler:_create
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
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
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
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
Referenced by
- #57:_recreate line 20:
this:setup_toad - #57:request line 18:
this:setup_toad - #57:_recreate_old line 13:
this:setup_toad
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
Referenced by
- #57:_recycle line 21:
this:add_orphan - #57:setup_toad line 11:
this:add_orphan
Source
1if (caller == this) 2this.orphans = setadd(this.orphans, args[1]); 3endif
remove_orphan
Referenced by
- #57:_recycle line 33:
this:remove_orphan - #57:setup_toad line 13:
this:remove_orphan
Source
1if (caller == this) 2this.orphans = setremove(this.orphans, args[1]); 3endif
valid
Referenced by
- #6:pee line 6:
$recycler:valid - #21:object_audit_string line 4:
$recycler:valid - #21:do_audit line 33:
$recycler:valid - #31:bad_eval line 19:
$recycler:valid - #43:done line 9:
$recycler:valid - #43:match_object line 3:
$recycler:valid - #51:set_property_value line 9:
$recycler:valid - #54:old_count line 7:
$recycler:valid - #55:drag line 2:
$recycler:valid - #65:replace line 8:
$recycler:valid - #65:replace line 8:
$recycler:valid - #104:rot line 16:
$recycler:valid - #104:hear_event_arrive line 2:
$recycler:valid - #104:cut line 7:
$recycler:valid - #106:head_to line 3:
$recycler:valid - #107:_resist line 9:
$recycler:valid - #107:debug_tell_room line 2:
$recycler:valid - #107:bolt line 1:
$recycler:valid - #107:bolt line 4:
$recycler:valid - #114:next_area_to line 11:
$recycler:valid - #114:next_area_to line 11:
$recycler:valid - #114:next_area_to line 11:
$recycler:valid - #166:award_to line 42:
$recycler:valid - #166:award_to line 49:
$recycler:valid - #166:tree_tag line 11:
$recycler:valid - #167:biz_disband line 18:
$recycler:valid - #334:focus line 6:
$recycler:valid - #334:focus line 14:
$recycler:valid - #334:focus line 16:
$recycler:valid - #338:fill line 20:
$recycler:valid - #338:fill line 22:
$recycler:valid
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
Referenced by
none
Source
1if (caller_perms().wizard) 2this.orphans = {}; 3this.history = {}; 4this.lost_souls = {}; 5pass(); 6endif
resurrect
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
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
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
Referenced by
- #297:recycler_gc line 1:
$recycler:gc
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
Referenced by
none
Source
1pass(#-1);
kill_all_tasks
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
Referenced by
none
Source
No program (verb defined but unprogrammed).
_recreate_old
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
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
Referenced by
- #57:server_started line 6:
this:update_count
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
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
Referenced by
- #57:_recycle line 23:
this:watch_tell - #57:_create line 21:
this:watch_tell
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
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
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
Referenced by
- #57:_recreate line 23:
this:_handle_bad_garbage
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
Referenced by
- #21:recreate line 38:
$recycler:setup_new_object_as - #57:_create line 17:
this:setup_new_object_as
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
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
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
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
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