AbsoluteZero.textdump.gz
snippets · 44.7 KB · 2010-03-30
Text dump of an AbsoluteZero MOO/ColdMUD-style database (rooms, mail and connection objects), gzip-compressed.
Download « Back to the snippets list
name mail_recipient_registry 3
name room_the_waiting_room 462
name room_wormy_stairwell 406
name connection_6666_1_2 578
name false_lock_class 5
name room_the_asylum 452
name exit_southeast1 470
name mail_recipient 8
name user_features 189
name action_class 32
name exit_north1 454
name user_satan 62
name user_lynx1 560
name properties 22
name exit_east2 48
name connection 29
name mail_user 21
name help_root 36
name exit_up1 408
name integer 39
name room 40
name exit 47
name sys 0
name "sendmail_connection_delphi.glendon.yorku.ca6" 347
name room_torture_chamber 466
name topic_help_commands 88
name and_lock_class 9
name user_registry 10
name or_lock_class 11
name editor_jordan 427
name thing_clock 70
name exit_north2 459
name room_roark 42
name exit_west4 420
name exit_west2 113
name exit_north 91
name exit_east4 419
name user_opal 230
name user_lynx 395
name help_help 37
name obj_eye 130
name exit_up 116
name editor 41
name parse 45
name user 20
name topic_help_example 35
name topic_builder_dig 34
name programmer_help 51
name room_tristessa 172
name exit_northeast 469
name user_jordan 60
name lock_parser 63
name user_spine 480
name user_ellis 500
name exit_east6 464
name user_karl 56
name help_user 23
name physical 14
name feature 429
name string 71
name verbs 12
name root 1
name data 132
name user_visiteur_quebecois 100
name topic_help_navigation 65
name topic_message_format 413
name connection_6666_4 562
name connection_6666_1 572
name true_lock_class 50
name room_The_Garden 159
name gender_yourself 53
name user_matthew 81
name builder_help 58
name user_samiam 55
name user_keelah 96
name topic_users 104
name user_nniuq 472
name user_craig 447
name user_crag2 576
name room_chaos 44
name frob_class 4
name exit_west3 416
name exit_east3 415
name room_karl 43
name room_core 111
name gender_it 66
name exit_down 49
name container 17
name messages 326
name thing 69
name "sendmail_connection_delphi.glendon.yorku.ca1" 342
name object_lock_class 75
name method_editor 79
name message_class 80
name user_schlake 258
name user_hemlock 248
name mail_message 83
name user_zippy1 267
name gender_male 87
name exit_south 108
name user_puff 228
name user_crag 61
name matchable 6
name user_pan 86
name user_joe 137
name gender 52
name utils 38
name admin 59
name sendmail_connection 335
name programmer_features 238
name connection_6666_2 546
name editor_mandrake 217
name user_stinglai 521
name user_scrungus 523
name room_tunnels2 457
name antisocial_db 284
name room_tunnels 418
name user_druid 85
name topic_help 37
name registered 7
name help_node 33
name exit_east 114
name commands 18
name topic_builder_messages 412
name topic_builder_commands 64
name connection_6666_1_3 580
name user_foreignhost 287
name user_patroclus 178
name not_lock_class 76
name exit_northwest 467
name user_mandrake 213
name room_tunnels1 453
name object_editor 78
name room_neocafe 170
name editor_terry 275
name programmer 25
name help_index 89
name exit_west5 461
name exit_east5 460
name room_dred 174
name builder 24
name "sendmail_connection_delphi.glendon.yorku.ca2" 343
name user_randalar 82
name pronoun_class 93
name grep_features 361
name user_xythian 273
name editor_class 77
name exit_south1 456
name exit_down1 407
name antisocial 190
name user_greg 99
name user_dr 556
name located 15
name english 107
name obj_ 518
name "sendmail_connection_delphi.glendon.yorku.ca" 341
name login_watching_features 368
name connection_6666_3_5 515
name connection_6666 581
name topic_builder 58
name gender_female 94
name user_leland 54
name room_roark3 110
name room_roark2 109
name programmer2 100
name gender_you 103
name editor_joe 349
name described 13
name registry 2
name events 16
name list 118
name topic_help_structure 102
name topic_programmer 51
name room_small_cave 414
name sequence_class 92
name exit_southeast 468
name user_rainking 262
name user_zachary 243
name editor_chaos 236
name user_daffyd 26
name user_autumn 27
name exit_south2 458
name user_zippy 187
name user_terry 270
name user_roark 97
name user_chaos 101
name exit_west6 463
name user_help 104
name user_ford 139
name user_dred 165
name exit_west 74
name sendmail 333
name room_foo 156
name receiver 105
name nowhere 106
name person 19
name void 117
object #1
var 1 name "Root object"
var 1 owners [#1]
var 1 public 1
var 1 child_index 6
var 1 fertile 0
var 1 inited 0
var 1 id 'root
var 1 id_prefix 'obj
var 1 id_index 0
method initialize
if ((!(caller().is_agent('hierarchy))) && (sender() != this()))
throw(~perm, "Caller is not this or an agent of hierarchy protocol.");
if (!inited) {
(> .init(ancestors()) <);
inited = 1;
}
.
method deinitialize
if (!(caller().is_agent('hierarchy)))
throw(~perm, "Caller is not an agent of hierarchy protocol.");
(> .deinit(ancestors()) <);
.
method init
arg ancestors;
var prime_parent;
if (!(caller().is_agent('hierarchy)))
throw(~perm, "Caller is not an agent of hierarchy protocol.");
if (definer() in ancestors) {
child_index = 0;
name = "_unnamed_" + tostr(this());
(| sender().add_owned(this()) |);
(| .add_owned(this()) |);
owners = setadd([this()], sender());
fertile = 0;
// Inherit public, fertile from parent.
prime_parent = parents()[1];
public = prime_parent.public();
}
.
method deinit
arg anc;
var obj;
if ((caller() != $root) && (caller() != $sys))
throw(~perm, "Caller is not $root or $sys.");
if (definer() in anc) {
for obj in (owners)
(| obj.remove_owned(this()) |);
}
.
method add_parent
arg obj;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
.chparents(setadd(parents(), obj));
.
method name
disallow_overrides;
return name;
.
method owners
disallow_overrides;
return owners || [];
.
method is_owned_by
disallow_overrides;
arg obj;
return (| obj in owners |) || ($sys.is_admin(obj));
.
method public
disallow_overrides;
return public;
.
method fertile
disallow_overrides;
return fertile;
.
method set_fertile
arg val;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender not an owner");
fertile = val ? 1 | 0;
.
method set_name
arg s;
// Only accept calls from owners or admins.
if (!(.is_owned_by(sender())))
throw(~perm, "Sender not an owner.");
// Make sure first argument is a string.
if (type(s) != 'string)
throw(~type, ("First argument (" + toliteral(s)) + ") not a string.");
// Don't allow names beginning with "_unnamed_".
if ((strlen(s) >= 9) && (substr(s, 1, 9) == "_unnamed_"))
throw(~name, "Invalid name.");
// Set name to first argument.
name = s;
.
method set_public
arg val;
// Only accept calls from owners or admins.
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
// Set public to the given value.
public = val;
.
method set_owners
arg owners_arg;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
owners = owners_arg;
.
method add_owner
arg obj;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
(| obj.add_owned(this()) |);
owners = setadd(owners, obj);
.
method del_owner
arg obj;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
(| obj.remove_owned(obj) |);
owners = setremove(owners, obj);
.
method chparents
arg parents;
var old, init, uninit, i;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
old = ancestors();
(> $sys.change_sender_parents(parents) <);
init = [];
uninit = old;
for i in (ancestors()) {
uninit = setremove(uninit, i);
if (!(i in old))
init = init + [i];
}
catch any {
.init(init);
} with handler {
(| .uninit(init) |);
$sys.change_sender_parents_back(old);
return;
}
(| .uninit(uninit) |);
.
method ok_to_inherit
arg obj;
// This method is called by the system object to determine if it is okay
// for an object to inherit from us.
return fertile || (.is_owned_by(obj));
.
method spawn
arg name, [id];
if ((!fertile) && (!(.is_owned_by(sender()))))
throw(~perm, "Not fertile and sender not an owner.");
// Ask the system object for a child.
return (> $sys.spawn_sender(sender(), name, id ? id[1] | 0) <);
.
method destroy
// This doesn't actually destroy us immediately, but we will go away when
// nothing is holding onto us any more.
if (!(.is_owned_by(sender())))
throw(~perm, "Sender not an owner.");
(| .deinitialize() |);
$sys.destroy_sender();
.
method add_parameter
arg name;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
(> add_parameter(name) <);
.
method parameters
if ((!public) && (!(.is_owned_by(sender()))))
throw(~perm, "Not public and sender not an owner.");
return parameters();
.
method del_parameter
arg name;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender not an owner.");
(> del_parameter(name) <);
.
method del_method
arg name;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender not an owner.");
(> del_method(name) <);
.
method methods
if ((!public) && (!(.is_owned_by(sender()))))
throw(~perm, "Not public and sender not an owner.");
return methods();
.
method parents
disallow_overrides;
return parents();
.
method children
disallow_overrides;
return children();
.
method ancestors
disallow_overrides;
return ancestors();
.
method is
disallow_overrides;
arg obj;
return (obj == this()) || (obj in ancestors());
.
method find_method
arg name;
if ((!public) && (!(.is_owned_by(sender()))))
throw(~perm, "Not public and sender not an owner.");
return (> find_method(name) <);
.
method find_next_method
arg name, after;
if ((!public) && (!(.is_owned_by(sender()))))
throw(~perm, "Not public and sender not an owner.");
return (> find_next_method(name, after) <);
.
method list_method
arg name;
if ((!public) && (!(.is_owned_by(sender()))))
throw(~perm, "Not public and sender not an owner.");
return (> list_method(name) <);
.
method compile
arg code, name;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender not an owner.");
return compile(code, name);
.
method show
var output, i, data, obj, vars;
if ((!public) && (!(.is_owned_by(sender()))))
throw(~perm, "Not public and sender not an owner.");
// Show parents.
output = ["Parents: " + toliteral(parents())];
// Show size.
output = [("Size: " + tostr(size())) + " bytes."];
// we assume no object will ever by one byte :)
// Show parameter names.
output = output + ["Parameters:"];
for i in (parameters())
output = output + [" " + tostr(i)];
// Show method names.
output = output + ["Methods:"];
for i in (methods())
output = output + [" " + tostr(i)];
// Show variables.
data = $sys.sender_data();
for obj in (ancestors()) {
vars = (| data[obj] |);
if (!vars)
continue;
output = output + [(obj.id_str()) + " variables:"];
for i in (dict_keys(vars))
output = output + [((" " + tostr(i)) + ": ") + ($data.unparse(vars[i]))];
}
// Return what we've shown.
return output;
.
method follows
disallow_overrides;
arg protocol;
var obj;
for obj in ($sys.followers(protocol)) {
if (has_ancestor(obj))
return 1;
}
return 0;
.
method is_agent
disallow_overrides;
arg protocol;
return (| this() in ($sys.agents(protocol)) |) ? 1 | 0;
.
method eval
arg code;
var errors, result;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender doesn't own this.");
// Compile the code.
errors = compile(code, 'tmp_eval);
if (errors)
return ['errors, errors];
// Evaluate the expression. Be sure to remove it afterwards, so that no
// one else can call it.
catch any {
result = .tmp_eval();
} with handler {
del_method('tmp_eval);
rethrow(~methoderr);
}
del_method('tmp_eval);
return ['result, result];
.
method size
return size();
.
method id
disallow_overrides;
return id;
.
method set_id_prefix
arg s;
if (!($sys.is_admin(sender())))
throw(~perm, "Sender is not an admin.");
if (type(s) != 'symbol)
throw(~type, "First argument isn't a symbol.");
id_prefix = s;
.
method id_str
disallow_overrides;
if (!id)
return toliteral(this());
return "$" + substr(toliteral(id), 2);
.
method id_prefix
disallow_overrides;
return id_prefix || ((parents()[1]).id_prefix());
.
method set_id
arg s;
var id_prefix, id_tmp;
id_prefix = tostr(.id_prefix());
if ((id_prefix in tostr(s)) == 1)
id_prefix = "";
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
if (type(s) != 'symbol)
throw(~type, "First argument is not a symbol.");
if (id_prefix && (((id_prefix[strlen(id_prefix)]) != "_") || ((tostr(s)[1]) != "_")))
id_tmp = tosym((id_prefix + "_") + tostr(s));
else
id_tmp = tosym(id_prefix + tostr(s));
id = $sys.acquire_id(id_tmp);
return id;
.
method rename_method
arg from, too;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
(> compile(list_method(from), too) <);
(> del_method(from) <);
.
method set_id_raw
disallow_overrides;
arg s;
if ((sender() != $sys) && (!($sys.is_admin(sender()))))
throw(~perm, "Sender is not an admin or $sys");
(> $sys.set_id_for_sender(s) <);
id_index = 0;
id = s;
.
method child_id
var newid;
if (sender() != $sys)
throw(~perm, "Invalid call to private method.");
id_index = id_index + 1;
newid = tostr(id);
if ((newid[strlen(newid)]) in "1234567890")
newid = newid + "_";
newid = newid + tostr(id_index);
return tosym(newid);
.
method name_and_id
disallow_overrides;
return ((name + " (") + (.id_str())) + ")";
.
method size_str
var size, out;
size = size();
if (size < 1000)
return tostr(size) + "b";
out = size / 1024;
return ((tostr(out) + ".") + tostr((size - (out * 1024)) / 100)) + "k";
.
parent #1
object #12
var 12 verbs #[]
var 1 child_index 0
var 1 name "Generic verb-containing object"
var 1 owners [#12]
var 1 fertile 0
var 1 public 1
var 1 inited 1
var 1 id 'verbs
method init
arg ancestors;
(> pass(ancestors) <);
if (definer() in ancestors)
verbs = #[];
.
method verb_templates
return dict_keys(verbs);
.
method add_verb
arg template, method, remote;
var words, pos;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
// Check argument types.
if (type(template) != 'string)
throw(~type, "Template is not a string.");
if (type(method) != 'symbol)
throw(~type, "Method name is not a symbol.");
if ((remote != 'remote) && (remote != 'noremote))
throw(~type, "Remote specifier is neither 'remote nor 'noremote");
// Make sure there's exactly one "%this" in the template, as a word by
// itself.
words = explode(template);
if (((words[1]) == "%this") || (((words[1]) == "*") || ((words[1]) == "*=*")))
throw(~template, "Template begins with wildcard.");
pos = "%this" in words;
if ((!pos) || ("%this" in sublist(words, pos + 1)))
throw(~template, "Template does not contain exactly one \"%this\".");
// Add the verbs to the dictionary.
verbs = dict_add(verbs, template, [method, remote]);
if (remote == 'remote)
$sys.new_remote_template(template);
else
.verbs_changed();
.
method remove_verb
arg template;
var verb_info;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
catch ~keynf {
verb_info = verbs[template];
verbs = dict_del(verbs, template);
if ((verb_info[1]) == 'remote)
$sys.removed_remote_template(template);
else
.verbs_changed();
} with handler {
throw(~verbnf, ("No verb with template " + tostr(template)) + ".");
}
.
method verbs_changed
disallow_overrides;
var loc, p;
if ((sender() != this()) || (caller() != definer()))
throw(~perm, "Invalid call to private method.");
// If this object has children, up the system verb consistency clock,
// forcing all users to update their command lists next time they process
// a command.
if (children()) {
for p in ($sys.connected_users())
p.invalidate_verb_cache();
}
// The verbs changed on a leaf. Delegate this to the subclasses; located
// objects will want to deal with it one way, exits another.
.verbs_changed_on_leaf();
.
method verbs_changed_on_leaf
if (sender() != this())
throw(~perm, "Sender not this.");
.
method verb_info
disallow_overrides;
arg template;
var verb_info, anc;
if (dict_contains(verbs, template))
return verbs[template];
for anc in (ancestors()) {
verb_info = (| anc.local_verb_info(template) |);
if (verb_info)
return verb_info;
}
throw(~verbnf, "No verb with template " + template);
.
method local_verb_info
disallow_overrides;
arg template;
catch ~keynf {
return verbs[template];
} with handler {
throw(~verbnf, "No verb with template " + template);
}
.
parent #12
object #13
var 13 description "You see nothing special."
var 1 child_index 0
var 1 name "Generic described object"
var 1 owners [#13]
var 1 fertile 0
var 1 public 1
var 12 verbs #[["l?ook %this", ['look_verb, 'noremote]], ["@desc?ribe %this as *", ['describe_verb, 'remote]]]
var 1 inited 1
var 1 id 'described
method init
arg ancestors;
(> pass(ancestors) <);
if (definer() in ancestors)
description = "You see nothing special.";
.
method description
return description;
.
method full_description
return description;
.
method set_description
arg s;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
description = s;
.
method look_verb
arg dummy1, dummy2;
var actor;
actor = sender();
actor.tell(.full_description());
.
method describe_verb
arg dummy1, dummy2, dummy3, desc;
var actor;
actor = sender();
if (!(.is_owned_by(sender()))) {
actor.tell("Permission denied.");
} else {
.set_description(desc);
actor.tell("Description set.");
}
.
parent #1
object #6
var 6 aliases []
var 1 child_index 0
var 1 name "Matchable object"
var 1 owners [#6]
var 1 fertile 0
var 1 public 1
var 1 inited 1
var 1 id 'matchable
method init
arg anc;
(> pass(anc) <);
if (definer() in anc)
aliases = [];
.
method aliases
disallow_overrides;
return aliases;
.
method matches
arg s;
var name, o;
name = .name();
if ((.matches_exactly(s)) || match_begin(name, s))
return 1;
return 0;
.
method matches_exactly
arg s;
return (s == (.name())) || (s in aliases);
.
method add_alias
arg a;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender not an owner.");
if (type(a) != 'string)
throw(~type, "Aliases must be strings.");
if (a != (.name()))
aliases = setadd(aliases, a);
.
method remove_alias
arg a;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender not an owner.");
aliases = setremove(aliases, a);
.
parent #13
parent #6
object #14
var 14 unique 0
var 14 proper 0
var 1 child_index 0
var 1 name "Physical object"
var 1 owners [#14]
var 1 fertile 1
var 1 public 1
var 6 aliases []
var 12 verbs #[["@rename %this to *", ['rename_verb, 'remote]], ["@addalias * to %this", ['addalias_verb, 'remote]], ["@rmalias * from %this", ['rmalias_verb, 'remote]], ["examine %this", ['examine_verb, 'remote]], ["@integrate %this as *", ['integrate_verb, 'remote]]]
var 13 description "You see nothing special."
var 1 inited 1
var 14 integrate 0
var 1 id 'physical
method init
arg anc;
(> pass(anc) <);
if (definer() in anc) {
unique = 0;
proper = 0;
}
.
method full_name
return .name();
.
method base_name
return .name();
.
method definite_name
if (proper)
return .base_name();
return "the " + (.base_name());
.
method indefinite_name
arg [args];
var s, n;
if (unique)
return .definite_name();
if ((listlen(args) == 1) && (type(args[1]) == 'integer))
n = args[1];
else
n = 1;
s = .base_name();
if ((n == 1) && proper)
return .base_name();
return (((n == 1) ? $string.a_or_an(s) | ($integer.to_english(n))) + " ") + s;
.
method set_unique
arg val;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
unique = val ? 1 | 0;
.
method set_proper
arg val;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
proper = val ? 1 | 0;
.
method unique
return unique;
.
method proper
return proper;
.
method rename_verb
arg dummy1, dummy2, dummy3, new;
if (!(.is_owned_by(sender()))) {
sender().tell("Permission denied.");
return;
}
.set_name(new);
sender().tell("Name set.");
.
method addalias_verb
arg dummy1, alias, dummy2, dummy3;
if (!(.is_owned_by(sender()))) {
sender().tell("Permission denied.");
return;
}
.add_alias(alias);
sender().tell(((((("Alias \"" + alias) + "\" added. Object ") + (.name_and_id())) + " now has the aliases ") + ($list.to_english(.aliases()))) + ".");
.
method rmalias_verb
arg dummy1, alias, dummy2, dummy3;
if (!(.is_owned_by(sender()))) {
sender().tell("Permission denied.");
return;
}
.remove_alias(alias);
sender().tell("Aliases are now: " + toliteral(.aliases()));
.
method examine_verb
arg dummy;
sender().tell("Uh, examine isn't working yet. Sorry.");
.
method integrate
return integrate;
.
method set_integrate
arg s;
if (!(.is_owned_by(sender())))
throw(~perm, "Permission denied");
integrate = s;
.
method integrate_cmd
arg d1, d2, d3, msg;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
integrate = msg;
sender().tell("Set to: " + msg);
.
method integrate_verb
arg d1, d2, d3, msg;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
integrate = msg;
sender().tell("Set to: " + msg);
.
parent #1
object #22
var 22 properties #[]
var 1 child_index 0
var 1 name "Property holder"
var 1 owners [#22]
var 1 fertile 0
var 1 public 1
var 1 inited 1
var 1 id 'properties
method init
arg anc;
(> pass(anc) <);
if (definer() in anc)
properties = #[];
.
method destroy
var props, prop;
(> pass() <);
props = properties;
properties = #[];
for prop in (dict_keys(props)) {
catch ~keynf, ~methodnf {
.get_property(prop);
} with handler {
.destroy_property(prop);
}
}
.
method all_properties
var props, prop, parent;
props = [];
for parent in (.ancestors()) {
catch ~methodnf {
for prop in (parent.properties())
props = setadd(props, prop);
}
}
return props;
.
method properties
if ((!(.public())) && ((!(.is_owned_by(sender()))) && (caller() != definer())))
throw(~perm, "Not public and sender not an owner.");
return dict_keys(properties);
.
method add_property
arg prop, val;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender isn't an owner.");
catch ~keynf {
.get_property(prop);
throw(~keyexists, "Object already has that property.");
} with handler {
properties = dict_add(properties, prop, val);
}
.
method del_property
arg prop;
var val;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender isn't an owner.");
if (!dict_contains(properties, prop))
throw(~keynf, "Object doesn't define that property");
val = properties[prop];
properties = dict_del(properties, prop);
catch ~keynf {
.get_property(prop);
} with handler {
.destroy_property(prop);
return;
}
properties = dict_add(properties, prop, val);
throw(~keynf, "Object doesn't define that property");
.
method get_property
arg prop;
var parent;
if (sender() != this())
throw(~perm, "Sender not this.");
for parent in (.ancestors()) {
catch ~keynf, ~methodnf {
return parent.inherit_property(prop);
}
}
throw(~keynf, "Unknown property.");
.
method clear_property
arg prop;
if (sender() != this())
throw(~perm, "Sender not this.");
(> .get_property(prop) <);
if (dict_contains(properties, prop)) {
properties = dict_del(properties, prop);
catch ~keynf {
.get_property(prop);
} with handler {
properties = dict_add(properties, prop, 0);
}
}
.
method set_property
arg prop, val;
if (sender() != this())
throw(~perm, "Sender not this.");
(> .get_property(prop) <);
properties = dict_add(properties, prop, val);
.
method destroy_property
arg prop;
var child;
if (caller() != definer())
throw(~putz, "Go away.");
if (dict_contains(properties, prop))
properties = dict_del(properties, prop);
for child in (.children())
child.destroy_property(caller, prop);
.
method inherit_property
arg prop;
if (caller() != definer())
throw(~putz, "Go away.");
return (> properties[prop] <);
.
parent #22
object #326
var 1 child_index 0
var 1 name "generic messaged object"
var 1 owners [#326, #60]
var 1 fertile 1
var 1 public 1
var 22 properties #[]
var 1 inited 1
var 1 id_index 0
var 1 id 'messages
method get_message
arg message;
var tmp;
message = tosym("msg_" + tostr(message));
return (> .get_property(message) <);
.
method set_message
arg message, value;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
message = tosym("msg_" + tostr(message));
return (> .set_property(message, value) <);
.
method messages
var message, results;
results = [];
for message in (.all_properties()) {
if (substr(tostr(message), 1, 3) == "msg")
results = [@results, tosym(substr(tostr(message), 5))];
}
return results;
.
method clear_message
arg message;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
message = tosym("msg_" + tostr(message));
return (> .clear_property(message) <);
.
parent #14
parent #326
object #47
var 47 source #117
var 47 dest #117
var 47 lock <#50, []>
var 1 child_index 11
var 1 name "Generic exit"
var 1 owners [#47]
var 1 fertile 1
var 1 public 1
var 6 aliases []
var 12 verbs #[["@lock %this with *", ['lock_verb, 'remote]]]
var 13 description "You see nothing special."
var 1 inited 1
var 14 unique 0
var 14 proper 0
var 46 settable #[["arrive", ['arrive_action, 'set_arrive_action]], ["leave", ['leave_action, 'set_leave_action]]]
var 1 id 'exit
var 1 id_prefix 'exit
var 22 properties #[['exit_arrive_msg, <#32, #[['world, <#93, [['actor, 'base_name, 1], " arrives."]>], ['actor, 0]]>], ['exit_leave_msg, <#32, #[['world, <#93, [['actor, 'base_name, 1], " has left ", ['thing, 'base_name, 0], "."]>], ['actor, 0]]>], ['msg_exit_arrive, <#32, #[['world, <#93, [['actor, 'base_name, 1], " arrives."]>], ['actor, 0]]>], ['msg_exit_leave, <#32, #[['world, <#93, [['actor, 'base_name, 1], " has left ", ['thing, 'base_name, 0], "."]>], ['actor, 0]]>]]
method init
arg ancestors;
(> pass(ancestors) <);
if (definer() in ancestors) {
source = $sys.exit_starting_room();
dest = source;
source.add_exit();
lock = $true_lock_class.new();
}
.
method verb_changed_in_leaf
(> pass() <);
source.verb_changed_inside();
.
method go_through
if (lock.try(sender())) {
(.get_message('exit_leave)).announce(sender(), this());
sender().move(dest);
(.get_message('exit_arrive)).announce(sender(), this());
} else {
sender().tell("You can't go that way.");
}
.
method lock_verb
arg dummy1, dummy2, dummy3, str;
if (!(.is_owned_by(sender())))
sender().tell("Permission denied.");
catch ~objnf, ~parse {
lock = $lock.parse(str, sender());
sender().tell("Locked.");
} with handler {
switch (error()) {
case ~objnf:
sender().tell("Object not found in lock string.");
case ~parse:
sender().tell("Invalid lock string.");
}
}
.
method attach
disallow_overrides;
arg place;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender does not own exit.");
if (!(place.follows('room)))
throw(~type, "Place doesn't follow room protocol.");
if (place == source) {
return;
}
(> place.will_attach(sender()) <);
source.remove_exit();
source = place;
place.add_exit();
(| place.did_attach(sender()) |);
.
method link
disallow_overrides;
arg place;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender does not own exit.");
if (!(place.follows('room)))
throw(~type, "Place doesn't follow room protocol.");
(> place.will_link(sender()) <);
dest = place;
(| place.did_link(sender()) |);
.
parent #47
object #454
var 1 child_index 0
var 1 name "north"
var 1 owners [#454, #60]
var 1 fertile 0
var 1 public 1
var 22 properties #[]
var 6 aliases ["n"]
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 0
var 47 source #418
var 47 dest #453
var 47 lock <#50, []>
var 1 inited 1
var 1 id_index 0
var 1 id 'exit_north1
parent #1
object #16
var 16 dependents []
var 1 child_index 0
var 1 name "Event-handling object"
var 1 owners [#16]
var 1 fertile 0
var 1 public 1
var 1 inited 1
var 1 id 'events
method init
arg anc;
(> pass(anc) <);
if (definer() in anc)
dependents = [];
.
method dependents
return dependents;
.
method add_dependent
arg obj;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
if (type(obj) != 'dbref)
throw(~type, "Argument is not a dbref.");
dependents = setadd(dependents, obj);
.
method remove_dependent
arg obj;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
dependents = setremove(dependents, obj);
.
method broadcast_event
arg event, [rest];
var obj;
if (sender() != this())
throw(~perm, "Sender is not this.");
if (type(event) != 'symbol)
throw(~type, "Event is not a symbol.");
for obj in (dependents)
(| obj.receive_event(event, @rest) |);
.
parent #14
parent #16
object #17
var 17 contents []
var 1 child_index 0
var 1 name "Generic container object"
var 1 owners [#17]
var 1 fertile 1
var 1 public 1
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 0
var 1 inited 1
var 1 id 'container
method init
arg ancestors;
(> pass(ancestors) <);
if (definer() in ancestors)
contents = [];
.
method contents
return contents;
.
method contains
arg obj;
return (obj in contents) ? 1 | 0;
.
method put
arg obj;
obj.move(this());
.
method take
arg obj;
if (!(obj in contents))
throw(~objnf, ("Object (" + toliteral(obj)) + ") not in contents.");
obj.move(sender());
.
method will_arrive
arg old_place;
if (!(caller().is_agent('movement)))
throw(~perm, "Caller not an agent of located protocol");
.
method will_leave
arg place;
if (!(caller().is_agent('movement)))
throw(~perm, "Caller not an agent of located protocol");
.
method did_arrive
arg place;
if (!(caller().is_agent('movement)))
throw(~perm, "Caller not an agent of located protocol");
.
method did_leave
arg place;
if (!(caller().is_agent('movement)))
throw(~perm, "Caller not an agent of located protocol");
.
method add_sender_to_contents
disallow_overrides;
if (!(caller().is_agent('movement)))
throw(~perm, "Caller not an agent of located protocol");
if ((sender().location()) != this())
throw(~location, "Sorry, but you're not here.");
contents = setadd(contents, sender());
.
method remove_sender_from_contents
disallow_overrides;
if (caller() != $located)
throw(~perm, "Caller not an agent of located protocol");
if ((sender().location()) == this())
throw(~location, "You're still here.");
contents = setremove(contents, sender());
.
method gc_contents
var obj;
for obj in (contents) {
if (!valid(obj))
contents = setremove(contents, obj);
}
.
method deinit
arg anc;
var obj;
(> pass(anc) <);
if (definer() in anc) {
for obj in (contents)
(| obj.move($sys.starting_room()) |);
}
.
parent #1
object #18
var 18 commands []
var 1 child_index 2
var 1 name "Generic command-handling object"
var 1 owners [#18, #20]
var 1 fertile 1
var 1 public 1
var 1 inited 1
var 1 id 'commands
method init
arg ancestors;
(> pass(ancestors) <);
if (definer() in ancestors)
commands = [];
.
method add_command
arg template, type, method;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
if ((type(template) != 'string) || (type(method) != 'symbol))
throw(~type, "Template and method are not a string and symbol.");
if ((type != 'template) && (type != 'pattern))
throw(~type, "Type is neither 'template nor 'pattern.");
commands = commands + [[template, type, method]];
.
method del_command
arg method;
var command;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
for command in (commands) {
if ((command[3]) == method) {
commands = setremove(commands, command);
return;
}
}
throw(~commandnf, "No command with method " + tostr(method));
.
method match_command
arg str;
var cmd, fields;
for cmd in (.all_commands()) {
if ((cmd[2]) == 'template)
fields = match_template(cmd[1], str);
else
fields = match_pattern(cmd[1], str);
if (fields)
return [cmd[3], fields];
}
return 0;
.
method commands
return commands;
.
method all_commands
var p, cmdlist, pc;
// Collect complete command list from ancestors. Ancestors may not be
// command-handling objects, in which case (| p.commands() |) is
// ~methodnf.
cmdlist = [];
for p in (ancestors()) {
pc = (| p.commands() |);
if (pc)
cmdlist = cmdlist + pc;
if (p == $commands)
break;
}
return cmdlist;
.
parent #17
parent #18
object #40
var 40 exits []
var 40 dark 0
var 40 link_ok 0
var 1 child_index 16
var 1 name "Generic room"
var 1 owners [#40]
var 1 fertile 1
var 1 public 1
var 18 commands [["l?ook", 'template, 'look_cmd], ["\"*", 'pattern, 'say_cmd], [":*", 'pattern, 'pose_cmd], ["say *", 'pattern, 'say_cmd], ["pose *", 'pattern, 'pose_cmd], ["emote *", 'pattern, 'pose_cmd]]
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 0
var 17 contents []
var 1 inited 1
var 1 id 'room
var 1 id_prefix 'room
method init
arg ancestors;
(> pass(ancestors) <);
if (definer() in ancestors) {
exits = [];
dark = 0;
link_ok = 0;
}
.
method dark
return dark;
.
method set_dark
arg val;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender not an owner.");
dark = val ? 1 | 0;
.
method link_ok
return link_ok;
.
method set_link_ok
arg val;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender not an owner.");
link_ok = val ? 1 | 0;
.
method exits
return exits;
.
method add_exit
if (!(caller().is_agent('exit)))
throw(~perm, "Sender is not an agent of exit protocol.");
exits = setadd(exits, sender());
.
method remove_exit
if (!(caller().is_agent('exit)))
throw(~perm, "Sender is not an agent of exit protocol.");
exits = setremove(exits, sender());
.
method describe_contents
arg c, ignore;
var r, players, things, obj;
things = [];
r = [];
players = [];
for obj in (c) {
if (!(obj in ignore)) {
if (obj.is($user))
players = setadd(players, obj);
else
things = setadd(things, obj);
}
}
if (things)
r = [("You see " + ($list.to_english($list.map(things, 'indefinite_name)))) + " here."];
if (players)
r = r + [($list.to_english($list.map(players, 'indefinite_name))) + ((listlen(players) == 1) ? " is here." | " are here.")];
return r;
.
method full_description
arg [args];
var integration;
integration = .integrating_description(args);
return [.name(), .description()] + (dark ? [] | ([(integration[1]) ? $list.to_string(integration[1], " ") | []] + (.describe_contents(integration[2], args))));
.
method tell_contents
arg str, [except];
var obj;
for obj in (.contents()) {
if (!(obj in except))
(| obj.tell(str) |);
}
.
method verb_changed_inside
.invalidate_verb_caches();
.
method did_arrive
arg [args];
(> pass(@args) <);
.invalidate_verb_caches();
.
method did_leave
arg [args];
(> pass(@args) <);
.invalidate_verb_caches();
.
method did_connect
if (!dark)
.tell_contents((sender().name()) + " has connected.", sender());
.
method did_disconnect
if (!dark)
.tell_contents((sender().name()) + " has disconnected.", sender());
.
method invalidate_verb_caches
var obj;
if ((sender() != this()) || (caller() != definer()))
throw(~perm, "Sender not this.");
for obj in (.contents())
(| obj.invalidate_verb_cache() |);
.
method look_cmd
arg dummy;
var actor;
actor = sender();
actor.tell(.full_description(actor));
.
method say_cmd
arg str;
var actor;
actor = sender();
.tell_contents((((actor.name()) + " says, \"") + str) + "\"", actor);
actor.tell(("You say, \"" + str) + "\"");
.
method pose_cmd
arg str;
var actor;
actor = sender();
if (str && ((str[1]) == ":"))
.tell_contents((actor.name()) + substr(str, 2));
else
.tell_contents(((actor.name()) + " ") + str);
.
method will_attach
arg obj;
if (!(.is_owned_by(obj)))
throw(~perm, "Object does not own room.");
.
method will_link
arg obj;
if ((!link_ok) && (!(.is_owned_by(obj))))
throw(~perm, "Object does not own non-link_ok room.");
.
method match_exit
arg s;
var obj;
for obj in (exits) {
if (obj.matches_exactly(s))
return obj;
}
throw(~exitnf, "That is not a matchable exit name.");
.
method integrating_description
arg except;
var non, obj, integrate, out;
out = [];
non = .contents();
for obj in (union(non, .exits())) {
integrate = (| obj.integrate() |);
if ((obj in except) || (!integrate))
continue;
out = out + [integrate];
non = setremove(non, obj);
}
return [out, non];
.
method gc_exits
var obj;
for obj in (exits) {
if (!valid(obj))
exits = setremove(exits, obj);
}
.
parent #40
object #452
var 1 child_index 0
var 1 name "The Asylum"
var 1 owners [#452, #27]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "A quiet room...silence broken only by the whirrings of far off machinery. Stark white padded walls and a padded ceiling seem comforting upon first glance. In the centre of the room stands a chrome table complete with stirrups and restraints. Other various leather restraints dangle from the walls. From the ceiling hangs a chrome dentistry-type lamp which casts a bright, yet eerie glow aroung the room. A white lab coat and the stale smell of antiseptics give the room a sense of officiality. Nonexistent footsteps fall and echo on the tiled floor... Only one door leads out of this place, and it locks from the outside. There are no windows...and no people... There is no comfort within this room..."
var 14 unique 0
var 14 proper 0
var 17 contents []
var 40 exits [#470]
var 40 dark 0
var 40 link_ok 0
var 1 inited 1
var 1 id_index 0
var 1 id 'room_the_asylum
parent #1
object #33
var 33 brief ""
var 33 text []
var 33 footnotes []
var 33 references #[]
var 33 upnode #36
var 33 subnodes []
var 33 menu 0
var 1 child_index 6
var 1 name "generic help node"
var 1 owners [#33]
var 1 fertile 1
var 1 public 1
var 1 inited 1
var 1 id 'help_node
var 1 id_prefix 'topic
method init
arg anc;
(> pass(anc) <);
if (definer() in anc) {
brief = "";
text = [];
footnotes = [];
references = #[];
upnode = $help_root;
subnodes = [];
menu = 0;
(> $help_root.add_subnode() <);
}
.
method destroy
var i;
(> pass() <);
for i in (subnodes)
(| i.set_upnode(.upnode()) |);
(| upnode.del_subnode() |);
.
method invalidate_menu
menu = 0;
.
method upnode
return upnode;
.
method subnodes
return subnodes;
.
method set_upnode
arg node;
if (!(node.is_owned_by(sender())))
throw(~perm, "Sender isn't an owner.");
(> node.add_subnode() <);
(| upnode.del_subnode() |);
upnode = node;
.
method add_subnode
if (caller() != definer())
throw(~putz, "Go away.");
subnodes = setadd(subnodes, sender());
.invalidate_menu();
.
method del_subnode
if (caller() != definer())
throw(~putz, "Go away.");
subnodes = setremove(subnodes, sender());
.invalidate_menu();
.
method path
var cur, list;
list = [];
cur = this();
while (cur != $help_root) {
cur = cur.upnode();
list = [cur, @list];
}
return list;
.
method set_name
arg string;
(> pass(uppercase(string)) <);
upnode.invalidate_menu();
.
method brief
return brief;
.
method set_brief
arg string;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender isn't an owner.");
brief = string;
.
method text
var ret, sub, headers, head, headlen;
ret = .path();
// the returned text is the path from root to node, the node's name and brief description, and its text.
headers = [$string.repeat("-", 70)];
head = (((" " + (.name())) + " (") + ($list.to_string($list.map(ret, 'name), " "))) + ")";
headers = headers + [head, (" " + ($string.repeat("=", strlen(head) - 2))) + pad(uppercase(.brief()), -(78 - strlen(head)), " ")];
ret = union(headers, [" ", @text]);
if (!(.subnodes()))
return ret;
// if there are subnodes, list them one per line with their brief descriptions
ret = [@ret, ""];
for sub in (.subnodes())
ret = [@ret, ("** " + pad((sub.name()) + ":", 13)) + (sub.brief())];
return ret;
.
method footnote
arg n;
return (> footnotes[n] <);
.
method match_menu
arg name;
var sub, l;
if (menu == 0) {
// menu is invalid. Build it from scratch
menu = references;
for sub in (.subnodes())
menu = dict_add(menu, sub.name(), sub);
}
catch ~keynf {
return menu[name];
}
l = strlen(name);
for sub in (menu) {
if (name == (| substr(sub[1], 1, l) |))
return sub[2];
}
throw(~keynf, ("There is no subnode called " + toliteral(name)) + ".");
.
method parse_line
arg line, fns, refs;
var sub, i, j, name, obj;
// shift parsed prefixes of `line' into `sub'.
sub = "";
while (1) {
// look for a reference begin-marker: `(:'
i = "(" in line;
j = "[" in line;
if ((!i) && (!j))
break;
i = (!i) ? j | ((!j) ? i | ((i <= j) ? i | j));
switch ((| substr(line, i, 2) |)) {
case "[:":
sub = sub + substr(line, 1, i + 1);
line = substr(line, i + 2);
i = "]" in line;
if ((!i) || (substr(line, i - 1, 2) != ":]"))
throw(~parse, ("Expected `:]' in " + toliteral(line)) + ".");
fns = [@fns, substr(line, 1, i - 2)];
sub = (sub + tostr(listlen(fns))) + ":]";
line = substr(line, i + 1);
case "(:":
sub = sub + substr(line, 1, i + 1);
line = substr(line, i + 2);
// match the trigger-name
i = ":" in line;
if (!i)
throw(~parse, ("Expected `:' in " + toliteral(line)) + ".");
name = substr(line, 1, i - 1);
line = substr(line, i + 1);
// match the referenced node
i = ")" in line;
if ((!i) || ((line[i - 1]) != ":"))
throw(~parse, ("Expected `:)' in " + toliteral(line)) + ".");
obj = substr(line, 1, i - 2);
catch any {
obj = sender().match_help_path(obj);
} with handler {
if ((obj[1]) != "$")
rethrow(error());
obj = todbref(substr(obj, 2));
}
line = substr(line, i + 1);
sub = (sub + name) + ":)";
// write down the new reference
refs = dict_add(refs, name, obj);
default:
sub = sub + substr(line, 1, i);
line = substr(line, i + 1);
}
}
return [sub + line, fns, refs];
.
method set_text
arg input;
var txt, tmp, line;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender isn't an owner.");
txt = [];
tmp = ["", [], #[]];
for line in (input) {
tmp = replace(tmp, 1, line);
tmp = (> .parse_line(@tmp) <);
// Add the newly parsed line.
txt = [@txt, tmp[1]];
}
// If all went well, store the new info and invalidate the menu.
text = txt;
footnotes = tmp[2];
references = tmp[3];
.invalidate_menu();
.
method create_subnode
arg name, b, t;
var sub;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender isn't an owner.");
sub = definer().spawn(name);
sub.add_owner($help_root);
sub.add_owner(sender());
catch any {
sub.set_brief(b);
sub.set_text(t);
sub.set_upnode(this());
} with handler {
sub.destroy();
rethrow(error());
}
return sub;
.
parent #33
object #412
var 1 child_index 0
var 1 name "MESSAGES"
var 1 owners [#412, #58, #36, #60]
var 1 fertile 0
var 1 public 1
var 33 brief "Setting messages on objects."
var 33 text ["foo"]
var 33 footnotes []
var 33 references #[]
var 33 upnode #58
var 33 subnodes []
var 33 menu #[]
var 1 inited 1
var 1 id_index 0
var 1 id 'topic_builder_messages
parent #14
object #15
var 15 location #117
var 1 child_index 0
var 1 name "generic located object"
var 1 owners [#15]
var 1 fertile 1
var 1 public 1
var 6 aliases []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 0
var 1 id 'located
method init
arg ancestors;
(> pass(ancestors) <);
if (definer() in ancestors) {
location = $sys.starting_room();
location.add_sender_to_contents();
}
.
method location
disallow_overrides;
return location;
.
method move
disallow_overrides;
arg place;
var old;
// Don't do anything if we're already here.
if (place == location) {
return;
}
if (!(place.follows('container)))
throw(~type, "Argument doesn't follow container protocol.");
// Notify involved parties of impending move, allowing them to throw
// errors.
(> .will_move(sender(), place) <);
(> location.will_leave(place) <);
(> place.will_arrive(location) <);
// Set location.
old = location;
location = place;
old.remove_sender_from_contents();
place.add_sender_to_contents();
// Notify involved parties of completed move, in reverse order.
place.did_arrive(old);
old.did_leave(place);
.did_move(sender(), old);
.
method will_move
arg mover, place;
if ((caller() != definer()) || (sender() != this()))
throw(~perm, "Invalid call to private method.");
.
method did_move
arg mover, old_place;
if ((caller() != definer()) || (sender() != this()))
throw(~perm, "Invalid call to private method.");
.
method verbs_changed_on_leaf
// This is a leaf object (it has no descendents) and the verbs on it
// changed. We must invalidate the cache on all objects for which this
// object is visible. We'll let the location handle that.
(> pass() <);
if (location.follows('room))
location.verb_changed_inside();
.
method deinit
arg ancestors;
var old;
(> pass(ancestors) <);
if (definer() in ancestors) {
old = location;
location = 0;
old.remove_sender_from_contents();
}
.
parent #15
parent #17
parent #18
object #19
var 19 gender #66
var 1 child_index 0
var 1 name "Generic person"
var 1 owners [#19, #20]
var 1 fertile 0
var 1 public 1
var 18 commands [["@gender *", 'template, 'gender_cmd]]
var 16 dependents []
var 6 aliases []
var 12 verbs #[["wh?isper * to %this", ['whisper_verb, 'noremote]]]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 0
var 17 contents []
var 15 location #111
var 1 inited 1
var 1 id 'person
method init
arg ancestors;
(> pass(ancestors) <);
if (definer() in ancestors)
gender = $gender_it;
.
method conjugate_verb
arg s;
return gender.conjugate_verb(s);
.
method set_gender
arg obj;
if ((sender() != $action_class) && (!(.is_owned_by(sender()))))
throw(~perm, "Sender is not an owner.");
if (!(obj.is($gender)))
throw(~type, "Object is not a gender pronoun repository.");
gender = obj;
.
method gender
return gender;
.
method pronouns
return gender.pronouns();
.
method whisper_verb
arg dummy1, message, dummy2, dummy3;
var actor, player;
actor = sender();
if (!(.local_to_environment(actor)))
throw(~perm, "Sender isn't in local environment.");
.tell((((actor.name()) + " whispers, \"") + message) + "\"");
actor.tell(((("You whisper \"" + message) + "\" to ") + (.name())) + ".");
.
method gender_cmd
arg dummy, new;
var genders;
genders = #[["male", $gender_male], ["female", $gender_female], ["neuter", $gender_it]];
if (!new) {
.tell(("Available genders are: " + ($list.to_english(dict_keys(genders)))) + ".");
return;
}
if (!dict_contains(genders, new)) {
.tell("Type \"@gender\" for a list of available genders.");
return;
}
.set_gender(genders[new]);
.tell(("Gender set to " + toliteral(new)) + ".");
.
parent #6
object #7
var 7 registry 0
var 7 children_registry 0
var 1 child_index 0
var 1 name "Generic registered object"
var 1 owners [#7, #20]
var 1 fertile 0
var 1 public 1
var 6 aliases []
var 1 inited 1
var 1 id 'registered
method init
arg anc;
var parent;
(> pass(anc) <);
if (definer() in anc) {
for parent in (.parents()) {
if (parent.is(definer()))
break;
}
registry = parent.children_registry();
children_registry = registry;
}
.
method registry
return registry;
.
method children_registry
return children_registry;
.
method set_registry
arg reg;
var alias;
if (!(sender() in (.parents())))
throw(~perm, "Sender not parent.");
if (registry != 0) {
registry.del(.name());
for alias in (.aliases())
registry.del(alias);
}
registry = reg;
if (registry != 0) {
(| registry.add(.name(), this()) |);
for alias in (.aliases())
(| registry.add(alias, this()) |);
}
.
method set_children_registry
arg reg;
var child;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not owner.");
children_registry = reg;
for child in (.children())
(| child.set_registry(reg) |);
.
method set_name
arg new;
var old;
if (registry == 0)
return (> pass(new) <);
old = .name();
if ((old == new) && strcmp(old, new)) {
(> pass(new) <);
return;
}
if (new in (.aliases())) {
(> pass(new) <);
(| registry.del(old) |);
return;
}
if (!(registry.is_free(new)))
throw(~perm, "Name is invalid.");
(> pass(new) <);
(| registry.del(old) |);
registry.add(new, this());
.
method add_alias
arg alias;
if (registry == 0)
return (> pass(alias) <);
if (!(registry.is_free(alias)))
throw(~perm, "Name already in use.");
(> pass(alias) <);
registry.add(alias, this());
.
method del_alias
arg alias;
(> pass(alias) <);
if (registry != 0)
registry.del(alias);
.
method deinit
arg anc;
var name;
(> pass(anc) <);
if (definer() in anc) {
if (registry == 0) {
return;
}
(| registry.del(.name()) |);
for name in (.aliases())
(| registry.del(name) |);
}
.
parent #18
object #429
var 1 child_index 0
var 1 name "features"
var 1 owners [#429, #60]
var 1 fertile 1
var 1 public 1
var 18 commands []
var 1 inited 1
var 1 id_index 0
var 1 id 'feature
parent #429
object #189
var 1 child_index 0
var 1 name "features"
var 1 owners [#189, #60]
var 1 fertile 0
var 1 public 1
var 18 commands [["!*", 'pattern, 'spoof_cmd], ["|*", 'pattern, 'quote_cmd], ["think *", 'pattern, 'think_cmd], ["<*", 'pattern, 'arrow_cmd], ["`* *", 'pattern, 'say_to_cmd], ["to * *", 'pattern, 'say_to_cmd]]
var 1 inited 1
var 1 id 'user_features
method spoof_cmd
arg s;
if (sender() != this())
throw(~perm, "Sender is not this.");
(.location()).tell_contents(s + (((.name()) in s) ? "" | (" -- " + (.name()))));
.
method quote_cmd
arg s;
if (sender() != this())
throw(~perm, "Sender is not this.");
(.location()).tell_contents(((.name()) + " | ") + s);
.
method think_cmd
arg s;
if (sender() != this())
throw(~perm, "Sender is not this.");
(.location()).tell_contents((((.name()) + " . o O ( ") + s) + " )");
.
method arrow_cmd
arg s;
if (sender() != this())
throw(~perm, "Sender is not this");
(.location()).tell_contents(((.name()) + " <- ") + s);
.
method say_to_cmd
arg who, text;
if (sender() != this())
throw(~perm, "Sender is not this.");
who = .simple_match_object(who);
if (!who) {
return;
}
(.location()).tell_contents(((((.name()) + " [to ") + (who.name())) + "]: ") + text);
.
parent #19
parent #18
parent #7
parent #189
object #20
var 20 password "*"
var 20 verb_cache 0
var 20 doing ""
var 20 connected_at 0
var 20 last_command_at 0
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 1 child_index 2
var 1 name "JoeAverage"
var 1 owners [#20, #19, #18, #7]
var 1 fertile 0
var 1 public 1
var 18 commands [["@who", 'template, 'who_cmd], ["@doing *", 'template, 'doing_cmd], ["@quit", 'template, 'quit_cmd], ["i?nventory", 'template, 'inventory_cmd], ["p?age * with *", 'template, 'page_cmd], ["sample_edit *", 'template, 'sample_edit_cmd]]
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #111
var 19 gender #66
var 1 inited 1
var 7 registry #10
var 7 children_registry #10
var 1 id_prefix 'user
var 1 id 'user
method init
arg ancestors;
(> pass(ancestors) <);
if (definer() in ancestors) {
password = "*";
verb_cache = 0;
doing = "";
connected_at = 0;
last_command_at = 0;
editor = 0;
editor_method = 0;
connections = [];
.set_proper(1);
}
.
method doing
return doing;
.
method set_doing
arg s;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender not an owner.");
if (type(s) != 'string)
throw(~type, "Argument not a string.");
doing = s;
.
method connected_at
return connected_at;
.
method last_command_at
return last_command_at;
.
method verb_changed_inside
.invalidate_verb_cache();
.
method tell
arg what;
var line, conn;
if (type(what) == 'list) {
for line in (what)
.tell(line);
} else {
for conn in (connections)
conn.tell(what);
}
.
method set_password
arg str;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender not an owner.");
password = crypt(str);
.
method check_password
arg str;
return crypt(str, substr(password, 1, 2)) == password;
.
method validate_verb_cache
var loc, objects, all_objects, obj, anc, templates;
if ((sender() != this()) || (caller() != definer()))
throw(~perm, "Sender not this.");
if (verb_cache != 0) {
return;
}
// Get a list of objects to look for verbs on.
loc = .location();
objects = ([this()] + [loc]) + (.contents());
objects = objects + setremove(loc.contents(), this());
// Now expand that list to include ancestors.
all_objects = [];
for obj in (objects) {
all_objects = setadd(all_objects, obj);
all_objects = union(all_objects, obj.ancestors());
}
// Now, for each object in that list, add all its templates to the verb
// cache.
verb_cache = [];
for obj in (all_objects) {
templates = (| obj.verb_templates() |);
if (templates)
verb_cache = union(verb_cache, templates);
}
.
method invalidate_verb_cache
verb_cache = 0;
.
method did_move
arg [args];
var loc;
(> pass(@args) <);
.invalidate_verb_cache();
loc = .location();
(| loc.look_cmd("look") |);
.
method parse
arg s;
if (!(caller().is_agent('connection)))
throw(~perm, "Sender is not an agent of connection protocol.");
// Don't let regular users see stack traces.
catch any {
last_command_at = time();
while (s && ((s[1]) == " "))
s = substr(s, 2);
if (!s) {
return;
}
return .parse_command(s);
} with handler {
.tell("Internal error processing command: " + s);
}
.
method parse_command
arg str;
var cmd, loc, result, i, j, template, word, fields, obj, verb_info;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender not an owner.");
// Are we editing?
if (editor) {
if (substr(str, 1, 1) == "<") {
str = substr(str, 2);
if (!str) {
return;
}
} else {
result = editor.handle_editor_command(str);
switch (result[1]) {
case 'not_done:
editor = result[2];
case 'abort:
editor = 0;
case 'done:
.(editor_method)(result[2]);
}
return;
}
}
// Check commands on this.
cmd = .match_command(str);
if (cmd)
return .(cmd[1])(@cmd[2]);
// Check commands on location.
loc = .location();
cmd = loc.match_command(str);
if (cmd) {
loc.(cmd[1])(@cmd[2]);
return;
}
// Resort to verb cache.
.validate_verb_cache();
catch ~nothing, ~ambiguous, ~methodnf, ~verbnf, ~objnf {
for template in (union(verb_cache, $sys.remote_verb_templates())) {
fields = match_template(strsub(template, "%this", "*"), str);
if (type(fields) != 'list)
continue;
j = 1;
for word in (explode(template)) {
if (word == "%this") {
obj = sender().match_environment(fields[j]);
verb_info = obj.verb_info(template);
if (((verb_info[2]) != 'remote) && (!(.local_to_environment(obj))))
.tell("You cannot do that from here.");
else
obj.(verb_info[1])(@fields);
return;
} else if (word == "*=*") {
j = j + 2;
} else {
j = j + 1;
}
}
}
} with handler {
switch (error()) {
case ~objnf:
.tell(("You don't see an object named \"" + error_arg()) + "\" here.");
case ~ambiguous:
.tell("That name could refer to more than one object.");
case ~verbnf:
.tell("You can't do that to that object.");
case ~methodnf:
.tell("That object cannot be manipulated.");
}
return;
}
// Try exit names.
for obj in (loc.exits()) {
if (obj.matches_exactly(str)) {
obj.go_through();
return;
}
}
// No luck.
.tell("I don't understand that.");
.
method connection_logged_in
arg addr, port;
var obj;
if (!(caller().is_agent('connection)))
throw(~perm, "Caller is not an agent of connection protocol.");
for obj in (connections) {
if (!(| valid(obj) |))
connections = setremove(connections, obj);
}
connections = connections + [sender()];
if (listlen(connections) == 1)
.login(sender());
else
.login_again(sender());
.
method connection_gone
if (caller() != $connection)
throw(~perm, "Caller is not $connection.");
connections = setremove(connections, sender());
if (!connections)
.logout();
.
method login
arg connection;
var loc;
if ((sender() != this()) || (definer() != caller()))
throw(~perm, "Invalid access to private method.");
$sys.user_logged_in();
.tell("* * * Connected * * *");
connected_at = time();
last_command_at = time();
loc = .location();
(| loc.did_connect() |);
(| loc.look_cmd("look") |);
$login_watching_features.user_connected();
.
method login_again
arg connection;
if ((sender() != this()) || (definer() != caller()))
throw(~perm, "Invalid access to private method.");
last_command_at = time();
connection.tell("* * * Already connected * * *");
.
method logout
if ((sender() != this()) || (definer() != caller()))
throw(~perm, "Invalid access to private method.");
$sys.user_logged_out();
.invalidate_verb_cache();
(| (.location()).did_disconnect() |);
$login_watching_features.user_disconnected();
.
method match_environment
arg s;
var loc, objects, obj, matches;
loc = .location();
// Handle special cases.
while (s && ((s[1]) == " "))
s = substr(s, 2);
if (!s)
throw(~nothing, "No object name specified.");
if (s == "me")
return this();
if (s == "here")
return loc;
if (s && ((s[1]) == "#")) {
obj = todbref(toint(substr(s, 2)));
if (!valid(obj))
throw(~objnf, "No such object " + s, s);
return obj;
}
if (s && ((s[1]) == "$")) {
catch ~namenf {
obj = get_name(tosym(substr(s, 2)));
} with handler {
throw(~objnf, "No object named " + s, s);
}
return obj;
}
objects = ([this()] + [loc]) + (.contents());
objects = objects + setremove(loc.contents(), this());
objects = objects + (loc.exits());
matches = [];
for obj in (objects) {
if (obj.matches(s))
matches = [@matches, obj];
}
switch (listlen(matches)) {
case 0:
throw(~objnf, ("No object " + s) + " in environment.", s);
case 1:
return matches[1];
}
throw(~ambiguous, "Ambiguous object name.", matches);
.
method local_to_environment
arg obj;
var loc;
if ((obj == this()) || (obj in (.contents())))
return 1;
loc = .location();
if ((obj == loc) || ((obj in (loc.contents())) || (obj in (loc.exits()))))
return 1;
return 0;
.
method who_cmd
arg dummy;
var user, seconds, namestr, constr, idlestr, n, doing;
if (sender() != this())
throw(~perm, "Sender not this.");
.tell("User Name On For Idle " + ($sys.doing_poll()));
for user in ($sys.connected_users()) {
namestr = pad(user.name(), 14) + " ";
// Put together the string for connect time.
seconds = time() - (user.connected_at());
if (seconds > 86400) {
constr = tostr(seconds / 86400);
constr = constr + "d";
} else {
constr = "";
}
constr = pad(constr, -3);
seconds = seconds % 86400;
constr = (constr + " ") + pad(tostr(seconds / 3600), -2, "0");
constr = (constr + ":") + pad(tostr((seconds % 3600) / 60), -2, "0");
// Put together the string for idle time.
seconds = time() - (user.last_command_at());
if (seconds > 86400)
idlestr = tostr(seconds / 86400) + "d";
else if (seconds > 3600)
idlestr = tostr(seconds / 3600) + "h";
else if (seconds > 60)
idlestr = tostr(seconds / 60) + "m";
else
idlestr = tostr(seconds) + "s";
idlestr = pad(idlestr, -3) + " ";
// Get doing and truncate if neccessary.
doing = user.doing();
if (strlen(doing) > 46)
doing = substr(doing, 1, 46);
// Display the resulting line.
.tell((((namestr + constr) + " ") + idlestr) + doing);
}
n = listlen($sys.connected_users());
if (n == 1)
.tell("One user logged in.");
else
.tell(tostr(n) + " users logged in.");
.
method doing_cmd
arg dummy, s;
if (sender() != this())
throw(~perm, "Sender not this.");
.set_doing(s);
.tell("Set.");
.
method quit_cmd
arg dummy;
if (sender() != this())
throw(~perm, "Sender not this.");
return 'disconnect;
.
method inventory_cmd
arg dummy;
var i;
if (sender() != this())
throw(~perm, "Sender not this.");
if (!(.contents())) {
.tell("You aren't carrying anything.");
return;
}
.tell("Carrying:");
for i in (.contents())
.tell(" " + (i.name()));
.
method page_cmd
arg dummy1, recipient, dummy2, message;
var user;
if (sender() != this())
throw(~perm, "Sender not this.");
catch ~keynf {
user = $user_registry.match(recipient);
if (!(user in ($sys.connected_users()))) {
.tell((user.name()) + " is not connected.");
return;
}
user.tell(((.name()) + " pages: ") + message);
.tell(((("You page \"" + message) + "\" to ") + (user.name())) + ".");
} with handler {
.tell(recipient + " is not the name of a user.");
}
.
method sample_edit_cmd
arg dummy, str;
editor = $editor_class.new([str]);
editor_method = 'sample_edit_done;
.
method sample_edit_done
arg text;
.tell("Sample edit finished:");
.tell(text);
.
method rename_verb
arg [args];
catch ~keyexists {
(> pass(@args) <);
} with handler {
switch (error()) {
case ~keyexists:
.tell("That name is in use by another player.");
default:
.tell("Sorry, you can't change your name to that.");
}
}
.
method connections
return connections;
.
method simple_match_object
arg s;
var obj;
catch ~objnf, ~ambiguous, ~nothing {
obj = .match_environment(s);
return obj;
} with handler {
switch (error()) {
case ~objnf:
.tell(("You see no object named \"" + s) + "\" here.");
case ~ambiguous:
.tell("That could refer to more than one object.");
case ~nothing:
.tell("You must type the name of some object.");
}
}
return 0;
.
method tell_file
arg s;
var conn;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
for conn in (connections)
conn.echo_file(s);
.
method full_description
var desc;
desc = [pass()];
return desc + [((($string.capitalize((.pronouns())['subject])) + " is ") + ((this() in ($sys.connected_users())) ? "awake" | "sleeping")) + "."];
.
method gc_connections
var obj;
for obj in (connections) {
if (!valid(obj))
connections = setremove(connections, obj);
}
if (!connections)
.logout();
.
method tell_lines
arg list;
var line;
for line in (list)
.tell(line);
.
parent #7
object #8
var 8 messages []
var 1 child_index 0
var 1 name "Generic collection of mail messages"
var 1 owners [#8]
var 1 fertile 0
var 1 public 1
var 6 aliases []
var 7 registry 0
var 7 children_registry #3
var 1 inited 1
var 1 id 'mail_recipient
method init
arg anc;
(> pass(anc) <);
if (definer() in anc)
messages = [];
.
method destroy
var msg;
(> pass() <);
for msg in (messages)
.remove_message(msg[1]);
.
method is_readable_by
arg who, caller;
return 1;
.
method is_writable_by
arg who, caller;
return 1;
.
method add_message
arg msg, sndrs;
var i;
if (!(.is_writable_by(sender(), caller())))
throw(~perm, "Sender can't write to this recipient");
for i in (messages) {
if (msg == (i[1]))
throw(~duplicate, "Message already in this collection.");
}
(> msg.add_recipient() <);
messages = [@messages, [msg, [sender(), @sndrs]]];
.
method remove_message
arg msg;
var i;
if (!(.is_writable_by(sender(), caller())))
throw(~perm, "Sender can't modify the recipient.");
for i in ([@messages, 0]) {
if ((!i) || ((i[1]) == msg)) {
return;
}
}
if (!i)
throw(~keynf, "Messsage isn't in the collection.");
(> msg.remove_recipient() <);
messages = setremove(messages, i);
.
method messages
if (!(.is_readable_by(sender(), caller())))
throw(~perm, "Sender can't read this recipient.");
return listlen(messages);
.
method unread
var ret, i;
if (!(.is_readable_by(sender(), caller())))
throw(~perm, "Sender can't read this recipient.");
ret = [];
for i in [1 .. listlen(messages)] {
if (!(((messages[i])[1]).is_reader(sender())))
ret = [@ret, i];
}
return ret;
.
method list_senders
arg i;
if (!(.is_readable_by(sender(), caller())))
throw(~perm, "Sender can't read this recipient.");
return (messages[i])[2];
.
method list_mail
arg i;
var msg, flds, f;
if (!(.is_readable_by(sender(), caller())))
throw(~perm, "Sender can't read this recipient.");
msg = ((messages[i])[1]).fields();
flds = #[['from, this()], ['date, 0], ['subject, "<none>"]];
for f in (dict_keys(msg)) {
catch ~keynf {
flds = dict_add(flds, f, msg[f]);
}
}
return flds;
.
method list_read
arg i;
if (!(.is_readable_by(sender(), caller())))
throw(~perm, "Sender can't read this recipient.");
return ((messages[i])[1]).read(sender());
.
method list_print
arg i;
if (!(.is_readable_by(sender(), caller())))
throw(~perm, "Sender can't read this recipient.");
return ((messages[i])[1]).print(sender());
.
parent #20
parent #8
object #21
var 1 child_index 0
var 1 name "PenPal"
var 1 owners [#21]
var 1 fertile 0
var 1 public 1
var 6 aliases []
var 7 registry #10
var 7 children_registry #10
var 8 messages []
var 18 commands [["@qsend *", 'template, 'qsend_cmd], ["@mail * on *", 'template, 'mail_cmd], ["@read * on *", 'template, 'read_cmd], ["@subscribe *", 'template, 'subscribe_cmd]]
var 16 dependents []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #111
var 19 gender #66
var 20 password "*"
var 20 verb_cache 0
var 20 doing ""
var 20 connected_at 0
var 20 last_command_at 0
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 1 inited 1
var 1 id 'mail_user
method match_mail_recipient
arg name;
return (> ((name[1]) == "*") ? $mail_recipient_registry.match(substr(name, 2)) | ($user_registry.match(name)) <);
.
method subscribe_cmd
arg dummy, list;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
catch ~keynf {
list = .match_mail_recipient(list);
} with handler {
sender.tell(("`" + list) + "' is not a valid mailing list.");
return;
}
subscribed = setadd(subscribed, list);
sender.tell("Subscribed.");
.
method mail_cmd
arg v, range, on, list;
var i, fields;
if (sender() != this())
throw(~perm, "Sender not this.");
catch ~keynf {
list = .match_mail_recipient(list);
} with handler {
sender().tell(("There is no mail recipient called `" + list) + "'.");
return;
}
if (!range) {
range = $list.range(1, list.messages());
} else if (range == "new") {
range = list.unread();
} else {
catch ~parse {
range = ($sequence_class.parse(range)).extract($integer.range(1, list.messages()));
} with handler {
sender().tell("Invalid range.");
return;
}
}
sender().tell($string.format("Messages on %s:", list.name()));
for i in (range) {
fields = list.list_mail(i);
sender().tell($string.format("%3l: %-15s [%t] %s", i, (fields['from]).name(), fields['date], fields['subject]));
}
sender().tell("---------------------------");
.
method send_message
arg msg, recipients;
var r;
if (sender() != this())
throw(~perm, "Sender not this.");
for r in (recipients)
r.add_message(msg, []);
.
method send
arg input;
var fields, r, msg, recipients;
if (sender() != this())
throw(~perm, "Sender not this.");
fields = #[['to, ""], ['cc, ""], ['bcc, ""], ['subject, ""]];
for r in (input)
fields = dict_add(fields, @r);
catch any {
fields = dict_add(fields, 'to, $list.map_on(explode(fields['to]), this(), 'match_mail_recipient));
fields = dict_add(fields, 'cc, $list.map_on(explode(fields['cc]), this(), 'match_mail_recipient));
fields = dict_add(fields, 'bcc, $list.map_on(explode(fields['bcc]), this(), 'match_mail_recipient));
} with handler {
rethrow(error());
}
if (!(fields['to]))
throw(~norecipients, "You must specify at least one primary recipient");
recipients = ((fields['to]) + (fields['cc])) + (fields['bcc]);
msg = $mail_message.spawn("");
msg.write(dict_del(fields, 'bcc));
.send_message(msg, recipients);
return recipients;
.
method please_send_mail
arg fields;
if (sender() != $mail_editor)
throw(~perm, "Sender is not the mail editor");
return (> .send(fields) <);
.
method qsend_cmd
arg v, string;
var tmp;
if (sender() != this())
throw(~perm, "Sender not this.");
tmp = $parse.options(string, #[[":to", 'to], [":cc", 'cc], [":bcc", 'bcc], [":subject", 'subject]], 'text);
tmp = dict_add(tmp, 'text, [tmp['text]]);
tmp = .send(tmp);
.tell(("Message sent to " + ($list.to_english($list.map(tmp, 'name)))) + ".");
.
method read_cmd
arg v, range, on, list;
var i;
if (sender() != this())
throw(~perm, "Sender not this.");
catch ~keynf {
list = .match_mail_recipient(list);
} with handler {
sender().tell(("There is no recipient called `" + list) + "'.");
return;
}
if ((!range) || (range == "new")) {
range = list.unread();
} else {
catch ~parse {
range = ($sequence_class.parse(range)).extract($list.range(1, list.messages()));
} with handler {
sender().tell("Invalid range.");
return;
}
}
for i in (range) {
sender().tell("From " + ($list.to_english($list.map(list.list_senders(i), 'name))));
sender().tell(list.list_print(i));
sender().tell("---------------------------");
}
sender().tell("Done reading.");
.
parent #20
parent #22
object #23
var 23 current_help #36
var 1 child_index 0
var 1 name "Clueless"
var 1 owners [#23]
var 1 fertile 0
var 1 public 1
var 22 properties #[['help_dict, #[["*", #36], ["help", #37], ["**", #104]]]]
var 18 commands [["?*", 'pattern, 'help_cmd], ["help *", 'template, 'help_cmd]]
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #111
var 19 gender #66
var 20 password "*"
var 20 verb_cache 0
var 20 doing ""
var 20 connected_at 0
var 20 last_command_at 0
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 1 inited 1
var 7 registry #10
var 7 children_registry #10
var 1 id 'help_user
method init
arg anc;
(> pass(anc) <);
if (definer() in anc)
current_help = $help_root;
.
method help_dict
return .get_property('help_dict);
.
method match_help_path
arg string;
var current, node;
current = current_help;
for node in (explode(string))
current = (> .match_help_node(node, current) <);
return current;
.
method match_help_node
arg string, current;
var node, sib, i;
switch (string) {
case ">":
node = current;
while (1) {
if (node == $help_root)
throw(~keynf, (current.name()) + " has no successor.");
sib = (node.upnode()).subnodes();
i = node in sib;
if (i && (i < listlen(sib)))
return sib[i + 1];
node = node.upnode();
}
case "<":
node = current;
while (1) {
if (node == $help_root)
throw(~keynf, (current.name()) + " has no predecessor.");
sib = (node.upnode()).subnodes();
i = node in sib;
if (i > 1)
return sib[i - 1];
node = node.upnode();
}
case "..":
if (current == $help_root)
throw(~keynf, "Top node has no supernode.");
return current.upnode();
case "?":
if (!(current.subnodes()))
return (> .match_help_node(">", current) <);
return (current.subnodes())[1];
}
catch ~keynf {
return (.get_property('help_dict))[string];
}
return (> current.match_menu(string) <);
.
method help_cmd
arg string, [rest];
if (rest)
string = rest[1];
else if (string == "help")
string = "";
catch ~range {
sender().tell((("[:" + string) + ":] ") + (current_help.footnote(toint(string))));
return;
}
catch ~keynf {
current_help = .match_help_path(string);
} with handler {
sender().tell(("No help found on " + toliteral(string)) + ".");
return;
}
sender().tell(current_help.text());
if (current_help.subnodes()) {
sender().tell(((("-----[[ `??' to read " + (((current_help.subnodes())[1]).brief())) + " (") + (((current_help.subnodes())[1]).name())) + ") ]]");
} else {
catch ~keynf {
string = .match_help_node("?", current_help);
sender().tell(((((("-----[[ `??' to read " + (string.brief())) + " (") + ($list.to_string($list.map(string.path(), 'name), " "))) + " ") + (string.name())) + ") ]]");
} with handler {
sender().tell("-----[[ Last node. `?*' to return to the top. ]]");
}
}
.
parent #21
parent #23
object #24
var 24 owned_objects [#24]
var 24 editors [#78]
var 24 editor 0
var 1 child_index 0
var 1 name "BuilderBob"
var 1 owners [#24]
var 1 fertile 1
var 1 public 1
var 22 properties #[['help_dict, #[["*", #36], ["help", #37], ["**", #104], ["@", #58]]]]
var 18 commands [["@dig * to *", 'template, 'dig_to_cmd], ["@dig *", 'template, 'dig_cmd], ["@owned *", 'template, 'owned_cmd], ["@edit *", 'template, 'edit_cmd], ["@create *", 'template, 'create_cmd], ["@create * named *", 'template, 'create_named_cmd], ["@mes?sages *", 'template, 'messages_cmd], ["@set * to *", 'template, 'set_cmd], ["@clear *", 'template, 'clear_cmd], ["@db?size", 'template, 'dbsize_cmd], ["@but * for * is *", 'template, 'but_cmd]]
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #111
var 19 gender #66
var 20 password "*"
var 20 verb_cache 0
var 20 doing ""
var 20 connected_at 0
var 20 last_command_at 0
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 23 current_help #36
var 7 registry #10
var 7 children_registry #10
var 8 messages []
var 1 inited 1
var 1 id_prefix 'builder
var 1 id 'builder
method init
arg ancestors;
(> pass(ancestors) <);
if (definer() in ancestors) {
owned_objects = [];
editors = [];
}
.
method create_cmd
arg dummy, parents;
var i, parents, obj;
parents = explode(parents, ",");
catch ~match, ~objnf {
for i in [1 .. listlen(parents)]
parents = replace(parents, n, .match_environment(parents[n]));
} with handler {
.match_result(error_str(), error_arg());
}
new = (parents[1]).spawn("");
for obj in (sublist(parents, 2))
new.add_parent(obj);
.tell((("Created object " + toliteral(new)) + " with parents: ") + ($list.english_object_list(parents)));
.
method match_result
arg objstr, error, errorarg;
while (objstr && ((objstr[1]) == " "))
objstr = substr(objstr, 2);
if (objstr && (((objstr[1]) == "$") && (error == ~objnf))) {
.tell(("\"" + objstr) + "\" is an invalid object.");
return;
}
pass(objstr, error, errorarg);
.
method owned_objects
return owned_objects;
.
method add_owned
arg obj;
if (!((.is_owned_by(sender())) || (caller() == $root)))
throw(~perm, "Caller is not $root and sender is not owner.");
owned_objects = setadd(owned_objects, obj);
.
method remove_owned
arg obj;
if (!((.is_owned_by(sender())) || (caller() == $root)))
throw(~perm, "Caller is not $root and sender is not owner.");
owned_objects = setremove(owned_objects, obj);
.
method owned_cmd
arg dummy, who;
var obj, totalbytes;
if (who) {
catch ~keynf {
who = $user_registry.match(who);
} with handler {
.tell(("I don't know who " + toliteral(who)) + " is.");
return;
}
} else {
who = this();
}
.tell(((("Objects owned by " + (who.name())) + " (") + (who.id_str())) + "):");
.tell("");
for obj in (who.owned_objects()) {
.tell((((((listlen(obj.owners()) > 2) ? "* " | " ") + pad(obj.name_and_id(), 40)) + " (size: ") + (obj.size_str())) + ")");
totalbytes = totalbytes + (obj.size());
}
.tell(((((tostr(totalbytes) + " bytes used in ") + tostr(listlen(who.owned_objects()))) + " object") + ((listlen(who.owned_objects()) == 1) ? "" | "s")) + ".");
.
method dig_cmd
arg dummy1, name;
var room;
room = $room.spawn(name);
.tell(("Created new room " + (room.id_str())) + ".");
.
method dig_to_cmd
arg dummy1, exitname, dummy2, roomname;
var room, exit, aliases, alias;
if (roomname && ((roomname[1]) == "$")) {
room = (| get_name(tosym(substr(roomname, 2))) |);
if (!room) {
.tell("Sorry, can't find that object.");
return;
}
} else {
room = $room.spawn(roomname);
.tell(("Created new room " + (room.id_str())) + ".");
}
exitname = explode(exitname, ",");
aliases = sublist(exitname, 2);
exit = $exit.spawn(exitname[1]);
for alias in (aliases)
exit.add_alias(alias);
catch ~perm {
exit.attach(.location());
exit.link(room);
} with handler {
exit.destroy();
.tell(("Couldn't make exit from here to " + (room.id_str())) + ": Permission denied.");
return;
}
.tell(((("Created exit " + (exit.name_and_id())) + " to room ") + (room.name_and_id())) + ".");
.
method editors
return editors;
.
method all_editors
var p, r, t;
r = .editors();
for p in (.parents()) {
t = (| p.all_editors() |);
if (t)
r = r + t;
if (p == $builder)
break;
}
return r;
.
method add_editor
arg editor1;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
if ((!(> valid(editor1) <)) || (!(editor1.is($editor_class))))
throw(~type, "Must be a valid editor object.");
if (!(editor1 in (.all_editors())))
editors = [editor1] + editors;
.
method remove_editor
arg editor1;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
editors = setremove(editors, editor1);
.
method editor
if ((editor == 0) || (!valid(editor))) {
.tell("[creating an editor]");
editor = $editor.spawn_editor();
}
return editor;
.
method edit_cmd
arg dummy, argstr;
var editor1;
if (sender() != this())
throw(~perm, "Sender is not this().");
for editor1 in (.all_editors()) {
if (editor1.is_invoke(argstr)) {
(.editor()).suck_in_sender();
(.editor()).new_session(editor1.parse_invoke(this(), argstr));
return;
}
}
.tell("I don't know what you want to edit.");
.
method messages_cmd
arg dummy, obj;
var msg, messages;
if (sender() != this())
throw(~perm, "Sender is not this.");
obj = .simple_match_object(obj);
if (!obj) {
return;
}
messages = (| obj.messages() |);
if (!messages) {
.tell("That object has no settable messages.");
return;
}
.tell(("Messages for " + (obj.name_and_id())) + ":");
for msg in (messages)
.tell(((tostr(msg) + " is set to ") + ((obj.get_message(msg)).translate())) + ".");
.
method set_cmd
arg cmd, spec, prep, value;
var object, message;
if (sender() != this())
throw(~perm, "Sender is not this.");
if ((!("/" in spec)) || (!value)) {
.tell("Usage: @set <object>/<message> to <text>");
return;
}
spec = explode(spec, "/");
object = spec[1];
message = spec[2];
object = .simple_match_object(object);
if (!object) {
return;
}
catch ~keynf, ~methodnf, ~perm {
object.set_message(tosym(message), $action_class.new(value));
} with handler {
switch (error()) {
case ~keynf:
.tell((((object.name_and_id()) + " has no message named \"") + message) + "\".");
case ~methodnf:
.tell((object.name_and_id()) + " has no settable messages.");
case ~perm:
.tell("Permission denied.");
}
return;
}
.tell("Message set to: " + value);
.
method clear_cmd
arg verb, spec;
var object, message;
if (sender() != this())
throw(~perm, "Sender is not this.");
if (!("/" in spec)) {
.tell("Usage: @clear <object>/<message>");
return;
}
spec = explode(spec, "/");
object = .simple_match_object(spec[1]);
if (!object) {
return;
}
message = spec[2];
catch ~keynf, ~methodnf, ~perm {
object.clear_message(tosym(message));
.tell((("Message " + message) + " cleared, value now is: ") + ((object.get_message(tosym(message))).translate()));
} with handler {
switch (error()) {
case ~keynf:
.tell((((object.name_and_id()) + " has no message named \"") + message) + "\".");
case ~methodnf:
.tell((object.name_and_id()) + " has no settable messages.");
case ~perm:
.tell("Permission denied.");
}
}
.
method but_cmd
arg verb, spec, prep1, who, prep2, text;
var object, message, current_message, people;
people = ["actor", "victim", "world"];
if (sender() != this())
throw(~perm, "Sender is not this.");
if ((!text) || (!("/" in spec))) {
.tell("Usage: @but <object>/<message> for <who> is <message>");
return;
}
spec = explode(spec, "/");
object = .simple_match_object(spec[1]);
if (!object) {
return;
}
message = spec[2];
if (!(who in people)) {
.tell(("You must specify " + ($list.to_english(people, "foo", "or"))) + " for who.");
return;
}
who = tosym(who);
catch ~keynf, ~perm, ~methodnf {
current_message = object.get_message(tosym(message));
if (text == "0")
text = 0;
object.set_message(tosym(message), current_message.but(who, text));
.tell((((("Message " + message) + " on ") + (object.name_and_id())) + " is now: ") + ((object.get_message(tosym(message))).translate()));
} with handler {
switch (error()) {
case ~keynf:
.tell((((object.name_and_id()) + " has no message named \"") + message) + "\".");
case ~methodnf:
.tell((object.name_and_id()) + " has no settable messages.");
case ~perm:
.tell("Permission denied.");
}
}
.
method gc_owned
var obj;
for obj in (owned_objects) {
if (!valid(obj))
owned_objects = setremove(owned_objects, obj);
}
.
method dbsize_cmd
arg verb;
var obj, valid;
if (sender() != this())
throw(~perm, "Sender is not this.");
for obj in [0 .. toint(db_top()) - 1] {
obj = todbref(obj);
if (!valid(obj))
continue;
valid = valid + 1;
}
.tell(((tostr(valid) + " valid objects out of a total of ") + tostr(toint(db_top()) - 1)) + " objects.");
.
parent #429
object #238
var 1 child_index 0
var 1 name "cruft"
var 1 owners [#238, #60]
var 1 fertile 1
var 1 public 1
var 18 commands [["#*", 'pattern, 'match_cmd]]
var 1 inited 1
var 1 id 'programmer_features
method match_cmd
arg obj;
if (sender() != this())
throw(~perm, "Sender is not this.");
obj = .simple_match_object(obj);
if (!obj) {
return;
}
.tell((((obj.name()) + " (") + (obj.id_str())) + ")");
.
parent #24
parent #238
object #25
var 25 programming 0
var 25 program_buf 0
var 1 child_index 26
var 1 name "Hacker"
var 1 owners [#25]
var 1 fertile 1
var 1 public 1
var 22 properties #[['help_dict, #[["*", #36], ["help", #37], ["**", #104], ["@", #58], [";", #51]]]]
var 18 commands [[";*", 'pattern, 'eval_cmd], ["@show *", 'template, 'show_cmd], ["@methods *", 'template, 'methods_cmd], ["@list *", 'template, 'list_cmd], ["@kids|@children *", 'template, 'kids_cmd], ["@descendents *", 'template, 'descendents_cmd], ["@parent?s *", 'template, 'parents_cmd], ["@d?isplay *", 'template, 'display_cmd], ["@program *", 'template, 'program_cmd], ["@com?mands", 'template, 'commands_cmd]]
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #111
var 19 gender #66
var 20 password "*"
var 20 verb_cache 0
var 20 doing ""
var 20 connected_at 0
var 20 last_command_at 0
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 23 current_help #36
var 7 registry #10
var 7 children_registry #10
var 8 messages []
var 24 owned_objects [#25]
var 24 editors [#79]
var 1 inited 1
var 1 id_prefix 'user
var 1 id 'programmer
var 1 id_index 0
method init
arg ancestors;
(> pass(ancestors) <);
if (definer() in ancestors) {
programming = 0;
program_buf = 0;
}
.
method please_compile
arg code, name, object;
if (sender() != $method_editor)
throw(~perm, "Sender is not method editor");
return (> object.compile(code, name) <);
.
method parse_command
arg str;
var err;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender not an owner.");
// Catch errors and display a stack trace.
catch any {
if (programming)
.programming_line(str);
else
return pass(str);
} with handler {
// Don't go through potentially buggy .tell().
for err in (traceback())
.tell(err);
}
.
method programming_line
arg str;
if ((sender() != this()) || (caller() != definer()))
throw(~perm, "Sender not this.");
if (str == ".")
.program_done();
else if (programming != 'ignore)
program_buf = program_buf + [str];
.
method program_done
var errors;
if ((sender() != this()) || (caller() != definer()))
throw(~perm, "Sender not this.");
if (programming == 'ignore) {
.tell("Finished ignoring input.");
} else {
catch ~perm {
errors = (programming[1]).compile(program_buf, programming[2]);
if (errors)
.tell(errors);
else
.tell("Method compiled.");
} with handler {
.tell("You cannot program that object.");
}
}
programming = 0;
program_buf = 0;
.
method logout
(> pass() <);
programming = 'ignore;
.program_done();
.
method eval_cmd
arg s;
var errors, result;
if (sender() != this())
throw(~perm, "Sender not this.");
// Compile the line.
if (s && ((s[1]) == ";"))
errors = compile([substr(s, 2)], 'tmp_eval);
else
errors = compile([("var me, here; me = this(); here = this().location(); return " + s) + ";"], 'tmp_eval);
// Stop if there were errors.
if (errors) {
.tell(errors);
return;
}
// Evaluate the expression. Be sure to remove it afterwards, so that no
// one else can call it.
catch any {
result = .tmp_eval();
} with handler {
del_method('tmp_eval);
rethrow(~methoderr);
}
del_method('tmp_eval);
if ((!s) || ((s[1]) != ";"))
.tell("=> " + ($data.unparse(result)));
.
method program_cmd
arg dummy, spec;
var name, obj;
if (sender() != this())
throw(~perm, "Sender not this.");
spec = $parse.methodref(spec);
if (!(spec[2])) {
.tell("Usage: @program <object>.<method>");
return;
}
name = spec[2];
// Find the object to program.
catch ~objnf {
obj = .match_environment(spec[1]);
} with handler {
.match_result(spec[1], error(), error_arg());
return;
}
if (!(obj.is_owned_by(this()))) {
.tell("You can't program that object; ignoring text.");
programming = 'ignore;
return;
}
programming = [obj, tosym(name)];
program_buf = [];
.tell(("Enter text for method " + name) + ".");
.
method display_cmd
arg dummy, object;
var out;
object = .simple_match_object(object);
if (!object) {
return;
}
catch ~perm {
out = ["Object: " + toliteral(object)];
out = out + ["Name: " + (object.name())];
out = out + ["Size: " + tostr(object.size())];
out = out + ["Owners: " + ($list.english_object_list(object.owners()))];
out = out + ["Parents: " + ($list.english_object_list(object.parents()))];
out = out + ["Methods:", @$list.columnize($list.map_tostr(object.methods()), 2)];
} with handler {
.tell("Permission denied.");
}
.tell(out);
.
method show_cmd
arg dummy, object;
if (sender() != this())
throw(~perm, "Sender is not this.");
object = .simple_match_object(object);
if (!object) {
return;
}
.tell(object.show());
.
method methods_cmd
arg dummy, object;
var methods, line;
if (sender() != this())
throw(~perm, "Sender is not this.");
object = .simple_match_object(object);
if (!object)
return 0;
if (!(object.methods())) {
.tell((((object.name()) + " (") + (object.id_str())) + ") has no methods.");
return;
}
.tell(((("Methods on " + (object.name())) + " (") + (object.id_str())) + "):");
methods = $list.sort($list.map_tostr(object.methods()));
methods = $list.columnize(methods, 3, " ", 76);
for line in (methods)
.tell(" " + line);
.
method list_cmd
arg dummy, argstr;
var spec, object, method, lineno, line;
spec = $parse.methodref(argstr);
if ((!argstr) || (!(spec[2]))) {
.tell("Usage: @list <object>.<method>");
return;
}
object = .simple_match_object(spec[1]);
if (!object) {
return;
}
method = tosym(spec[2]);
catch ~methodnf {
.tell(("Method is defined on " + ((object.find_method(method)).id_str())) + ":");
for line in ((object.find_method(method)).list_method(method)) {
lineno = lineno + 1;
.tell((pad(tostr(lineno), -3) + ": ") + line);
}
} with handler {
.tell("Method not found.");
}
.
method kids_cmd
arg dummy, object;
object = .simple_match_object(object);
if (!object) {
return;
}
if (!(object.children())) {
.tell((object.name_and_id()) + " has no children.");
return;
}
.tell($list.to_string($list.map(object.children(), 'name_and_id), " "));
.
method descendents_cmd
arg dummy, object;
catch ~objnf {
object = .match_environment(object);
.tell(((";" + toliteral(object)) + ".descendents() => ") + toliteral(object.children()));
} with handler {
.tell("I don't see that here.");
}
.
method parents_cmd
arg dummy, object;
var out, parent;
object = .simple_match_object(object);
if (!object) {
return;
}
if (!(object.parents())) {
.tell((((object.name()) + " (") + (object.id_str())) + ") has no parents.");
return;
}
out = [];
for parent in (object.parents())
out = out + [(((parent.name()) + " (") + (parent.id_str())) + ")"];
.tell($list.to_string(out, " "));
.
method commands_cmd
arg dummy;
.tell("Commands:");
.tell($list.columnize($list.sort($list.slice(.all_commands(), 1)), 3));
.
parent #429
object #190
var 1 child_index 0
var 1 name "antisocial"
var 1 owners [#190, #60, #137]
var 1 fertile 1
var 1 public 1
var 18 commands [["eye *", 'pattern, 'eye_cmd], ["kill *", 'pattern, 'kill_cmd]]
var 1 inited 1
var 1 id 'antisocial
method eye_cmd
arg who;
if (sender() != this())
throw(~perm, "Sender is not this.");
who = .simple_match_object(who);
if (!who) {
return;
}
(.get('eye)).announce(this(), 0, who);
.
method kill_cmd
arg who;
if (sender() != this())
throw(~perm, "Sender is not this.");
who = .simple_match_object(who);
if (!who) {
return;
}
(.get('kill)).announce(this(), 0, who);
.
method get
arg msg;
return $antisocial_db.get_action(msg);
.
parent #25
parent #190
object #273
var 1 child_index 0
var 1 name "Xythian"
var 1 owners [#273]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 22 properties #[]
var 6 aliases []
var 7 registry #10
var 7 children_registry #10
var 16 dependents []
var 12 verbs #[]
var 13 description "Not you."
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #106
var 19 gender #87
var 20 password "W)1HWTihn5KFM"
var 20 verb_cache 0
var 20 doing "KILLING PEOPLE THAT ANNOY ME"
var 20 connected_at 757296550
var 20 last_command_at 757297613
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 23 current_help #88
var 8 messages []
var 24 owned_objects [#273]
var 24 editors []
var 25 programming 0
var 25 program_buf 0
var 1 inited 1
var 1 id_index 0
var 1 id 'user_xythian
parent #25
parent #190
object #270
var 1 child_index 0
var 1 name "Terry"
var 1 owners [#270]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 22 properties #[]
var 6 aliases []
var 7 registry #10
var 7 children_registry #10
var 16 dependents []
var 12 verbs #[]
var 13 description "\"The same but a bit different.\""
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #106
var 19 gender #87
var 20 password "&3Fhizx3O7DC2"
var 20 verb_cache 0
var 20 doing "wondering what he was doing ten years ago"
var 20 connected_at 757481724
var 20 last_command_at 757481796
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 23 current_help #58
var 8 messages []
var 24 owned_objects [#275, #270]
var 24 editors []
var 25 programming 0
var 25 program_buf 0
var 1 inited 1
var 1 id_index 0
var 1 id 'user_terry
var 24 editor #275
parent #25
parent #190
object #267
var 1 child_index 0
var 1 name "Zippy"
var 1 owners [#267]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 22 properties #[]
var 6 aliases []
var 7 registry #10
var 7 children_registry #10
var 16 dependents []
var 12 verbs #[]
var 13 description "a pathetic fucking loser who wishes you would just die."
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #106
var 19 gender #87
var 20 password "8VA2LxUVBvAkQ"
var 20 verb_cache 0
var 20 doing "to get a new @doing poll already"
var 20 connected_at 757233590
var 20 last_command_at 757233873
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 23 current_help #36
var 8 messages []
var 24 owned_objects [#267]
var 24 editors []
var 25 programming 0
var 25 program_buf 0
var 1 inited 1
var 1 id_index 0
var 1 id 'user_zippy1
parent #40
object #41
var 41 text []
var 41 insertion_point 1
var 41 changed 0
var 41 return_to 0
var 41 session 0
var 41 sessions []
var 1 child_index 9
var 1 name "Generic Editor"
var 1 owners [#41]
var 1 fertile 0
var 1 public 1
var 18 commands [["li?st", 'template, 'list_cmd], ["li?st *", 'template, 'list_cmd], ["del?ete *", 'template, 'delete_cmd], ["make", 'template, 'make_cmd], ["ins?ert *", 'template, 'insert_cmd], ["clear", 'template, 'clear_cmd], ["quit", 'template, 'quit_cmd], ["what", 'template, 'what_cmd], ["sessions", 'template, 'sessions_cmd], ["switch *", 'template, 'switch_cmd], ["clear all", 'pattern, 'clear_all_cmd]]
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 0
var 17 contents []
var 40 exits []
var 40 dark 0
var 40 link_ok 0
var 1 inited 1
var 1 id 'editor
var 1 id_prefix 'editor
method init
arg ancestors;
(> pass(ancestors) <);
if (definer() in ancestors) {
text = [];
insertion_point = 1;
changed = 0;
session = 0;
sessions = [];
.set_description("Type `quit' to exit. Type `make' to execute your buffer. For more documentation, scream at Galin or an admin.");
}
.
method accept_owner
arg who;
if (caller() != $editor)
throw(~putz, "Permission denied for private method.");
.add_owner(who);
.
method spawn_editor
var editr;
if (caller() != $builder)
throw(~putz, "Go away.");
editr = .spawn((sender().name()) + "'s Editor.", tosym(sender().name()));
editr.del_owner(this());
editr.accept_owner(sender());
return editr;
.
method parse_range
arg range;
var result, start, end;
result = match_pattern("*-*", range);
if (result) {
start = .parse_number(result[1]);
end = .parse_number(result[2]);
if (start && end)
return [start, (end - start) + 1];
else
return 0;
}
start = .parse_number(range);
if (start)
return [start, 1];
else
return 0;
.
method parse_number
arg str;
var result;
if (str == "$")
return listlen(text);
if ($string.is_numeric(str)) {
result = toint(str);
if ((result > listlen(text)) || (result < 1))
return 0;
return result;
}
.
method insert_line
arg str;
if (sender() != this())
throw(~putz, "Go away.");
text = insert(text, insertion_point, str);
changed = 1;
.
method append_line
arg str;
if (sender() != this())
throw(~putz, "Go away.");
text = replace(text, insertion_point - 1, (text[insertion_point - 1]) + str);
changed = 1;
.
method delete_range
arg range;
var idx, end, r;
if (sender() != this())
throw(~putz, "Go away.");
idx = range[1];
end = idx + (range[2]);
r = sublist(text, range[1], range[2]);
while (idx != end) {
text = delete(text, range[1]);
idx = idx + 1;
}
changed = 1;
return r;
.
method say_cmd
arg s;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
.insert_line(s);
sender().tell(("Line " + tostr(insertion_point)) + " added.");
insertion_point = insertion_point + 1;
.
method pose_cmd
arg s;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
.append_line(s);
sender().tell(("Appened to line " + tostr(insertion_point)) + ".");
.
method list_cmd
arg [args];
var count, line, range;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
range = .parse_range((listlen(args) == 2) ? args[2] | "1-$");
if (!range) {
if (listlen(args) != 2)
sender().tell("There is no text. Insertion point is at 1.");
else
sender().tell(("Invalid range: \"" + (args[2])) + "\".");
return;
}
count = range[1];
for line in (sublist(text, range[1], range[2])) {
sender().tell((pad(tostr(count), -2) + ": ") + line);
count = count + 1;
}
sender().tell(("Insertion point is at " + tostr(insertion_point)) + ".");
.
method delete_cmd
arg dummy, ranges;
var range, lines;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
range = .parse_range(ranges);
if (!range) {
sender().tell(("Invalid range: \"" + ranges) + "\".");
return;
}
lines = .delete_range(range);
insertion_point = range[1];
sender().tell(lines);
sender().tell(("Deleted. Insertion point is before " + tostr(range[1])) + ".");
.
method suck_in_sender
var where;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
where = sender().location();
if (where != this()) {
return_to = where;
where.tell_contents((sender().name()) + " leaves for the editor.", sender());
sender().move(this());
}
.
method insert_cmd
arg dummy, linestr;
var line;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
line = .parse_number(linestr);
if (!line) {
sender().tell("Line out of range.");
return;
}
sender().tell("Set.");
insertion_point = (linestr == "$") ? line + 1 | line;
.
method make_cmd
arg dummy;
var r;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
if (!session) {
sender().tell("You have no session type.");
} else {
session = session.set_text(text);
r = session.make();
if (r[1])
changed = 0;
sender().tell(r[2]);
}
.
method clear_cmd
arg dummy;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
.reset_session();
sender().tell("This session has been cleared.");
.
method reset_session
if (sender() != this())
throw(~putz, "Go away.");
session = 0;
text = [];
changed = 0;
insertion_point = 1;
.
method save_session
if (sender() != this())
throw(~putz, "Go away.");
session = session.set_text(text);
sessions = [@sessions, session];
.
method load_session
arg sess;
if (sender() != this())
throw(~putz, "Go away.");
.reset_session();
session = sess;
text = sess.text();
changed = 1;
.
method sessions_cmd
arg dummy;
var n, sess;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
for n in [1 .. listlen(sessions)] {
sess = sessions[n];
sender().tell(((((pad(tostr(n), -2) + ": ") + (sess.describe_session())) + " (") + tostr(listlen(sess.text()))) + " lines)");
}
.
method switch_cmd
arg dummy, sstr;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
if (!($string.is_numeric(sstr))) {
sender().tell(("\"" + sstr) + "\" is not a number.");
return;
}
sstr = toint(sstr);
if (changed) {
.save_session();
sender().tell("[swapping]");
}
.load_session(sessions[sstr]);
sender().tell(("Now editing " + (session.describe_session())) + ".");
.
method new_session
arg frob;
// should add typechecking
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
if (changed)
.save_session();
.reset_session();
session = frob;
text = frob.text();
insertion_point = listlen(text) + 1;
sender().tell(("Now editing " + (frob.describe_session())) + ".");
.
method what_cmd
arg dummy;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
sender().tell(("Editing " + (session.describe_session())) + ".");
if (changed)
sender().tell("There have been changes in this session.");
.
method quit_cmd
arg dummy;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
return_to.tell_contents((sender().name()) + " returns from the editor.", sender());
sender().move(return_to);
.
method clear_all_cmd
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
.reset_session();
sessions = [];
sender().tell("All sessions have been cleared.");
.
parent #41
object #236
var 1 child_index 0
var 1 name "Chaos's Editor."
var 1 owners [#236, #41, #101]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "Type `quit' to exit. Type `make' to execute your buffer. For more documentation, scream at Galin or an admin."
var 14 unique 0
var 14 proper 0
var 17 contents []
var 40 exits []
var 40 dark 0
var 40 link_ok 0
var 41 text ["arg who, caller;", "", "return .is_owned_by(who) || caller == $registered;"]
var 41 insertion_point 4
var 41 changed 0
var 41 session <#79, #[['user, #101], ['object, #2], ['method, 'is_writable_by], ['text, ["arg who, caller;", "", "return .is_owned_by(who) || caller == $registered;"]]]>
var 41 sessions []
var 1 inited 1
var 1 id 'editor_chaos
var 41 return_to #44
parent #40
object #170
var 1 child_index 0
var 1 name "Neosubterrainianweirdtwistedpostsuburbia Cafe"
var 1 owners [#170, #60]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "The cafe is small and dark. The walls and ceilings were once white but are now discolored from the smoke in the air. The floor is tiled, and surprisingly clean, but you realize that its easier to clean the floors than the ceilings."
var 14 unique 0
var 14 proper 0
var 17 contents []
var 40 exits [#461]
var 40 dark 0
var 40 link_ok 0
var 1 inited 1
var 1 id 'room_neocafe
parent #15
object #69
var 1 child_index 2
var 1 name "Generic thing"
var 1 owners [#69]
var 1 fertile 1
var 1 public 1
var 6 aliases []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 0
var 15 location #111
var 1 inited 1
var 1 id_prefix 'thing
var 1 id_index 0
var 1 id 'thing
parent #69
object #130
var 1 child_index 0
var 1 name "eye"
var 1 owners [#130, #81]
var 1 fertile 0
var 1 public 1
var 6 aliases []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 0
var 15 location #106
var 1 inited 1
var 130 know 0
var 1 id 'obj_eye
method tell
arg what;
var dummy, name, desc;
dummy = match_pattern("* says, *", what);
name = dummy[1];
if (name) {
if (!(know[name])) {
desc = (sender().match_environment(name)).full_description();
dict_add(know, name, desc);
}
}
dummy = match_pattern("* says*Eye, who is *?", what);
name = dummy[3];
if (name) {
if (know[name]) {
(.location()).tell_contents(name + "'s description was last:");
(.location()).tell_contents(desc);
} else {
(.location()).tell_contents("The eye does not know that person.");
}
}
.
parent #33
object #104
var 1 child_index 0
var 1 name "USER"
var 1 owners [#104]
var 1 fertile 0
var 1 public 1
var 33 brief "Help for users"
var 33 text ["Sorry, no help yet."]
var 33 footnotes []
var 33 references #[]
var 33 upnode #36
var 33 subnodes []
var 33 menu #[]
var 1 inited 1
var 1 id_index 0
var 1 id 'topic_users
parent #25
object #96
var 1 child_index 0
var 1 name "Keelah"
var 1 owners [#96]
var 1 fertile 0
var 1 public 1
var 22 properties #[]
var 6 aliases []
var 7 registry #10
var 7 children_registry #10
var 18 commands []
var 16 dependents []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #106
var 19 gender #66
var 20 password "l3KcZp9hqbd4Q"
var 20 verb_cache 0
var 20 doing ""
var 20 connected_at 756862043
var 20 last_command_at 756867425
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 23 current_help #36
var 8 messages []
var 24 owned_objects [#96]
var 24 editors []
var 25 programming 0
var 25 program_buf 0
var 1 inited 1
var 1 id 'user_keelah
var 1 id_index 0
parent #1
object #4
var 1 name "frob class"
var 1 id 'frob_class
var 1 fertile 1
var 1 public 1
method unparse
arg rep;
return ((("<" + ($data.unparse(this()))) + ", ") + ($data.unparse(rep))) + ">";
.
parent #4
object #80
var 1 child_index 0
var 1 name "Message Frob Class"
var 1 owners [#80]
var 1 fertile 0
var 1 public 1
var 1 inited 1
var 1 id 'message_class
method parse
arg s;
return <this(), #[['message, s]]>;
.
method announce
arg rep, actor, [rest];
(actor.location()).tell_contents(rep['text]);
.
parent #80
object #93
var 1 child_index 0
var 1 name "pronoun substition message class frob"
var 1 owners [#93]
var 1 fertile 0
var 1 public 1
var 1 inited 1
var 1 id 'pronoun_class
var 93 specifiers #[['full_name, "n"], ['definite_name, "d"], ['indefinite_name, "i"], ['reflexive, "r"], ['subject, "s"], ['object, "o"], ['possessive_adj, "p"], ['possessive_noun, "q"], ['base_name, "n"]]
method parse
arg s;
var lst, idx, who, what, ts, verbstr;
lst = [];
while (1) {
idx = "%" in s;
if (!idx)
break;
if ((s[idx + 1]) == "%") {
lst = [@lst, substr(s, 1, idx)];
s = substr(s, idx + 2);
break;
}
ts = substr(s, 1, idx - 1);
if (ts)
lst = [@lst, ts];
s = substr(s, idx + 1);
switch (s[1]) {
case "a":
who = 'actor;
case "t":
who = 'thing;
case "v":
who = 'victim;
default:
if ((s[1]) in "123456789")
who = tosym("arg_" + tostr(s[1]));
else
throw(~parse, toliteral(s[1]) + " is not a valid object specifier.");
}
s = substr(s, 2);
if ((s[1]) == ":") {
what = 'verb;
verbstr = (> .parse_verb(substr(s, 2)) <);
s = verbstr[2];
lst = [@lst, [who, what, 0, verbstr[1]]];
continue;
}
switch (s[1]) {
case "a":
if (who in ['actor, 'victim, 'thing])
throw(~parse, "Invalid object for arg specifier.");
what = 'arg;
case "d":
what = 'definite_name;
case "i":
what = 'indefinite_name;
case "n":
what = 'full_name;
case "p":
what = 'possessive_adj;
case "q":
what = 'possessive_noun;
case "r":
what = 'reflexive;
case "s":
what = 'subject;
case "o":
what = 'object;
default:
throw(~parse, "Invalid specifier.");
}
lst = [@lst, [who, what, !strcmp(uppercase(s[1]), s[1])]];
s = substr(s, 2);
}
return <this(), [@lst, s]>;
.
method parse_verb
arg s;
var idx, verbstr;
if ((s[1]) != "(")
throw(~parse, "Missing '(' after verb specifier.");
s = substr(s, 2);
idx = ")" in s;
if (!idx)
throw(~parse, "Missing ')' after verb specifier.");
verbstr = substr(s, 1, idx - 1);
if (" " in verbstr)
throw(~parse, "No spaces are allowed in verb specifiers.");
s = substr(s, idx + 1);
return [verbstr, s];
.
method format
arg rep, actor, [rest];
var el, thing, victim, who, s, ins;
thing = [@rest, 0][1];
victim = [@rest, 0, 0][2];
s = "";
for el in (rep) {
if (type(el) == 'string) {
s = s + el;
} else {
switch (el[1]) {
case 'actor:
who = actor;
case 'thing:
if (!thing)
throw(~invalid, "No thing object provided.");
who = thing;
case 'victim:
if (!victim)
throw(~invalid, "No victim object provided.");
who = victim;
}
switch (el[2]) {
case 'full_name:
ins = who.base_name();
case 'base_name:
ins = who.base_name();
case 'definite_name:
ins = who.definite_name();
case 'indefinite_name:
ins = who.indefinite_name();
case 'verb:
ins = (| who.conjugate_verb(el[4]) |) || ($gender_it.conjugate_verb(el[4]));
default:
ins = (| (who.pronouns())[el[2]] |) || (($gender_it.pronouns())[el[2]]);
}
s = s + ((el[3]) ? $string.capitalize(ins) | ins);
}
}
return s;
.
method reflexive
arg rep;
var r, el, seen_once;
r = [];
for el in (rep) {
if (type(el) == 'string) {
r = [@r, el];
continue;
}
if ((el[1]) == 'thing) {
r = [@r, el];
continue;
}
if (!seen_once) {
seen_once = 1;
r = [@r, el];
continue;
}
if ((el[2]) == 'verb) {
r = [@r, replace(el, 1, 'actor)];
continue;
}
if ((el[3]) == 0)
r = [@r, ['actor, 'reflexive, el[3]]];
else
r = [@r, ['actor, 'base_name, el[3]]];
}
return <this(), r>;
.
method set_specifiers
specifiers = #[['full_name, "n"], ['definite_name, "d"], ['indefinite_name, "i"], ['reflexive, "r"], ['subject, "s"], ['object, "o"], ['possessive_adj, "p"], ['possessive_noun, "q"]];
specifiers = dict_add(specifiers, 'base_name, "n");
.
method translate
arg rep;
var s, o;
s = "";
for o in (rep) {
if (type(o) == 'string) {
s = s + o;
} else {
switch (o[1]) {
case 'actor:
s = s + "%a";
case 'thing:
s = s + "%t";
case 'victim:
s = s + "%v";
}
if ((o[2]) == 'verb) {
s = ((s + ":(") + (o[4])) + ")";
continue;
}
s = s + ((o[3]) ? uppercase(specifiers[o[2]]) | (specifiers[o[2]]));
}
}
return s;
.
parent #1
object #52
var 52 pronouns #[]
var 52 exceptions #[]
var 52 plural 0
var 1 child_index 0
var 1 name "Generic Gender Repository"
var 1 owners [#52]
var 1 fertile 0
var 1 public 1
var 1 inited 1
var 1 id 'gender
var 1 id_prefix 'gender
method init
arg ancestors;
(> pass(ancestors) <);
if (definer() in ancestors) {
pronouns = #[];
exceptions = #[];
plural = 0;
}
.
method add_exception
arg except, fix;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
if ((type(except) != 'string) || (type(fix) != 'string))
throw(~type, "Both the exception and fixes must be strings.");
exceptions = dict_add(exceptions, except, fix);
.
method get_exception
arg except;
return (| exceptions[except] |);
.
method base_name
return .name();
.
method definite_name
return .name();
.
method indefinite_name
return .name();
.
method set_pronouns
arg dict;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
if (type(dict) != 'dictionary)
throw(~type, "First argument must be a dictionary.");
pronouns = dict;
.
method pronouns
return pronouns;
.
method set_plural
arg val;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
plural = val ? 1 | 0;
.
method conjugate_verb
arg s;
if ("/" in s)
return explode(s, "/")[plural ? 2 | 1];
if (plural)
return (.get_exception(s)) || ($english.conjugate_verb_plural(s));
else
return (.get_exception(s)) || ($english.conjugate_verb_singular(s));
.
parent #52
object #87
var 1 child_index 0
var 1 name "him"
var 1 owners [#87]
var 1 fertile 0
var 1 public 1
var 52 pronouns #[['reflexive, "himself"], ['subject, "he"], ['object, "him"], ['possessive_noun, "his"], ['possessive_adj, "his"]]
var 52 exceptions #[["are", "is"]]
var 52 plural 0
var 1 inited 1
var 1 id 'gender_male
parent #1
object #38
var 1 child_index 0
var 1 name "Generic Utilities Parent"
var 1 owners [#38]
var 1 fertile 0
var 1 public 1
var 1 inited 1
var 1 id 'utils
parent #38
object #71
var 1 child_index 0
var 1 name "String Utilities"
var 1 owners [#71]
var 1 fertile 0
var 1 public 1
var 1 inited 1
var 1 id 'string
method capitalize
arg s;
return uppercase(s[1]) + substr(s, 2);
.
method is_numeric
arg s;
// note that this is a very simple check.
return toint(s) && (s != "0");
.
method format
arg fmt, [args];
var retval, i, f, w;
retval = "";
while (1) {
i = "%" in fmt;
if (!i)
break;
if ((fmt[i + 1]) == "%") {
retval = retval + substr(fmt, 1, i);
fmt = substr(fmt, i + 1);
} else {
retval = retval + substr(fmt, 1, i - 1);
fmt = substr(fmt, i + 1);
f = "";
w = 0;
if ((fmt[1]) in "-|0") {
f = fmt[1];
fmt = substr(fmt, 2);
}
if ((fmt[1]) == "*") {
if (type(args[1]) == 'integer)
throw(~type, "Not an integer.");
w = args[1];
args = delete(args, 1);
fmt = substr(fmt, 2);
} else {
while ((fmt[1]) in "0123456789") {
w = (10 * w) + toint(fmt[1]);
fmt = substr(fmt, 2);
}
}
switch (fmt[1]) {
case "s":
if ((type(args[1]) == 'integer) && ((args[1]) >= 0))
args = replace(args, 1, "+" + tostr(args[1]));
else
args = replace(args, 1, tostr(args[1]));
case "l":
if ((type(args[1]) == 'integer) && ((args[1]) >= 0))
args = replace(args, 1, tostr(args[1]));
else
args = replace(args, 1, toliteral(args[1]));
case "t":
args = replace(args, 1, ctime(args[1]));
default:
throw(~parse, (("Invalid conversion operator: %" + f) + tostr(w || "")) + (fmt[1]));
}
fmt = substr(fmt, 2);
if (!w)
retval = retval + (args[1]);
else if (strlen(args[1]) > w)
retval = retval + substr(args[1], 1, w);
else if ("|" in f)
retval = retval + pad(pad("", (w - strlen(args[1])) / 2) + (args[1]), w);
else if ("-" in f)
retval = retval + pad(args[1], w);
else if ("0" in f)
retval = retval + pad(args[1], -w, "0");
else
retval = retval + pad(args[1], -w);
args = delete(args, 1);
}
}
return retval + fmt;
.
method a_or_an
arg s;
if ((s[1]) in "aeiou")
return "an";
return "a";
.
method repeat
arg string, times;
return pad("", times, string);
.
method last_occurence
arg str, what;
var where;
while (what in substr(str, where + 1))
where = (what in substr(str, where + 1)) + where;
return where;
.
parent #25
parent #190
object #61
var 1 child_index 0
var 1 name "Crag"
var 1 owners [#61]
var 1 fertile 0
var 1 public 1
var 22 properties #[]
var 6 aliases []
var 7 registry #10
var 7 children_registry #10
var 18 commands []
var 16 dependents []
var 12 verbs #[]
var 13 description "Nothing special."
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #106
var 19 gender #87
var 20 password "Yadc5MdX19jL."
var 20 verb_cache 0
var 20 doing "Claudia Schiffer."
var 20 connected_at 757337404
var 20 last_command_at 757337415
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 23 current_help #104
var 8 messages []
var 24 owned_objects [#61]
var 24 editors []
var 25 programming 0
var 25 program_buf 0
var 1 inited 1
var 1 id 'user_crag
var 1 id_index 0
var 61 temp 0
parent #40
object #43
var 1 child_index 0
var 1 name "Top of Wormy Stairwell"
var 1 owners [#43, #56]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "You are at the top of a crickety black stairwell which seems to wind forever downwards below your feet. A bitter, musky smell wafts up from far below, perhaps from the remains of someone trapped at the bottom of this endlessly spiraling tunnel. Perhaps somebody should tell the ZeroLand government about elevators?"
var 14 unique 0
var 14 proper 0
var 17 contents [#26, #480]
var 40 exits [#114, #407]
var 40 dark 0
var 40 link_ok 0
var 1 inited 1
var 1 id_index 0
var 1 id 'room_karl
parent #25
object #523
var 1 child_index 0
var 1 name "scrungus"
var 1 owners [#523]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 22 properties #[]
var 6 aliases []
var 7 registry #10
var 7 children_registry #10
var 16 dependents []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #106
var 19 gender #66
var 20 password "??ghiaOg76sAg"
var 20 verb_cache 0
var 20 doing ""
var 20 connected_at 757651658
var 20 last_command_at 757654246
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 23 current_help #36
var 8 messages []
var 24 owned_objects [#523]
var 24 editors []
var 25 programming 0
var 25 program_buf 0
var 1 inited 1
var 1 id_index 0
var 1 id 'user_scrungus
parent #47
object #467
var 1 child_index 0
var 1 name "northwest"
var 1 owners [#467, #27]
var 1 fertile 0
var 1 public 1
var 22 properties #[]
var 6 aliases ["nw"]
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 0
var 47 source #462
var 47 dest #466
var 47 lock <#50, []>
var 1 inited 1
var 1 id_index 0
var 1 id 'exit_northwest
var 14 integrate "Inhuman cries of pleasure and/or pain can be faintly heard through a steel door that lies to the northwest."
parent #40
object #462
var 1 child_index 0
var 1 name "The Waiting Room"
var 1 owners [#462, #27]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "Dimly lit and quite large, the waiting room offers no comfort to those poor souls seeking help. Scarred tables overflow with outdated magazines and several ashtrays. There is a 'NO SMOKING' sign on the wall, but no one seems to care. Several beat up leatherette couches line three of the walls. A sliding glass window is set in the fourth. A bell sits on the counter in front of the window. Perhaps you should ring it."
var 14 unique 0
var 14 proper 0
var 17 contents []
var 40 exits [#464, #467, #469]
var 40 dark 0
var 40 link_ok 0
var 1 inited 1
var 1 id_index 0
var 1 id 'room_the_waiting_room
parent #47
object #459
var 1 child_index 0
var 1 name "north"
var 1 owners [#459, #60]
var 1 fertile 0
var 1 public 1
var 22 properties #[]
var 6 aliases ["n"]
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 0
var 47 source #457
var 47 dest #418
var 47 lock <#50, []>
var 1 inited 1
var 1 id_index 0
var 1 id 'exit_north2
parent #40
object #414
var 1 child_index 0
var 1 name "Small Cave"
var 1 owners [#414, #60, #243]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "Little light filters into the deep recesses of this cave, making your footing on the rough, sharp rocks uncertain, perhaps even dangerous. A constant 'drip, drip' echoes from deep within the tunnels."
var 14 unique 0
var 14 proper 0
var 17 contents []
var 40 exits [#416, #419]
var 40 dark 0
var 40 link_ok 0
var 1 inited 1
var 1 id_index 0
var 1 id 'room_small_cave
parent #25
object #395
var 1 child_index 0
var 1 name "lynx"
var 1 owners [#395]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 22 properties #[]
var 6 aliases []
var 7 registry #10
var 7 children_registry #10
var 16 dependents []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #106
var 19 gender #66
var 20 password "-70aqYEU/Lerk"
var 20 verb_cache 0
var 20 doing ""
var 20 connected_at 757295605
var 20 last_command_at 757295725
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 23 current_help #36
var 8 messages []
var 24 owned_objects [#395]
var 24 editors []
var 25 programming 0
var 25 program_buf 0
var 1 inited 1
var 1 id_index 1
var 1 id 'user_lynx
parent #25
object #258
var 1 child_index 0
var 1 name "Schlake"
var 1 owners [#258]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 22 properties #[]
var 6 aliases []
var 7 registry #10
var 7 children_registry #10
var 16 dependents []
var 12 verbs #[]
var 13 description "schlake@minos.nmt.edu"
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #44
var 19 gender #87
var 20 password "7 I.yYAYhDJZA"
var 20 verb_cache 0
var 20 doing "http://nmt.edu/humor"
var 20 connected_at 757670237
var 20 last_command_at 757758552
var 20 editor 0
var 20 editor_method 0
var 20 connections [#546]
var 23 current_help #51
var 8 messages []
var 24 owned_objects [#258]
var 24 editors []
var 25 programming 0
var 25 program_buf 0
var 1 inited 1
var 1 id 'user_schlake
var 1 id_index 0
parent #38
object #132
var 1 public 1
var 1 id 'data
var 1 name "Data Unparsing"
method unparse
arg data;
var str, element, association, pos;
switch (type(data)) {
case 'integer:
return tostr(data);
case 'string:
return toliteral(data);
case 'symbol:
return toliteral(data);
case 'error:
return toliteral(data);
case 'buffer:
return toliteral(data);
case 'dbref:
return valid(data) ? data.id_str() | toliteral(data);
case 'list:
if (!data)
return "[]";
str = "[";
for element in (sublist(data, 1, listlen(data) - 1)) {
str = str + ($data.unparse(element));
str = str + ", ";
}
str = str + ($data.unparse(data[listlen(data)]));
return str + "]";
case 'dictionary:
if (!data)
return "#[]";
str = "#[";
for association in (data) {
str = str + ($data.unparse(association));
str = str + ", ";
}
return substr(str, 1, strlen(str) - 2) + "]";
case 'frob:
return data.unparse();
}
.
parent #40
object #117
var 1 child_index 0
var 1 name "The void"
var 1 owners [#117]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "You'll be here if the room you were in was destroyed."
var 14 unique 0
var 14 proper 0
var 17 contents [#15]
var 40 exits [#47]
var 40 dark 1
var 40 link_ok 0
var 1 inited 1
var 1 id 'void
parent #38
object #107
var 107 noun_vowel_exceptions #[]
var 107 noun_consonant_exceptions #[]
var 1 child_index 0
var 1 name "English Language Utilities"
var 1 owners [#107]
var 1 fertile 0
var 1 public 1
var 1 inited 1
var 1 id 'english
method a_or_an
arg s;
if ((s[1]) in "aeiou")
return (| noun_vowel_exceptions[s] |) ? "a" | "an";
return (| noun_consant_exceptions[s] |) ? "an" | "a";
.
method add_noun_vowel_exception
arg s;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
noun_vowel_exceptions = dict_add(noun_vowel_exceptions, s, 1);
.
method add_noun_consonant_exception
arg s;
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
noun_consonant_exceptions = dict_add(noun_consonant_exceptions, s, 1);
.
method conjugate_verb_plural
arg s;
if (substr(s, strlen(s) - 3) == "ies")
return substr(s, 1, strlen(s) - 3) + "y";
if ((s[strlen(s)]) == "s")
return substr(s, 1, strlen(s) - 1);
return s;
.
method conjugate_verb_singular
arg s;
if ((s[strlen(s)]) == "y")
return substr(s, 1, strlen(s) - 1) + "ies";
if ((s[strlen(s)]) == "s")
return s;
return s + "s";
.
parent #25
object #97
var 1 child_index 0
var 1 name "Roark"
var 1 owners [#97]
var 1 fertile 0
var 1 public 1
var 22 properties #[]
var 6 aliases []
var 7 registry #10
var 7 children_registry #10
var 18 commands []
var 16 dependents []
var 12 verbs #[]
var 13 description "A pat of butter."
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #106
var 19 gender #87
var 20 password "?1wv3XU.hTBCY"
var 20 verb_cache 0
var 20 doing "Observere et cogire."
var 20 connected_at 757589162
var 20 last_command_at 757589169
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 23 current_help #51
var 8 messages []
var 24 owned_objects [#42, #48, #91, #97, #108, #109, #110, #113]
var 24 editors []
var 25 programming 0
var 25 program_buf 0
var 1 inited 1
var 1 id 'user_roark
var 1 id_index 0
parent #33
object #88
var 1 child_index 0
var 1 name "COMMANDS"
var 1 owners [#88, #37, #36]
var 1 fertile 0
var 1 public 1
var 33 brief "Navigational commands"
var 33 text ["Navigation commands allow you to access the first subnode (?), the next node at the same level (>), the previous node (<) and the previous level (..).", "", " `??' accesses the first subnode of the current node. If there are no subnodes, the command is equivalent to `?>'.", "", " `?>' accesses the next node at the same level. If the current node has no successor, the command is equivalent to `?.. >', that is: go up one and find the next node at that level. If the current node is at the top level, the command fails.", "", " `?<' accesses the previous node at the same level. If the current node has no predecessor, the command is equivalent to `?.. <'. If the current node is at the top level, the command fails.", "", " `?..' accesses the supernode (the node that has the current node as a subnode). If the current node is the top node, the command fails."]
var 33 footnotes []
var 33 references #[]
var 33 upnode #37
var 33 subnodes []
var 33 menu #[]
var 1 inited 1
var 1 id_index 0
var 1 id 'topic_help_commands
parent #52
object #66
var 1 child_index 0
var 1 name "it"
var 1 owners [#66]
var 1 fertile 0
var 1 public 1
var 52 pronouns #[['reflexive, "itself"], ['object, "it"], ['subject, "it"], ['possessive_adj, "its"], ['possessive_noun, "its"]]
var 52 exceptions #[["are", "is"]]
var 52 plural 0
var 1 inited 1
var 1 id_index 0
var 1 id 'gender_it
parent #25
object #59
var 1 child_index 0
var 1 name "ThomasCovenent"
var 1 owners [#59]
var 1 fertile 0
var 1 public 1
var 22 properties #[]
var 18 commands [["@shutdown *", 'template, 'shutdown_cmd], ["@netwho", 'template, 'netwho_cmd], ["@shout *", 'pattern, 'shout_cmd]]
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #111
var 19 gender #66
var 20 password "*"
var 20 verb_cache 0
var 20 doing ""
var 20 connected_at 0
var 20 last_command_at 0
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 23 current_help #36
var 7 registry #10
var 7 children_registry #10
var 8 messages []
var 24 owned_objects [#59]
var 24 editors []
var 25 programming 0
var 25 program_buf 0
var 1 inited 1
var 1 id_prefix 'user
var 1 id 'admin
method shutdown_cmd
arg dummy, s;
if (sender() != this())
throw(~perm, "Sender is not this().");
$sys.shutdown(s);
.
method netwho_cmd
arg dummy;
var conn, obj, out, c;
conn = [];
for obj in ($sys.connected_users())
conn = [@conn, [obj, obj.connections()]];
out = [$string.format("%-20s%-20s%-20s", "User", "Conn", "Addr")];
for obj in (conn) {
for c in (obj[2])
out = out + [$string.format("%-20s%-20s%-20s", (obj[1]).id_str(), c.id_str(), c.addr())];
}
.tell(out);
.
method shout_cmd
arg s;
var obj, out;
if (sender() != this())
throw(~perm, "Sender is not this.");
out = (((.name()) + " shouts, \"") + s) + "\"";
for obj in (setremove($sys.connected_users(), this()))
(| obj.tell(out) |);
.tell(("You shout, \"" + s) + "\"");
.
parent #429
object #361
var 1 child_index 0
var 1 name "grep commands"
var 1 owners [#361, #60]
var 1 fertile 1
var 1 public 1
var 18 commands [["@grep *", 'template, 'grep_cmd]]
var 1 inited 1
var 1 id_index 0
var 1 id 'grep_features
method search_db
arg string, type;
var i, obj, method, line, results, told;
if (sender() != this())
throw(~perm, "Sender is not this.");
for i in [0 .. toint(db_top()) - 1] {
obj = todbref(i);
if (!valid(obj))
continue;
if ((!(obj.public())) && (!(obj.is_owned_by(this())))) {
.tell((obj.name_and_id()) + ": Permission denied.");
continue;
}
told = 0;
for method in (obj.methods()) {
results = .search_method(obj.list_method(method), string, type);
if (results) {
if (!told) {
.tell((" " + (obj.name_and_id())) + ":");
told = 1;
}
for line in (results)
.tell((tostr(method) + " ") + line);
}
}
}
.
method search_method
arg code, string, type;
var lineno, line, results;
results = [];
for line in (code) {
lineno = lineno + 1;
if (string in line)
results = [@results, (pad(tostr(lineno), -3) + ": ") + line];
}
return results;
.
method grep_cmd
arg dummy, argstr;
if (sender() != this())
throw(~perm, "Sender is not this.");
while (argstr && ((argstr[1]) == " "))
argstr = substr(argstr, 2);
if (!argstr) {
.tell("Usage: @grep <string>");
return;
}
.search_db(argstr, 'foo);
.
parent #429
object #368
var 1 child_index 0
var 1 name "Login Watching Features"
var 1 owners [#368, #60]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 1 inited 1
var 1 id_index 0
var 1 id 'login_watching_features
method user_connected
var obj;
if (caller() != $user)
throw(~perm, "Caller is not $user.");
for obj in ($sys.connected_users())
(| obj.notify_connected(sender()) |);
.
method user_disconnected
var obj;
if (caller() != $user)
throw(~perm, "Caller is not $user.");
for obj in ($sys.connected_users())
(| obj.notify_disconnected(sender()) |);
.
method notify_disconnected
arg who;
if (sender() != $login_watching_features)
throw(~perm, "Sender is not $login_watching_features.");
if ((who != this()) && ((who.location()) != (.location())))
.tell(((("< " + (who.name())) + " has disconnected. ") + listlen($sys.connected_users())) + " total. >");
.
method notify_connected
arg who;
if (sender() != $login_watching_features)
throw(~perm, "Sender is not $login_watching_features.");
.tell(((("< " + (who.name())) + " has connected. ") + listlen($sys.connected_users())) + " total. >");
.
parent #59
parent #190
parent #361
parent #368
object #60
var 1 child_index 0
var 1 name "Jordan"
var 1 owners [#60]
var 1 fertile 0
var 1 public 1
var 22 properties #[]
var 6 aliases ["Jordan"]
var 7 registry #10
var 7 children_registry #10
var 18 commands [["@ledit *", 'template, 'local_edit_cmd]]
var 16 dependents []
var 12 verbs #[]
var 13 description "Don't bug me, I'm hackin'!"
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #106
var 19 gender #87
var 20 password "Xw/.9X.4OYaYE"
var 20 verb_cache 0
var 20 doing "Living, I hope."
var 20 connected_at 757722239
var 20 last_command_at 757723383
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 23 current_help #58
var 8 messages []
var 24 owned_objects [#34, #60, #64, #111, #114, #170, #189, #190, #238, #284, #326, #333, #335, #361, #368, #406, #407, #408, #412, #413, #414, #415, #416, #418, #419, #420, #427, #429, #453, #454, #456, #457, #458, #459, #460, #461, #518]
var 24 editors []
var 25 programming 0
var 25 program_buf 0
var 1 inited 1
var 24 editor #427
var 1 id 'user_jordan
var 1 id_index 0
method display_objects
var i, obj;
for i in [0 .. 282] {
obj = todbref(i);
if ((!valid(obj)) || (!(obj.id())))
continue;
.tell(((((obj.id_str()) + " ") + (obj.name())) + " ") + toliteral(obj));
}
.
method local_edit_cmd
arg dummy, argstr;
var spec, object, found, method, line;
spec = $parse.methodref(argstr);
if ((!argstr) || (!(spec[2]))) {
.tell("Usage: @list <object>.<method>");
return;
}
object = .simple_match_object(spec[1]);
if (!object) {
return;
}
method = tosym(spec[2]);
catch ~methodnf {
found = object.find_method(method);
} with handler {
.tell("Method not found.");
return;
}
.tell((((((("#$# edit name: " + (object.name())) + ".") + (spec[2])) + " upload: @program ") + (object.id_str())) + ".") + (spec[2]));
if (found != object)
.tell(("Method is defined on " + (found.id_str())) + ":");
for line in (found.list_method(method))
.tell(line);
.tell(".");
.
parent #33
object #51
var 1 child_index 0
var 1 name "PROGRAMMER"
var 1 owners [#51]
var 1 fertile 0
var 1 public 1
var 33 brief "Help for programmers"
var 33 text ["Sorry, no help yet."]
var 33 footnotes []
var 33 references #[]
var 33 upnode #36
var 33 subnodes []
var 33 menu #[]
var 1 inited 1
var 1 id_index 0
var 1 id 'topic_programmer
parent #47
object #48
var 1 child_index 0
var 1 name "east"
var 1 owners [#48, #97]
var 1 fertile 0
var 1 public 1
var 46 settable #[]
var 6 aliases ["e", "out"]
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 0
var 47 source #44
var 47 dest #109
var 47 lock <#50, []>
var 47 arrive_action <#32, #[['world, <#93, [['actor, 'base_name, 1], " ", ['actor, 'verb, 0, "has"], " arrived."]>], ['actor, 0]]>
var 47 leave_action <#32, #[['world, <#93, [['actor, 'base_name, 1], " ", ['actor, 'verb, 0, "goes"], " ", ['thing, 'base_name, 0], "."]>]]>
var 1 inited 1
var 14 integrate "A large, solid-looking steel door marked \"AIRLOCK\" has been built against the east wall."
var 1 id 'exit_east2
var 1 id_index 0
var 22 properties #[]
parent #40
object #42
var 1 child_index 0
var 1 name "Entrance to the Hotel Parasite"
var 1 owners [#42, #97]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "YA!"
var 14 unique 0
var 14 proper 0
var 17 contents [#287]
var 40 exits [#108]
var 40 dark 0
var 40 link_ok 0
var 1 inited 1
var 1 id 'room_roark
var 1 id_index 3
parent #33
object #36
var 36 last_user #556
var 1 child_index 0
var 1 name "TOP"
var 1 owners [#36]
var 1 fertile 0
var 1 public 1
var 33 brief "The top of the help hierarchy"
var 33 text ["If you keep typing 2 question marks on each line of input (as `??'), you will read the entire help database sequentially. Conveniently, it will start by telling you how to get around the database more efficiently.", "", "You have access to the following topics in the help system:"]
var 33 footnotes []
var 33 references #[]
var 33 upnode #36
var 33 subnodes [#36, #104, #58, #51, #89, #37]
var 33 menu #[["HELP", #37], ["USER", #104], ["BUILDER", #58], ["PROGRAMMER", #51]]
var 1 inited 1
var 1 id_index 0
var 1 id 'help_root
method subnodes
var l, e;
if (sender() != this())
last_user = sender();
l = [];
for e in (last_user.help_dict())
l = [@l, e[2]];
return [@setremove(l, this())];
.
method text
if (sender() != this())
last_user = sender();
return (> pass() <);
.
method match_menu
arg [args];
if (sender() != this())
last_user = sender();
.invalidate_menu();
return (> pass(@args) <);
.
parent #4
object #32
var 1 child_index 0
var 1 name "Action class frob"
var 1 owners [#32]
var 1 fertile 0
var 1 public 1
var 1 inited 1
var 1 id 'action_class
method new
arg s;
return <this(), #[['world, (> $pronoun_class.parse(s) <)]]>;
.
method but
arg rep, type, s;
if (!(type in ['actor, 'world, 'thing, 'victim]))
throw(~type, ("Not a valid type: " + toliteral(type)) + ".");
if (s == 0)
return <this(), dict_add(rep, type, 0)>;
else
return <this(), dict_add(rep, type, (> $pronoun_class.parse(s) <))>;
.
method announce
arg rep, actor, [others];
var s, who, ppl, types, n, told, victim;
types = ['actor, 'thing, 'victim];
ppl = [actor, @others];
victim = (listlen(ppl) > 2) ? ppl[3] | 0;
told = [];
for n in [1 .. listlen(ppl)] {
if (!(ppl[n]))
continue;
who = ppl[n];
if (dict_contains(rep, types[n])) {
s = rep[types[n]];
if (s == 0)
continue;
} else {
s = rep['world];
}
if (actor == victim)
s = (s.reflexive()).format(@replace(ppl, n, $gender_you));
else
s = s.format(@replace(ppl, n, $gender_you));
if (!(who in told)) {
told = [@told, who];
(| who.tell(s) |);
}
}
s = rep['world];
if (actor == victim)
s = s.reflexive();
s = s.format(@ppl);
(actor.location()).tell_contents(s, @ppl);
.
method translate
arg rep;
var key, result;
result = ("\"" + ((rep['world]).translate())) + "\"";
for key in (dict_keys(dict_del(rep, 'world)))
result = (((result + ", but for ") + tostr(key)) + ", it is ") + ((rep[key]) ? ("\"" + ((rep[key]).translate())) + "\"" | "clear");
return result;
.
parent #25
object #26
var 1 child_index 0
var 1 name "Daffyd"
var 1 owners [#26]
var 1 fertile 0
var 1 public 1
var 22 properties #[]
var 6 aliases []
var 7 registry #10
var 7 children_registry #10
var 18 commands []
var 16 dependents []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #43
var 19 gender #66
var 20 password "n'YaYXB0nPJzY"
var 20 verb_cache 0
var 20 doing ""
var 20 connected_at 756877708
var 20 last_command_at 756878116
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 23 current_help #51
var 8 messages []
var 24 owned_objects [#26]
var 24 editors []
var 25 programming 0
var 25 program_buf 0
var 1 inited 1
var 1 id 'user_daffyd
var 1 id_index 0
parent #4
object #11
var 1 name "Or Lock class"
var 1 id_index 0
var 1 id 'or_lock_class
method new
arg lhs, rhs;
if ((type(lhs) != 'frob) || (type(rhs) != 'frob))
throw(~perm, "Arguments are not both frobs.");
return <this(), [lhs, rhs]>;
.
method try
arg lock, obj;
return ((lock[1]).try(obj)) || ((lock[2]).try(obj));
.
parent #1
object #2
var 2 db #[]
var 1 child_index 0
var 1 name "generic registry"
var 1 owners [#2]
var 1 fertile 0
var 1 public 1
var 1 inited 1
var 1 id 'registry
method init
arg anc;
(> pass(anc) <);
if (definer() in anc)
db = #[];
.
method is_readable_by
arg sender, caller;
return 1;
.
method is_writable_by
arg who, caller;
return (.is_owned_by(who)) || (caller == $registered);
.
method contains
arg key;
if (!(.is_readable_by(sender(), caller())))
throw(~perm, "Sender isn't reader.");
return dict_contains(db, key);
.
method is_free
arg key;
if (!(.is_readable_by(sender(), caller())))
throw(~perm, "Sender isn't a reader.");
return !dict_contains(db, key);
.
method match
arg key;
if (!(.is_readable_by(sender(), caller())))
throw(~perm, "Sender is not reader.");
return (> db[key] <);
.
method content
if (!(.is_readable_by(sender(), caller())))
throw(~perm, "Sender isn't reader.");
return db;
.
method add
arg key, val;
if (!(.is_writable_by(sender(), caller())))
throw(~perm, "Sender is not writer.");
if (.contains(key))
throw(~keyexists, "The name is already taken");
if (!(.is_free(key)))
throw(~keyinv, "Invalid name.");
db = dict_add(db, key, val);
.
method del
arg key;
if (!(.is_writable_by(sender(), caller())))
throw(~perm, "Sender is not writer.");
if (!(.contains(key)))
throw(~keynf, "Key not found.");
db = dict_del(db, key);
.
parent #2
object #10
var 1 child_index 0
var 1 name "User Registry"
var 1 owners [#10]
var 1 fertile 0
var 1 public 1
var 2 db #[["JoeAverage", #20], ["PenPal", #21], ["Clueless", #23], ["BuilderBob", #24], ["Hacker", #25], ["ThomasCovenent", #59], ["Chaos", #101], ["QV", #100], ["Pan", #86], ["KV", #100], ["Satan", #62], ["Druid", #85], ["Crag", #61], ["Greg", #99], ["VQ", #100], ["Karl", #56], ["Roark", #97], ["Keelah", #96], ["SamIAm", #55], ["Randalar", #82], ["Matthew", #81], ["Leland", #54], ["Daffyd", #26], ["Joe", #137], ["Ford", #139], ["Dred", #165], ["heh", #165], ["Patroclus", #178], ["Jordan", #60], ["Mandrake", #213], ["Puff", #228], ["Zachary", #243], ["Hemlock", #248], ["Schlake", #258], ["Zippy", #267], ["Terry", #270], ["Xythian", #273], ["foreignhost", #287], ["lynx", #395], ["Craig", #447], ["Doug", #262], ["Nniuq", #472], ["Spine", #480], ["Morgaine", #27], ["Tristessa", #27], ["Ellis", #500], ["Stinglai", #521], ["scrungus", #523], ["dr", #556], ["Vegetal_Quebecois", #100], ["Lynx", #560], ["Crag2", #576]]
var 1 inited 1
var 1 id 'user_registry
method is_free
arg name;
return (> pass(name) <) && (!(" " in name));
.
parent #18
object #29
var 29 user 0
var 29 addr 0
var 29 port 0
var 29 buffer 0
var 1 child_index 132
var 1 name "Generic connection object"
var 1 owners [#29]
var 1 fertile 0
var 1 public 1
var 18 commands [["conn?ect *", 'template, 'connect_cmd], ["create *", 'template, 'create_cmd], ["@quit", 'template, 'quit_cmd]]
var 1 inited 1
var 1 id 'connection
var 1 id_prefix 'connection
method init
arg ancestors;
(> pass(ancestors) <);
if (definer() in ancestors) {
user = 0;
addr = 0;
port = 0;
buffer = `[];
}
.
method tell
arg s;
if ((sender() != this()) && (sender() != user))
throw(~perm, "Sender not this or the player.");
echo(buffer_from_strings([s]));
.
method connect
arg addr_arg, port_arg;
if (sender() != 0)
throw(~perm, "Sender not the server.");
addr = addr_arg;
port = port_arg;
.echo_welcome();
$sys.connection_starting();
.
method disconnect
if (sender() != 0)
throw(~perm, "Sender not the server.");
catch any {
.destroy();
} with handler {
$sys.log_traceback(traceback());
}
.
method parse
arg incoming;
var lines, line;
lines = buffer_to_strings(buffer_append(buffer, incoming));
buffer = lines[listlen(lines)];
for line in (sublist(lines, 1, listlen(lines) - 1))
(| .parse_line(line) |);
.
method parse_line
arg str;
var cmd;
if ((caller() != definer()) || (sender() != this()))
throw(~perm, "Invalid access to private method.");
// If we're logged in, forward the line to the player.
if (user) {
if ((user.parse(str)) == 'disconnect)
disconnect();
return;
}
// Display tracebacks, even though user may be clueless.
catch any {
cmd = .match_command(str);
if (cmd)
.(cmd[1])(@cmd[2]);
else
.echo_welcome();
} with handler {
for str in (traceback())
echo(str);
}
.
method echo_welcome
if ((sender() != this()) || (caller() != definer()))
throw(~perm, "Invalid access to private method.");
if (!(| echo_file("welcome") |))
echo("<The file 'welcome' is missing.>");
.
method connect_cmd
arg dummy, words;
var words, u, password, salt;
if (sender() != this())
throw(~perm, "Sender is not this.");
// Get user name and password.
words = explode(words);
if (listlen(words) != 2) {
echo("Usage: connect <name> <password>");
return;
}
// Look for a user with the given name.
catch ~keynf {
u = $user_registry.match(words[1]);
} with handler {
echo(("The user \"" + (words[1])) + "\" does not exist.");
return;
}
// Check if the password is correct.
if (!(u.check_password(words[2]))) {
echo(("That is the wrong password for " + (words[1])) + ".");
return;
}
// Forward remaining lines to the user.
user = u;
user.connection_logged_in(addr, port);
.
method create_cmd
arg dummy, words;
var words;
if (sender() != this())
throw(~perm, "Sender is not this.");
// Get user name and password.
words = explode(words);
if (listlen(words) != 2) {
echo("Usage: create <name> <password>");
return;
}
// Look for an existing user with the given name.
catch ~keynf {
$user_registry.match(words[1]);
echo(("The user \"" + (words[1])) + "\" already exists or is an inappropriate name.");
return;
}
// Create a new user and log it in.
user = $sys.create_user(words[1], words[2]);
user.connection_logged_in(addr, port);
.
method quit_cmd
arg dummy;
if (sender() != this())
throw(~perm, "Sender is not this.");
disconnect();
.
method addr
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
return addr;
.
method port
return port;
.
method user
return user;
.
method echo_file
arg s;
if (sender() != user)
throw(~perm, "Sender not the player.");
echo_file(s);
.
method boot
if (!(.is_owned_by(sender())))
throw(~perm, "Sender is not an owner.");
.destroy();
.
method user_going_away
if (!(caller().is_agent('user)))
throw(~perm, "Caller not an agent of user protocol.");
disconnect();
.
method deinit
arg ancestors;
(> pass(ancestors) <);
if (definer() in ancestors) {
if (user)
user.connection_gone();
user = 0;
}
.
parent #29
object #581
var 1 child_index 0
var 1 name "(A login object)"
var 1 owners [#581, #0]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 29 user 0
var 29 addr 0
var 29 port 0
var 29 buffer `[]
var 1 inited 1
var 1 id_index 0
var 1 id 'connection_6666
parent #29
object #578
var 1 child_index 0
var 1 name "(A login object)"
var 1 owners [#578, #0]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 29 user #99
var 29 addr "18.177.1.175"
var 29 port 1370
var 29 buffer `[]
var 1 inited 1
var 1 id_index 0
var 1 id 'connection_6666_1_2
parent #29
object #572
var 1 child_index 0
var 1 name "(A login object)"
var 1 owners [#572, #0]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 29 user #574
var 29 addr "129.10.113.75"
var 29 port 1401
var 29 buffer `[]
var 1 inited 1
var 1 id_index 3
var 1 id 'connection_6666_1
parent #29
object #515
var 1 child_index 0
var 1 name "(A login object)"
var 1 owners [#515, #0]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 29 user #262
var 29 addr "192.232.1.15"
var 29 port 2405
var 29 buffer `[]
var 1 inited 1
var 1 id_index 0
var 1 id 'connection_6666_3_5
parent #47
object #463
var 1 child_index 0
var 1 name "west"
var 1 owners [#463, #27]
var 1 fertile 0
var 1 public 1
var 22 properties #[]
var 6 aliases ["w"]
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 0
var 47 source #457
var 47 dest #462
var 47 lock <#50, []>
var 1 inited 1
var 1 id_index 0
var 1 id 'exit_west6
var 14 integrate "A dingy light is cast from underneath an old, scarred door to the west."
parent #47
object #461
var 1 child_index 0
var 1 name "west"
var 1 owners [#461, #60]
var 1 fertile 0
var 1 public 1
var 22 properties #[]
var 6 aliases ["w"]
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 0
var 47 source #170
var 47 dest #457
var 47 lock <#50, []>
var 1 inited 1
var 1 id_index 0
var 1 id 'exit_west5
var 14 integrate "In the west wall is the doorway leading back to the tunnels."
parent #47
object #458
var 1 child_index 0
var 1 name "south"
var 1 owners [#458, #60]
var 1 fertile 0
var 1 public 1
var 22 properties #[]
var 6 aliases ["s"]
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 0
var 47 source #418
var 47 dest #457
var 47 lock <#50, []>
var 1 inited 1
var 1 id_index 0
var 1 id 'exit_south2
parent #40
object #453
var 1 child_index 0
var 1 name "Tunnels"
var 1 owners [#453, #60]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "You see nothing special."
var 14 unique 0
var 14 proper 0
var 17 contents []
var 40 exits [#456]
var 40 dark 0
var 40 link_ok 0
var 1 inited 1
var 1 id_index 0
var 1 id 'room_tunnels1
parent #25
object #447
var 1 child_index 0
var 1 name "Craig"
var 1 owners [#447]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 22 properties #[]
var 6 aliases []
var 7 registry #10
var 7 children_registry #10
var 16 dependents []
var 12 verbs #[]
var 13 description "Just a guy, HEY!"
var 14 unique 0
var 14 proper 1
var 17 contents []
var 15 location #106
var 19 gender #87
var 20 password "&=H7ZPisWPQQ2"
var 20 verb_cache 0
var 20 doing "Hiding from the authorities"
var 20 connected_at 757371596
var 20 last_command_at 757374190
var 20 editor 0
var 20 editor_method 0
var 20 connections []
var 23 current_help #36
var 8 messages []
var 24 owned_objects [#447]
var 24 editors []
var 25 programming 0
var 25 program_buf 0
var 1 inited 1
var 1 id_index 0
var 1 id 'user_craig
parent #41
object #427
var 1 child_index 0
var 1 name "Jordan's Editor."
var 1 owners [#427, #60]
var 1 fertile 0
var 1 public 1
var 18 commands []
var 16 dependents []
var 6 aliases []
var 12 verbs #[]
var 13 description "Type `quit' to exit. Type `make' to execute your buffer. For more documentation, scream at Galin or an admin."
var 14 unique 0
var 14 proper 0
var 17 contents []
var 40 exits []
var 40 dark 0
var 40 link_ok 0
var 41 text ["arg str;", "var cmd, loc, result, i, j, template, word, fields, obj, verb_info;", "", "if (!.is_owned_by(sender()))", " throw(~perm, \"Sender not an owner.\");", "", "// Are we editing?", "if (editor) {", " if (substr(str, 1, 1) == \"<\") {", " str = substr(str, 2);", " if (!str) {", " return;", " }", " } else {", " result = editor.handle_editor_command(str);", " switch (result[1]) {", " case 'not_done:", " editor = result[2];", " case 'abort:", " editor = 0;", " case 'done:", " .(editor_method)(result[2]);", " }", " return;", " }", "}", "", "// Check commands on this.", "cmd = .match_command(str);", "if (cmd)", " return .(cmd[1])(@cmd[2]);", "", "// Check commands on location.", "loc = .location();", "cmd = loc.match_command(str);", "if (cmd) {", " loc.(cmd[1])(@cmd[2]);", " return;", "}", "", "// Resort to verb cache.", ".validate_verb_cache();", "catch ~nothing, ~ambiguous, ~methodnf, ~verbnf, ~objnf {", " for template in (union(verb_cache, $sys.remote_verb_templates())) {", " fields = match_template(strsub(template, \"%this\", \"*\"), str);", " if (type(fields) != 'list)", " continue;", " j = 1;", " for word in (explode(template)) {", " if (word == \"%this\") {", " obj = sender().match_environment(fields[j]);", " verb_info = obj.verb_info(template);", " if (verb_info[2] != 'remote && !.local_to_environment(obj))", " .tell(\"You cannot do that from here.\");", " else", " obj.(verb_info[1])(@fields);", " return;", " } else if (word == \"*=*\") {", " j = j + 2;", " } else {", " j = j + 1;", " }", " }", " }", "} with handler {", " switch (error()) {", " case ~objnf:", " .tell(\"You don't see an object named \\\"\" + error_arg() + \"\\\" here.\");", " case ~ambiguous:", " .tell(\"That name could refer to more than one object.\");", " case ~verbnf:", " .tell(\"You can't do that to that object.\");", " case ~methodnf:", " .tell(\"That object cannot be manipulated.\");", " }", " return;", "}", "", "// Try exit names.", "for obj in (loc.exits()) {", " if (obj.matches_exactly(str)) {", " obj.go_through();", " return;", " }", "}", "", "// No luck.", ".tell(\"I don't understand that.\");"]
var 41 insertion_point 44
var 41 changed 0
var 41 session <#79, #[['user, #60], ['object, #20], ['method, 'parse_command], ['text, ["arg str;", "var cmd, loc, result, i, j, template, word, fields, obj, verb_info;", "", "if (!.is_owned_by(sender()))", " throw(~perm, \"Sender not an owner.\");", "", "// Are we editing?", "if (editor) {", " if (substr(str, 1, 1) == \"<\") {", " str = substr(str, 2);", " if (!str) {", " return;", " }", " } else {", " result = editor.handle_editor_command(str);", " switch (result[1]) {", " case 'not_done:", " editor = result[2];", " case 'abort:", " editor = 0;", " case 'done:", " .(editor_method)(result[2]);", " }", " return;", " }", "}", "", "// Check commands on this.", "cmd = .match_command(str);", "if (cmd)", " return .(cmd[1])(@cmd[2]);", "", "// Check commands on location.", "loc = .location();", "cmd = loc.match_command(str);", "if (cmd) {", " loc.(cmd[1])(@cmd[2]);", " return;", "}", "", "// Resort to verb cache.", ".validate_verb_cache();", "catch ~nothing, ~ambiguous, ~methodnf, ~verbnf, ~objnf {", " for template in (union(verb_cache, $sys.remote_verb_templates())) {", " fields = match_template(strsub(template, \"%this\", \"*\"), str);", " if (type(fields) != 'list)", " continue;", " j = 1;", " for word in (explode(template)) {", " if (word == \"%this\") {", " obj = sender().match_environment(fields[j]);", " verb_info = obj.verb_info(template);", " if (verb_info[2] != 'remote && !.local_to_environment(obj))", " .tell(\"You cannot do that from here.\");", " else", " obj.(verb_info[1])(@fields);", " return;", " } else if (word == \"*=*\") {", " j = j + 2;", " } else {", " j = j + 1;", " }", " }", " }", "} with handler {", " switch (error()) {", " case ~objnf:", " .tell(\"You don't see an object named \\\"\" + error_arg() + \"\\\" here.\");", " case ~ambiguous:", " .tell(\"That name could refer to more than one object.\");", " case ~verbnf:", " .tell(\"You can't do that to that object.\");", " case ~methodnf:", " .tell(\"That object cannot be manipulated.\");", " }", " return;", Showing the first 150 KB. Download the file for the full text.