patch
./upgradedb-3.0a10/files/patch · 788.5 KB
From the archive upgradedb-3.0a10.tar.gz
Download the archive « Back to the archive contents
diff -rwu ColdCore-3.0a9.02/src/+CORE ColdCore-3.0a10/src/+CORE
--- ColdCore-3.0a9.02/src/+CORE Sat Mar 14 15:53:55 1998
+++ ColdCore-3.0a10/src/+CORE Sat Mar 14 15:49:26 1998
@@ -25,12 +25,7 @@
mail_lib
foundation
has_commands
-command_cache
-network
-frob
-connection_interface
has_name
-bug_handler
described
event_handler
utilities
@@ -47,6 +42,8 @@
plain_format
wrapped_format
flat_format
+tagged_format
+tkmoo_format
ansi_format
html_format
pueblo_format
@@ -80,14 +77,16 @@
page_web_prefs
mail_message
itext
+command_cache
+remote_cache
+user_interfaces
+mail_list
+mail_ui
location
located_location
body
has_reactions
robot
-mail_list
-user_interfaces
-mail_ui
command_aliases
bad_commands
help_ui
@@ -95,6 +94,7 @@
channel_ui
user_info
menu
+www_preferences
user
guest
reaper
@@ -105,17 +105,10 @@
dmi_data_ui
programmer
admin
-antisocial
-social
-www_preferences
-settings_ui
-mail_list_news
-mail_list_bugs
-mail_postmaster
-mail_admin
on_location
in_location
lost_and_found
+introtut_mailbox
trash
realm_settings
place
@@ -123,27 +116,115 @@
body_cave
void
the_pit
+tutorial
+introductory_tutorial
+introtut_speaking
+introtut_nonverbal
+introtut_remote
+introtut_who
+introtut_look
+introtut_desc
+introtut_gender
+introtut_start
+introtut_help
+introtut_lines
+introtut_end
+introtut_objs
+introtut_env
+introtut_moving
+introtut_help_short
+introtut_help_nav
+introtut_objs_env
+introtut_names
+introtut_names_tmpl
+introtut_names_user
+introtut_moving_1
+introtut_moving_2
+introtut_communication
realm
realm_of_creation
+tutorial_realm
+mail_list_news
+mail_list_bugs
+mail_postmaster
+mail_admin
+antisocial
+social
+settings_ui
+network
+connection
+outbound_connection
+ident_connection
+inbound_connection
+http_connection
+smtp_connection
+login_connection
+pop3_connection
+smtp
+daemon
+login_daemon
+smtp_daemon
+http_daemon
+pop3_daemon
+dns
+frob
thing_frob
wearable_frob
exit
coord_exit
exit_frob
+logic_frob
+xor
+and
+and_lock_frob
+lock_frob
+object_lock_frob
+inside_lock_frob
+indirect_lock_frob
+owner_lock_frob
+carry_lock_frob
+parent_lock_frob
+not
+not_lock_frob
+or
+or_lock_frob
+true
+true_lock_frob
+false
+false_lock_frob
+read_parser
+callback
+message_frob
+trie
+ctext_frob
+tag
+format
+generator
+climate_frob
+rect
+rtree
+propagator
+connection_interface
+login_interface
+http_interface
+pop3_interface
+smtp_interface
slate
nothing
+introtut_user_graffiti
+introtut_leaflet
+path
weather_system
climate
-climate_taobh_thiar
+climate_creation
weather_attributes
weather
-weather_1
-weather_2
-weather_3
-weather_4
-weather_5
-weather_6
-smtp_interface
+weather_nice
+weather_hot
+weather_windy
+weather_stormy
+weather_rainy
+weather_snowy
help_node
db
registry
@@ -194,6 +275,7 @@
help_places_paths
help_places_env
help_build_cmds
+help_building_commands
help_prog
help_prog_commands
help_coldc
@@ -320,6 +402,7 @@
help_func_shutdown
help_func_anticipate_assignment
help_func_config
+help_func_cache_info
help_funcs_task
help_func_atomic
help_func_caller
@@ -457,6 +540,10 @@
help_reference
help_updates
help_admin
+help_admin_commands
+help_administrators
+help_credit
+help_copyright
help_core
help_cmds
help_cmd_say
@@ -516,13 +603,22 @@
help_cmd_move
help_cmd_chparent
help_cmd_addparent
+help_cmd_addshortcut
help_cmd_addvariable
help_cmd_delparent
help_cmd_delvariable
help_cmd_ancestors
+help_cmd_delshortcut
+help_cmd_chmod
help_cmd_delmethod
+help_cmd_eval
+help_cmd_grep
help_cmd_id
help_cmd_join
+help_cmd_trace
+help_cmd_undefsetting
+help_cmd_defsetting
+help_cmd_configsetting
help_cmd_teleport
help_cmd_attach
help_cmd_bugs
@@ -537,14 +633,60 @@
help_cmd_help
help_cmd_age
help_cmd_audit
+help_cmd_chmanage
help_cmd_commands
help_cmd_context
help_cmd_date
help_cmd_examine
help_cmd_finger
+help_cmd_managed
+help_cmd_manager
+help_cmd_map
+help_cmd_monitor
help_cmd_news
help_cmd_password
help_cmd_quit
+help_cmd_status
+help_cmd_exits
+help_cmd_whereis
+help_cmd_who
+help_cmd_drop
+help_cmd_get
+help_cmd_inventory
+help_cmd_look
+help_cmd_quote
+help_cmd_remembered
+help_cmd_forget
+help_cmd_aca
+help_cmd_dca
+help_cmd_ca
+help_cmd_edit
+help_cmd_cs
+help_cmd_mcp_upload
+help_cmd_give
+help_cmd_walk
+help_cmd_add_trustee
+help_cmd_add_writer
+help_cmd_del_trustee
+help_cmd_del_writer
+help_cmd_name_templates
+help_cmd_registered
+help_cmd_register_name
+help_cmd_trusted
+help_cmd_trusts
+help_cmd_writers
+help_cmd_writes
+help_cmd_channel_acm
+help_cmd_channel_dcm
+help_cmd_channel_desc
+help_cmd_channel_join_lock
+help_cmd_channel_leave_lock
+help_cmd_channel_use_lock
+help_cmd_channel_purge
+help_cmd_channel_add
+help_cmd_channels
+help_cmd_kick
+help_cmd_quota
help_obj
help_cml_colors
help_obj_trie
@@ -576,6 +718,11 @@
help_formatting_objects
help_node_commands
help_obj_code_lib
+help_obj_generic_map
+help_obj_world_time
+help_obj_time
+help_obj_robot
+help_obj_robot_methods
help_sys
help_sys_events
help_sys_event_register
@@ -595,6 +742,12 @@
help_sys_word
help_ranges
help_sys_bad_commands
+help_sys_parser
+help_obj_command_cache
+help_obj_command_cache_smeths
+help_obj_command_cache_cmeths
+help_obj_command_cache_dmeths
+help_parser_command_modules
gender
gender_first_person
gender_female
@@ -602,55 +755,6 @@
gender_male
gender_plural
gender_neuter
-finger_interface
-login_interface
-http_interface
-logic_frob
-xor
-and
-and_lock_frob
-lock_frob
-object_lock_frob
-inside_lock_frob
-indirect_lock_frob
-owner_lock_frob
-carry_lock_frob
-parent_lock_frob
-not
-not_lock_frob
-or
-or_lock_frob
-true
-true_lock_frob
-false
-false_lock_frob
-read_parser
-callback
-message_frob
-trie
-ctext_frob
-tag
-format
-generator
-climate_frob
-rect
-rtree
-propagator
-connection
-outbound_connection
-ident_connection
-inbound_connection
-http_connection
-smtp_connection
-login_connection
-finger_connection
-smtp
-daemon
-login_daemon
-smtp_daemon
-finger_daemon
-http_daemon
-dns
world_time
user_parsers
null_parser
@@ -661,10 +765,10 @@
eval_parser
filters
wrap_filter
-lock_parser
editor_session
propagator_effects
adapter
+bug_handler
symbol
math
english_lib
@@ -678,5 +678,6 @@
http_lib
converters
security_lib
+mime_lib
directories
dir_desktop
diff -rwu ColdCore-3.0a9.02/src/admin.cdc ColdCore-3.0a10/src/admin.cdc
--- ColdCore-3.0a9.02/src/admin.cdc Sat Mar 14 15:40:32 1998
+++ ColdCore-3.0a10/src/admin.cdc Sat Mar 14 15:49:06 1998
@@ -1,11 +1,13 @@
new object $admin: $programmer;
*var $admin configured_core = '-' admin.cdc
var $admin shutdown_started = 0;
var $channel_ui active_channels = #[];
var $channel_ui channel_dict = #[];
var $command_aliases command_aliases = [];
+var $command_cache commands = 0;
+var $command_cache modules = [];
+var $command_cache shortcuts = 0;
var $described prose = [];
var $foundation defined_msgs = #[["mojo-on", #[['branches, ["general", "actor"]]]], ["mojo-off", #[['branches, ["general", "actor"]]]], ["mojo-look", #[['branches, ["general", "actor"]]]]];
var $foundation msgs = #[["mojo-on", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, "'s eyes glow as Mojo courses through ", <$generator, ["actor.pp", [], [], 'gen_actorpp]>, " body."], #[['this, $admin]]]>], ["actor", <$ctext_frob, [["Your eyes glow as Mojo courses through your body."], #[['this, $admin]]]>]]], ["mojo-off", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, "'s eyes stop glowing as the Mojo leaves ", <$generator, ["actor.pp", [], [], 'gen_actorpp]>, " body."], #[['this, $admin]]]>], ["actor", <$ctext_frob, [["Your eyes stop glowing as the Mojo leaves your body."], #[['this, $admin]]]>]]], ["mojo-look", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, "'s eyes ", <$generator, ["mojo.what", [], [], 'gen_mojowhat]>, "glow from Mojo."], #[['this, $admin]]]>], ["actor", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, "'s eyes ", <$generator, ["mojo.what", [], [], 'gen_mojowhat]>, "glow from mojo."], #[['this, $admin]]]>]]]];
@@ -28,7 +30,11 @@
["@reap",\
[["@reap", "*", "@reap <any>", 'reap_cmd, #[[1, ['any, []]]]]]],\
["@quota",\
- [["@quota", "* to *", "@quota <object> to <any:+e?xempt>", 'quota_cmd, #[[1, ['object, []]], [3, ['any_opt, ["e?xempt"]]]]]]]];
+ [["@quota", "* to *", "@quota <object> to <any:+e?xempt>", 'quota_cmd, #[[1, ['object, []]], [3, ['any_opt, ["e?xempt"]]]]]]],\
+ ["@kick",\
+ [["@kick", "*", "@kick <any>", 'kick_cmd, #[[1, ['any, []]]]]]],\
+ ["@chman?age",\
+ [["@chman?age", "*", "@chman?age <any>", 'chmanage_cmd, #[[1, ['any, []]]]]]]];
var $has_name name = ['prop, "Generic Admin", "Generic Admin"];
var $located location = $body_cave;
var $located obvious = 1;
@@ -44,12 +50,13 @@
var $mail_ui subscribed = #[[$admin, [791485891, 0]]];
var $programmer eval_prefix = #[["me", "me = this()"], ["here", "here = this().location()"]];
var $root created_on = 796268969;
-var $root flags = ['methods, 'code, 'core, 'command_cache, 'variables];
+var $root defined_settings = #[["admin-role", #[]]];
+var $root flags = ['methods, 'code, 'core, 'variables, 'general_cache];
var $root inited = 1;
var $root managed = [$admin];
var $root manager = $admin;
var $root quota = 75000;
-var $root settings = #[["home", $body_cave]];
+var $root settings = #[["home", $body_cave], ["admin-role", ""]];
var $thing gender = $gender_neuter;
var $user connected_at = 0;
var $user connections = [];
@@ -80,8 +87,13 @@
if (!email)
return (who.namef('ref)) + " does not have an email address!";
catch any {
- $smtp.sendmail('admin, email, ("[" + ($motd.server_name())) + "] password change.", ((("The password for the user " + (who.name())) + " on ") + ($motd.server_name())) + " has been set as:", "", " " + pwd, "", "This is an automatic message sent to the supplied address. If this message is in error simply discard it.", "", "If no connections are made to this user within a week it will be purged.");
+ $smtp.sendmail('admin, email, ("[" + ($motd.server_name())) + "] password change.", [((("The password for the user " + (who.name())) + " on ") + ($motd.server_name())) + " has been set as:", "", " " + pwd, "", "This is an automatic message sent to the supplied address. If this message is in error simply discard it.", "", "If no connections are made to this user within a week it will be purged."]);
} with {
+ if (error() == ~error) {
+ .tell(("While trying to email '" + email) + "':");
+ .tell((traceback()[1])[2]);
+ return "** Aborting adjustment **";
+ }
.tell_traceback(traceback());
return "** Unable to send mail message, no changes made **";
}
@@ -97,9 +109,7 @@
(> who.chparents(valid[what], @p) <);
// update caches.
- for o in (parents())
- o.cache_init();
- who.rehash_caches();
+ who.cache_client_init();
// let'em know what we did
what = what.add_indefinite();
@@ -144,161 +154,23 @@
}
};
-public method .configure_core() {
- var list, l, x, t, err;
-
- // get the juice
- $sys.add_to_system(this());
-
- // expand on this as we go
- .tell(["*" * 78, strfmt("%78{*}c", " Welcome to ColdCore "), "*" * 78]);
- .tell(("This is an interactive configuration system which any admin who connects (until it is completed) is sent through. You must complete this configuration before you can do anything else. You can skip a specific question at any time by typing '@skip'. Suggested default values will be enclosed in square brackets. Pressing enter without any value will use the default value.".wrap_lines(78)).mmap('center, 78));
- .tell("*" * 78);
-
- // first question please
- if (!($admin.configured_core('new_user_class))) {
- .tell("What class should new users be created as? Available classes:");
- list = filter x in ($user.descendants()) where ('command_cache in (x.flags()));
- t = $sys.get_new_user_class();
- list = map x in (list) to ((list == t) ? (x + " (current class)") : x);
- .tell(list.prefix(" "));
- while (!l) {
- refresh();
- l = .prompt("New User Class [$user] ");
- if (l == "@skip") {
- .tell("Skipping..");
- break;
- }
- if (l) {
- catch any {
- l = $object_lib.to_dbref(l);
- if (!(l in list))
- .tell("Invalid selection, try again.");
- } with {
- .tell(("Invalid selection '" + l) + "'");
- continue;
- }
- } else {
- l = $user;
- }
- $sys.set_setting("new-user-class", $sys, l);
- $admin.configured_core('new_user_class, 1);
- .tell("New User Class set to: " + l);
- }
- .tell(["", "You can set this at any time, with the command:"]);
- .tell(" @set $sys:new-user-class=" + l);
- }
- refresh();
-
- // server name/title
- if (!($admin.configured_core('server_name))) {
- .tell(["", "---"]);
- l = (.prompt("What is your server name? [My Server] ")) || "My Server";
- if (l == "@skip") {
- .tell("Skipping..");
- } else {
- $motd.set_setting("server-name", $motd, l);
- $admin.configured_core('server_name, 1);
- .tell("Server name set to: " + l);
- }
- .tell(["", "You can set this at any time, with the command:"]);
- .tell(" @set $motd:server-name=" + l);
- }
- refresh();
- if (!($admin.configured_core('server_title))) {
- .tell(["", "---"]);
- t = $motd.server_title();
- l = (.prompt(("What is your server title? [" + t) + "] ")) || t;
- if (l == "@skip") {
- .tell("Skipping..");
- } else {
- $motd.set_setting("server-title", $motd, l);
- $admin.configured_core('server_title, 1);
- .tell("Server title set to: " + l);
- }
- .tell(["", "You can set this at any time, with the command:"]);
- .tell(" @set $motd:server-title=" + l);
- }
- refresh();
- if (!($admin.configured_core('daemons))) {
- .tell(["", "---"]);
- while (1) {
- refresh();
- list = ($daemon.children()).setremove($login_daemon);
- .tell("Which network daemons do you want to have automatically startup,");
- .tell("Other than $login_daemon. Available daemons:");
- t = filter l in ($sys.get_startup_objects()) where (l.is($daemon));
- for l in (list) {
- if (l in t)
- .tell(strfmt(" %20s (auto starting)", l));
- else
- .tell(" " + l);
- }
- l = .prompt(("Auto-Start: [" + (t.join(", "))) + "] ");
- if (l == "@skip") {
- .tell("Skipping..");
- break;
- } else if (!l) {
- .tell("Using existing daemons: " + (t.join(", ")));
- break;
- } else {
- err = 0;
- for x in (l.explode_english_list()) {
- catch any {
- $sys.set_setting("startup-objects", $sys, "+" + x);
- .tell(("Added " + x) + " as a startup daemon.");
- } with {
- .tell(("Unable to add '" + x) + "' as a daemon:");
- .tell("=> " + ((traceback()[1])[2]));
- err++;
- }
- }
- if (!err) {
- $admin.configured_core('daemons, 1);
- break;
- }
- .tell("Errors occurred...");
- }
- }
- .tell(["", "You can set this at any time, with the command:"]);
- .tell(" @set $motd:startup-objects=OBJECTS...");
- }
-
- // Other things to add: HTTP Virtual Hosting info,
- // cleanup
- list = $admin.list_method('login);
- list = filter l in (list) where (!match_regexp(l, "\.configure_core\(\);"));
- if (list)
- $admin.add_method(list, 'login);
- else
- $admin.del_method('login);
- $admin.del_var('configured_core);
- $admin.add_var('configured_core);
- .tell(["", strfmt("%79{*}c", " Configuration Complete ")]);
-};
-
-public method .configured_core() {
- arg item, @yes;
-
- if (!yes)
- return (| configured_core[item] |) || 0;
- configured_core = configured_core.add(item, 1);
-};
-
-public method .core_admin() {
- var code, defs;
+protected method .chmanage_cmd() {
+ arg cmdstr, cmd, args;
+ var obj, manager;
- catch any {
- .add_var('configured_core);
- configured_core = #[];
- if ((| .find_method('login) |) == $admin)
- code = .list_method('login);
- else
- code = (defs = []);
- .add_method(code + [".configure_core();"], 'login);
- } with {
- $sys.log($parse_lib.traceback());
- }
+ (> .perms(caller(), 'command) <);
+ args = (args.replace(" to ", " ")).explode();
+ if ((!args) || ((args.length()) != 2))
+ (> .tell_error(cmd + " <object> [to] <user>") <);
+ obj = .match_env_nice(args[1]);
+ manager = .match_env_nice(args[2]);
+ if ((!(manager.is($user))) && (!(.is($admin))))
+ return "Sorry you can only set users as managers.";
+ catch any
+ (> obj.change_manager(manager) <);
+ with
+ return (traceback()[1])[2];
+ return ((("Manager on " + (obj.namef('xref))) + " changed to ") + (manager.namef('xref))) + ".";
};
protected method .core_cmd() {
@@ -389,14 +261,31 @@
$sys.new_admin();
};
-public method .login() {
+public method .kick_cmd() {
+ arg cmdstr, cmd, user;
+ var x, u;
+
+ (> .check_mojo() <);
+ catch ~namenf {
+ u = $user_db.match(user);
+ u.tell((sender().name()) + " has kicked you from the system.");
+ pause();
+ for x in (u.connections())
+ x.destroy();
+ sender().tell((u.name()) + " has been kicked from the system.");
+ } with {
+ sender().tell(("Usage: " + cmd) + " <player name>.");
+ }
+};
+
+protected method .login() {
arg connection;
pass(connection);
- .configure_core();
+ $sys.configure_core();
};
-public method .logout() {
+protected method .logout() {
arg @args;
(| $sys.del_from_system(this()) |);
@@ -405,16 +294,13 @@
protected method .mojo() {
arg @args;
- var name;
+ var mojo_what;
- if (args)
- name = "Your ";
- else
- name = (.name()) + "'s ";
- if (this() in ($sys.system()))
- return name + "eyes glow from Mojo.";
+ if (!(this() in ($sys.system())))
+ mojo_what = "do not ";
else
- return name + "eyes do not glow from Mojo.";
+ mojo_what = "";
+ return .eval_message("mojo-look", $admin, #[["$actor", this()], ["actor", .name()], ["actor.pp", (.gender()).pronoun('pp)], ["mojo.what", mojo_what]]);
};
protected method .mojo_cmd() {
@@ -438,6 +324,19 @@
}
};
+public method .move_cmd() {
+ arg cmd, cmdstr, args;
+ var how;
+
+ // Is this moving or a copy?
+ how = match_begin(cmd, "@c") ? 'copy : 'move;
+ if (how == 'move) {
+ if ((((args[1])[1]) == 'object) && (((args[1])[2]).is($user)))
+ (> .check_mojo('benice) <);
+ }
+ return pass(cmd, cmdstr, args);
+};
+
protected method .new_password_cmd(): nooverride {
arg cmdstr, cmd, user;
var new, email;
@@ -449,7 +348,7 @@
return (user.namef('ref)) + " does not have an email address!";
new = $code_lib.random_password();
catch any {
- $smtp.sendmail('admin, email, ("[" + ($motd.server_name())) + "] password change.", ((("The password for the user " + (user.name())) + " on ") + ($motd.server_name())) + " has been changed to:", "", " " + new, "", "This is an automatic message sent to the supplied address. If this message is in error simply discard it.", "", "This password was changed by " + (.name()));
+ $smtp.sendmail('admin, email, ("[" + ($motd.server_name())) + "] password change.", [((("The password for the user " + (user.name())) + " on ") + ($motd.server_name())) + " has been changed to:", "", " " + new, "", "This is an automatic message sent to the supplied address. If this message is in error simply discard it.", "", "This password was changed by " + (.name())]);
} with {
.tell_traceback(traceback());
return "** Unable to send mail message, password not changed **";
@@ -507,7 +406,7 @@
t = time();
reap = [];
- .tell([("--- Reap Possibilities (Not connected for " + ($time.to_english(thresh))) + ")", strfmt("E %28L %3l %12l %12l %l", "User", "MNG", "Notified", "Last On", "Age"), strfmt("- %28L %3l %12l %12l %l", "----", "---", "-------", "-------", "---")]);
+ .tell([("--- Reap Possibilities (Not connected for " + ($time.to_english(thresh))) + ")", strfmt("E %21L %3l %10l %10l %10l %l", "User", "MNG", "Created", "Notified", "Last On", "Idle"), strfmt("- %21L %3l %10l %10l %10l %l", "----", "---", "-------", "-------", "-------", "----")]);
for u in ($user.descendants()) {
if ((u.connected()) || ((u.has_flag('core)) || (u.is($admin))))
continue;
@@ -533,10 +432,10 @@
if (!m)
m = "newborn";
if (u.reap_notified())
- n = $time.format("%v", u.reap_notified());
+ n = $time.format("%e-%b-%y", u.reap_notified());
else
n = "";
- reap += [[last, strfmt("%s %28L %3l %12l %12l %l", ((u.get_setting("rl-email", $user_info))[2]) ? " " : "!", u.namef('xref), listlen(u.managed()), n, $time.format("%v", last), m)]];
+ reap += [[last, strfmt("%s %21L %3l %10l %10l %10l %l", ((u.get_setting("rl-email", $user_info))[2]) ? " " : "!", u.name(), listlen(u.managed()), $time.format("%e-%b-%y", u.created_on()), n, $time.format("%e-%b-%y", last), m)]];
}
.tell(((reap.sort()).slice(2)).reverse());
return "---";
@@ -567,7 +466,7 @@
if (!(> $parse_lib.ask("Send this email message? [yes] ", "(yes|y)", "yes") <))
return "Message not sent.";
catch any {
- $smtp.sendmail('admin, email, subj, @msg);
+ $smtp.sendmail('admin, email, subj, msg);
} with {
.tell_traceback(traceback());
return "** Unable to send message";
@@ -686,49 +585,36 @@
(> .perms(caller(), 'command) <);
(> .check_mojo() <);
- purge = (o = "p?urge" in ((args[2]).slice(1))) && (((args[2])[o])[3]);
- if (purge) {
- .tell("Building descendants list..");
- pause();
- pause();
- user_interfaces = $user_interfaces.descendants();
- other = (((($command_cache.children()).setremove($user_interfaces)).mmap('descendants)).flatten()).compress();
+ .tell("Purging caches..");
pause();
pause();
// go atomic, we do not want confused users trying to run commands that
// do not exist...
$sys.atomic(1);
- for o in (other + user_interfaces) {
- if (o.is_command_cache())
- .tell("Purging " + (o.namef('ref)));
- (| o.purge_caches() |);
+
+ // purge everything
+ for o in ($command_cache.descendants()) {
+ (| o.purge_cache() |);
refresh();
}
- // get back 'other' caches--nobody said this was going to be fast.
+ // rehash non-general caches
+ other = ($command_cache.children()).setremove($user_interfaces);
+ other = ((other.mmap('descendants)).flatten()).compress();
for o in (other) {
- o.rehash_caches();
+ if (!(o.is_general_cache())) {
+ (| o.rehash_cache() |);
refresh();
}
}
+ $remote_cache.rehash_cache();
- // user caches
+ // re-init user clients
initted = #[];
for o in ((| $user_db.connected() |) || [this()]) {
- for p in ((| o.parents() |) || []) {
- if (!(initted.contains(p))) {
- .tell("Initializing " + (p.namef('ref)));
- catch any {
- (> p.rehash_caches() <);
- } with {
- .tell(("--- traceback from " + p) + ".cache_init():");
- .tell_traceback(traceback());
- .tell("---");
- }
- initted = initted.add(p, 1);
- }
- }
+ .tell("Initializing " + (o.namef('ref)));
+ o.cache_client_init();
refresh();
}
@@ -762,6 +762,61 @@
}
.tell("Ok!");
$sys.do_shutdown(time, why);
+};
+
+protected method .status_cmd() {
+ arg cmdstr, com, @args;
+ var opt, cache, x, y, width, depth, info, out, str, pre, dstr, dirty, c;
+
+ (> .perms(caller(), 'command) <);
+ opt = $parse_lib.opt(args.join(" "), "c?ache", "d?irtyonly");
+ if ((x = "c?ache" in ((opt[2]).slice(1))))
+ cache = 1;
+ if (!cache)
+ return pass(cmdstr, com, @args);
+ [width, depth, info] = $sys.cache_info();
+ out = [((((("Cache Size: " + width) + "x") + depth) + " (") + (width * depth)) + " total object capacity)"];
+ info = map x in (info) to (strsub(x, "i", ".", "c"));
+ if (width < 80) {
+ if (width < 78) {
+ pre = 1;
+ str = " +";
+ } else {
+ pre = 0;
+ str = "";
+ }
+ str = strfmt(str + "%*{-}c", width, " WIDTH ");
+ out += ["Cache Map (Horizontal):", str];
+ dstr = "DEPTH";
+ for y in [1 .. depth] {
+ if (pre) {
+ if (y <= strlen(dstr))
+ str = (dstr[y]) + "|";
+ else
+ str = " |";
+ } else {
+ str = "";
+ }
+ for x in [1 .. width] {
+ refresh();
+ if (strlen(info[x]) >= y) {
+ c = (info[x])[y];
+ str += (info[x])[y];
+ } else {
+ str += " ";
+ }
+ }
+ out += [str];
+ }
+ if (pre)
+ out += [" +" + ("-" * width)];
+ else
+ out += ["-" * width];
+ } else {
+ str = strfmt(" +%*{-}c", depth, " DEPTH ");
+ out += ["Cache Map (Vertical):", str] + (info.prefix(" |"));
+ }
+ return out + ["Object Legend: a=active, A=active+dirty, .=inactive, I=inactive+dirty"];
};
protected method .tasks_cmd() {
diff -rwu ColdCore-3.0a9.02/src/ansi_format.cdc ColdCore-3.0a10/src/ansi_format.cdc
--- ColdCore-3.0a9.02/src/ansi_format.cdc Sat Mar 14 15:40:26 1998
+++ ColdCore-3.0a10/src/ansi_format.cdc Sat Mar 14 15:49:03 1998
@@ -1,5 +1,5 @@
-new object $ansi_format: $plain_format;
+new object $ansi_format: $tagged_format;
var $ansi_format bcolors = #[["black", "40"], ["red", "41"], ["green", "42"], ["yellow", "43"], ["blue", "44"], ["magenta", "45"], ["cyan", "46"], ["white", "47"]];
var $ansi_format colors = #[["black", "30"], ["red", "31"], ["green", "32"], ["yellow", "33"], ["blue", "34"], ["magenta", "35"], ["cyan", "36"], ["white", "37"]];
@@ -10,6 +10,168 @@
var $root managed = [$ansi_format];
var $root manager = $ansi_format;
+public method .ansi_wrap_line() {
+ arg str, len, @stuff;
+ var output, cutoff, firstline, prefix, plen, x, ansilist, lengthvals, counter, elem, wordlist, wordsum, flag;
+
+ // Thanks Scott for letting me port this back from TEC.
+ // - Bruce
+ // takes string and wraps it by words, compared to length, returns a list.
+ [(prefix ?= ""), (firstline ?= 0)] = stuff;
+ output = "";
+ if (firstline)
+ str = prefix + str;
+ plen = strlen(prefix);
+ while (strlen(str) > len) {
+ refresh();
+ flag = "\n";
+ counter = 0;
+
+ // Check for ansi codes first
+ ansilist = .weed_ansi(str);
+
+ // If there are ansi codes, do the spiel, otherwise do a regular
+ // line wrap (this can happen on a segment by segment basis)
+ if (listlen(ansilist) > 1) {
+ // create a word-only list w/o the ansi codes, and a letter-count
+ // list both for the entire list and for the word-only list
+ lengthvals = map x in (ansilist) to (strlen(x));
+ wordlist = ansilist.odds();
+ wordsum = map x in (wordlist) to (strlen(x)).sum();
+
+ // wordsum = lengthvals.odds().sum();
+ // if the letter-count for the word-only list is greater than the
+ // line length, then we'll need to hack it up, otherwise, we'll
+ // just use the length of the entire line, codes and all
+ if (wordsum > len) {
+ // We've got too many letters. Have to find out where in
+ // the word (non-ansi-code) part of the string the len is.
+ // we mark its spot in the master list, but only count its
+ // letter value if it's really a word. We also need to
+ // remember how many letters we've gone through before
+ // possibly hitting a big chunk of string (counter).
+ elem = find x in (ansilist) where ((x in wordlist) && ((counter += strlen(x)) > len));
+ if (elem)
+ counter -= strlen(x);
+
+ // Going to establish where to cut the string. Take the
+ // sum of the letter-count list up to the marker we just found
+ cutoff = (lengthvals.subrange(1, elem - 1)).sum();
+
+ // We already know the string is too long for a line, or we
+ // wouldn't be here. If the counter is less than our line length
+ // it probably means the next element was too long to add,
+ // (a big chunk of string with no codes) so we'll tack on the
+ // len - our counter value.
+ if (counter < len)
+ cutoff += len - counter;
+ cutoff = stridx(substr(str, 1, cutoff), " ", -1);
+ } else {
+ cutoff = lengthvals.sum();
+ flag = "";
+ }
+ } else {
+ cutoff = stridx(substr(str, 1, len), " ", -1);
+ }
+
+ // The rest of this has been tweaked slightly. The main goal was to
+ // get cutoff vals that this section of the code will be happy with.
+ if (cutoff <= plen) {
+ output += "\n" + substr(str, 1, len);
+ str = prefix + substr(str, len + 1);
+ } else {
+ output += "\n" + substr(str, 1, cutoff);
+ str = prefix + substr(str, cutoff + 1);
+ }
+ }
+
+ // Here's the tweak and the pain in the ass I'd like solved. When the
+ // length of the word value of the string matches the line length, the
+ // extra "\n" a the end causes extra spacing for .atelln()
+ return (output ? ((output.subrange(3)) + flag) : "") + str;
+};
+
+public method .ansi_wrap_lines() {
+ arg str, len, @stuff;
+ var output, cutoff, firstline, prefix, plen, x, ansilist, lengthvals, counter, elem, wordlist, wordsum, flag;
+
+ // Thanks Scott for letting me port this back from TEC.
+ // - Bruce
+ // takes string and wraps it by words, compared to length, returns a list.
+ [(prefix ?= ""), (firstline ?= 0)] = stuff;
+ output = [];
+ if (firstline)
+ str = prefix + str;
+ plen = strlen(prefix);
+ while (strlen(str) > len) {
+ refresh();
+ flag = "\n";
+ counter = 0;
+
+ // Check for ansi codes first
+ ansilist = .weed_ansi(str);
+
+ // If there are ansi codes, do the spiel, otherwise do a regular
+ // line wrap (this can happen on a segment by segment basis)
+ if (listlen(ansilist) > 1) {
+ // create a word-only list w/o the ansi codes, and a letter-count
+ // list both for the entire list and for the word-only list
+ lengthvals = map x in (ansilist) to (strlen(x));
+ wordlist = ansilist.odds();
+ wordsum = map x in (wordlist) to (strlen(x)).sum();
+
+ // wordsum = lengthvals.odds().sum();
+ // if the letter-count for the word-only list is greater than the
+ // line length, then we'll need to hack it up, otherwise, we'll
+ // just use the length of the entire line, codes and all
+ if (wordsum > len) {
+ // We've got too many letters. Have to find out where in
+ // the word (non-ansi-code) part of the string the len is.
+ // we mark its spot in the master list, but only count its
+ // letter value if it's really a word. We also need to
+ // remember how many letters we've gone through before
+ // possibly hitting a big chunk of string (counter).
+ elem = find x in (ansilist) where ((x in wordlist) && ((counter += strlen(x)) > len));
+ if (elem)
+ counter -= strlen(x);
+
+ // Going to establish where to cut the string. Take the
+ // sum of the letter-count list up to the marker we just found
+ cutoff = (lengthvals.subrange(1, elem - 1)).sum();
+
+ // We already know the string is too long for a line, or we
+ // wouldn't be here. If the counter is less than our line length
+ // it probably means the next element was too long to add,
+ // (a big chunk of string with no codes) so we'll tack on the
+ // len - our counter value.
+ if (counter < len)
+ cutoff += len - counter;
+ cutoff = stridx(substr(str, 1, cutoff), " ", -1);
+ } else {
+ cutoff = lengthvals.sum();
+ flag = "";
+ }
+ } else {
+ cutoff = stridx(substr(str, 1, len), " ", -1);
+ }
+
+ // The rest of this has been tweaked slightly. The main goal was to
+ // get cutoff vals that this section of the code will be happy with.
+ if (cutoff <= plen) {
+ output += [substr(str, 1, len)];
+ str = prefix + substr(str, len + 1);
+ } else {
+ output += [substr(str, 1, cutoff)];
+ str = prefix + substr(str, cutoff + 1);
+ }
+ }
+
+ // Here's the tweak and the pain in the ass I'd like solved. When the
+ // length of the word value of the string matches the line length, the
+ // extra "\n" a the end causes extra spacing for .atelln()
+ return output + [str];
+};
+
public method .do_detail() {
arg vars, flags, args;
@@ -80,16 +242,16 @@
public method .format() {
arg data, vars;
- var str, len, line, out;
+ var str, len, line;
str = (> (._eval_ctext(data, vars))[1] <);
if ((strlen(str) < 2) || (substr(str, strlen(str) - 1) != "\n"))
str += "\n";
// ugly and inneficient--use a client people
- out = str_to_buf(str);
- out = out.bufsub(`[92, 65], `[27, 91]);
- return out;
+ // out = str_to_buf(str);
+ // out = out.bufsub(`[92, 65], `[27, 91]);
+ return str_to_buf(str).bufsub(`[92, 65], `[27, 91]);
};
public method .hold_rewrap_lines() {
@@ -136,6 +136,33 @@
output += tstr;
}
return output + [str];
+};
+
+public method .rewrap_lines() {
+ arg vars, str, prefix;
+ var s, p, n, firstline;
+
+ s = [];
+ n = (vars['width]) + (prefix.length());
+ for str in (str.explode("\n", 1))
+ s += .ansi_wrap_lines(str, n, prefix, 1);
+ return s.join("\n");
+};
+
+public method .tag_text() {
+ arg str;
+ var mode, token;
+
+ return map token in (.weed_ansi(str)) to ((mode = !mode) ? token : "").join("");
+};
+
+public method .weed_ansi() {
+ arg str;
+ var out;
+
+ out = str.global_regexp("[\]A[0-9A-LN-Za-ln-z;]+m");
+ return out;
+ return str.global_regexp("\\\A[0-9A-Ln-z;a-ln-z;]+[a-z]");
};
diff -rwu ColdCore-3.0a9.02/src/antisocial.cdc ColdCore-3.0a10/src/antisocial.cdc
--- ColdCore-3.0a9.02/src/antisocial.cdc Sat Mar 14 15:40:32 1998
+++ ColdCore-3.0a10/src/antisocial.cdc Sat Mar 14 15:49:07 1998
@@ -2,6 +2,9 @@
new object $antisocial: $user_interfaces;
var $antisocial antisocial_msgs = #[["feh", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " kicks ", <$generator, ["who", [], [], 'gen_who]>, " rather firmly in the kiester."], #[['this, $antisocial]]]>]];
+var $command_cache commands = 0;
+var $command_cache modules = [];
+var $command_cache shortcuts = 0;
var $foundation defined_msgs = #[["ice", #[['branches, ["general", "actor", "who"]]]], ["eye", #[['branches, ["general", "actor", "who"]]]], ["pat", #[['branches, ["general", "actor", "who"]]]], ["pummel", #[['branches, ["general", "actor", "who"]]]], ["prod", #[['branches, ["general", "actor", "who"]]]], ["kick", #[['branches, ["general", "actor", "who"]]]], ["hug", #[['branches, ["general", "actor", "who"]]]], ["beat", #[['branches, ["general", "actor", "who"]]]], ["hit", #[['branches, ["general", "actor", "who"]]]], ["peer", #[['branches, ["general", "actor", "who"]]]], ["bite", #[['branches, ["general", "actor", "who"]]]], ["nip", #[['branches, ["general", "actor", "who"]]]], ["poke", #[['branches, ["general", "actor", "who"]]]], ["bonk", #[['branches, ["general", "actor", "who"]]]], ["fart", #[['branches, ["general", "actor", "who"]]]]];
var $foundation msgs = #[["ice", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " pours a bucket of ice water over ", <$generator, ["who", [], [], 'gen_who]>, "'s head."], #[]]>], ["actor", <$ctext_frob, [["You pour a bucket of ice water over ", <$generator, ["who", [], [], 'gen_who]>, "'s head."], #[]]>], ["who", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " pours a bucket of ice water over your head."], #[]]>]]], ["eye", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " eyes ", <$generator, ["who", [], [], 'gen_who]>, " warily."], #[]]>], ["actor", <$ctext_frob, [["You eye ", <$generator, ["who", [], [], 'gen_who]>, " warily."], #[]]>], ["who", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " eyes you warily."], #[]]>]]], ["pat", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " pats ", <$generator, ["who", [], [], 'gen_who]>, " onna head."], #[]]>], ["actor", <$ctext_frob, [["You pat ", <$generator, ["who", [], [], 'gen_who]>, " onna head."], #[]]>], ["who", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " pats you onna head."], #[]]>]]], ["pummel", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " pummels ", <$generator, ["who", [], [], 'gen_who]>, " into a milky white substance."], #[]]>], ["actor", <$ctext_frob, [["You pummel ", <$generator, ["who", [], [], 'gen_who]>, " into a milky white substance."], #[]]>], ["who", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " pummels you into a milky white substance. ouch."], #[]]>]]], ["prod", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " prods ", <$generator, ["who", [], [], 'gen_who]>, " with a cowpoke."], #[]]>], ["actor", <$ctext_frob, [["You prod ", <$generator, ["who", [], [], 'gen_who]>, " with a cowpoke."], #[]]>], ["who", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " prods you with a cowpoke. ouch."], #[]]>]]], ["kick", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " kicks ", <$generator, ["who", [], [], 'gen_who]>, " firmly in the kiester."], #[]]>], ["actor", <$ctext_frob, [["You kick ", <$generator, ["who", [], [], 'gen_who]>, " firmly in the kiester."], #[]]>], ["who", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " kicks you firmly in the kiester."], #[]]>]]], ["hug", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " bear hugs ", <$generator, ["who", [], [], 'gen_who]>, "."], #[]]>], ["actor", <$ctext_frob, [["You bear hug ", <$generator, ["who", [], [], 'gen_who]>, "."], #[]]>], ["who", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " bear hugs you. oif."], #[]]>]]], ["beat", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " pulls out a stick and beats the ", <$generator, ["who", [], [], 'gen_who]>, " repeatedly."], #[]]>], ["actor", <$ctext_frob, [["You pull out a stick and beat the ", <$generator, ["who", [], [], 'gen_who]>, " repeatedly."], #[]]>], ["who", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " pulls out a stick and beats you repeatedly."], #[]]>]]], ["hit", #[["general", <$ctext_frob, [["Boldly, ", <$generator, ["actor", [], [], 'gen_actor]>, " pulls out a stick and beats the ", <$generator, ["who", [], [], 'gen_who]>, " repeatedly."], #[]]>], ["actor", <$ctext_frob, [["Boldly, you pull out a stick and beat the ", <$generator, ["who", [], [], 'gen_who]>, " repeatedly."], #[]]>], ["who", <$ctext_frob, [["Boldly, ", <$generator, ["actor", [], [], 'gen_actor]>, " pulls out a stick and beats you repeatedly. oif."], #[]]>]]], ["peer", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " peers suspiciously at ", <$generator, ["who", [], [], 'gen_who]>, "."], #[]]>], ["actor", <$ctext_frob, [["You peer suspiciously at ", <$generator, ["who", [], [], 'gen_who]>, "."], #[]]>], ["who", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " peers suspiciously at you."], #[]]>]]], ["bite", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " BITES ", <$generator, ["who", [], [], 'gen_who]>, "."], #[]]>], ["actor", <$ctext_frob, [["You BITE ", <$generator, ["who", [], [], 'gen_who]>, "."], #[]]>], ["who", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " BITES you."], #[]]>]]], ["nip", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " nips at ", <$generator, ["who", [], [], 'gen_who]>, "."], #[]]>], ["actor", <$ctext_frob, [["You nip at ", <$generator, ["who", [], [], 'gen_who]>, "."], #[]]>], ["who", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " nips at you."], #[]]>]]], ["poke", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " firmly jabs ", <$generator, ["pro", [["actor", 1]], ["pp"], 'gen_pro]>, " index finger into ", <$generator, ["who", [], [], 'gen_who]>, "'s ribs."], #[]]>], ["actor", <$ctext_frob, [["You jab your index finger firmly into ", <$generator, ["who", [], [], 'gen_who]>, "'s ribs."], #[]]>], ["who", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " firmly jabs ", <$generator, ["pro", [["actor", 1]], ["pp"], 'gen_pro]>, " index finger into your ribs. oif."], #[]]>]]], ["bonk", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " maliciously bonks ", <$generator, ["who", [], [], 'gen_who]>, " onna head."], #[]]>], ["actor", <$ctext_frob, [["You maliciously bonk ", <$generator, ["who", [], [], 'gen_who]>, " onna head."], #[]]>], ["who", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " maliciously bonks you onna head. oif."], #[]]>]]], ["fart", #[["general", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " farts in ", <$generator, ["who", [], [], 'gen_who]>, "'s general direction."], #[]]>], ["actor", <$ctext_frob, [["You fart in ", <$generator, ["who", [], [], 'gen_who]>, "'s general direction."], #[]]>], ["who", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " farts in your general direction."], #[]]>]]]];
var $has_commands local = \
@@ -35,7 +35,7 @@
var $has_commands remote = #[];
var $has_commands shortcuts = #[];
var $root created_on = 838182893;
-var $root flags = ['variables, 'methods, 'code, 'command_cache, 'fertile, 'core];
+var $root flags = ['variables, 'methods, 'code, 'fertile, 'core, 'general_cache];
var $root inited = 1;
var $root managed = [$antisocial];
var $root manager = $antisocial;
diff -rwu ColdCore-3.0a9.02/src/bad_commands.cdc ColdCore-3.0a10/src/bad_commands.cdc
--- ColdCore-3.0a9.02/src/bad_commands.cdc Sat Mar 14 15:40:30 1998
+++ ColdCore-3.0a10/src/bad_commands.cdc Sat Mar 14 15:49:04 1998
@@ -2,6 +2,9 @@
new object $bad_commands: $user_interfaces;
var $bad_commands non_supported_cmds = #[["quit", "@quit"], ["WHO", "@who"], ["@create", "@new"], ["help", "@help"], ["news", "@news"], ["page", "@page"], ["@gender", "@set gender"], ["uptime", "@status"], ["@alias", "@add-command-alias` or `@add-name-alias"], ["@check", "@monitor"], ["@paranoid", "@monitor"], ["@version", "@status"], ["@lock", "@set lock"], ["@unlock", "@set lock"], ["+com", ["See: `@help Channels`"]]];
+var $command_cache commands = 0;
+var $command_cache modules = [];
+var $command_cache shortcuts = 0;
var $has_commands local = \
#[["@create", [["@create", "*", "@create <any>", 'old_command_cmd, #[[1, ['any, []]]]]]],\
["help",\
diff -rwu ColdCore-3.0a9.02/src/body.cdc ColdCore-3.0a10/src/body.cdc
--- ColdCore-3.0a9.02/src/body.cdc Sat Mar 14 15:40:29 1998
+++ ColdCore-3.0a10/src/body.cdc Sat Mar 14 15:49:04 1998
@@ -7,6 +7,9 @@
var $body interaction = 0;
var $body remote_command_cache = 0;
var $body wearing = [];
+var $command_cache commands = 0;
+var $command_cache modules = [];
+var $command_cache shortcuts = 0;
var $described prose = [];
var $has_commands local = \
#[["wh?isper", [["wh?isper", "* to *", "wh?isper <any> to <any>", 'whisper_cmd, #[[1, ['any, []]], [3, ['any, []]]]]]],\
@@ -36,8 +39,7 @@
var $located obvious = 1;
*var $location contents = ' ' body.cdc
var $root created_on = 796268969;
-var $root fertile = 1;
-var $root flags = ['methods, 'code, 'fertile, 'variables, 'core, 'command_cache];
+var $root flags = ['methods, 'code, 'variables, 'core, 'general_cache];
var $root inited = 1;
var $root managed = [$body];
var $root manager = $body;
@@ -119,6 +121,7 @@
// else
// o += [.gender().pronoun('psc) + " is naked, baring it all to the world."];
+ if (o != [])
ctext += [$ctext_frob.new_with(o)];
return ctext;
};
@@ -160,8 +163,20 @@
.tell_realm_announce(origin, args[1]);
};
+public method .get_cols() {
+ arg @args;
+
+ return 80;
+};
+
+public method .get_rows() {
+ arg @args;
+
+ return 79;
+};
+
protected method .handle_parser_result() {
- arg action, @more;
+ arg line, action, @more;
var r, c;
switch (action) {
@@ -173,17 +188,35 @@
.ptell(r, #[['type, 'parser], ['command, more[2]]]);
case 'failed:
for c in (($place_lib.coordinate_shortcuts()).keys()) {
- if (action.match_template(c)) {
- .tell(("There is no exit " + action) + " here.");
+ if (line.match_template(c)) {
+ .tell(("There is no exit " + line) + " here.");
r = 1;
}
}
if (!r)
- .tell(("I don't understand " + (action.chop((.actionlen()) - 22))) + ".");
+ .tell(("I don't understand " + (line.chop((.linelen()) - 22))) + ".");
case 'ok:
// do nothing, probably a null command
default:
- ._tell("Unusual response from the parser: " + toliteral(more));
+ ._tell("Unusual response from the parser: " + more);
+ }
+};
+
+public method .linelen() {
+ return 79;
+};
+
+public method .match_env_nice() {
+ arg name, @syntax;
+ var obj, args, line;
+
+ catch any {
+ return (> .match_environment(name) <);
+ } with {
+ if (syntax)
+ (> .tell_error(syntax[1], (traceback()[1])[2]) <);
+ else
+ throw(~stop, (traceback()[1])[2]);
}
};
@@ -216,7 +249,7 @@
if (userdb)
target = (| $user_db.match_begin(recip) |);
if (!target) {
- catch ~objnf
+ catch ~objnf, ~namenf, ~invdbref
target = (> .match_environment(recip) <);
with
throw(~stop, (traceback()[1])[2]);
@@ -366,8 +399,27 @@
};
+public method .tell_error() {
+ arg syntax, @problem;
+ var problem, line, sprefix, prefix, length;
+
+ // arg 1 == syntax
+ // arg 2 == problem lines
+ length = .linelen();
+ if (syntax)
+ .tell(("=> Syntax: `" + syntax) + "`");
+ if (problem) {
+ for line in (problem) {
+ if (type(line) == 'string)
+ line = line.wrap_lines(length, "! ", 1);
+ .tell(line);
+ }
+ }
+ throw(~stop, "");
+};
+
public method .tell_realm_announce() {
- arg realm, message;
+ arg last_realm, message;
var loc, realm, propagator, prop_list, len, i;
pause();
@@ -376,8 +428,10 @@
return;
prop_list = [propagator];
realm = (.location()).realm();
+ if (type(message) == 'symbol)
+ message = realm.eval_message(tostr(message), $realm, realm.ctext_variables());
while (realm != $realm) {
- if (realm == realm) {
+ if (realm == last_realm) {
len = prop_list.length();
for i in [1 .. len] {
message = message.propagate(prop_list[(len - i) + 1]);
@@ -385,6 +439,7 @@
return;
}
.tell(message);
+ return;
}
if (!(propagator = realm.will_propagate()))
return;
@@ -409,13 +464,16 @@
protected method .to_say_cmd() {
arg cmdstr, com, who, prep, message;
- var targets, target, line;
+ var targets, target, line, invobj, here;
(> .perms(caller(), $user, $body) <);
catch ~ambig
targets = (> .parse_interaction_reference(who, "say") <);
with
return (traceback()[1])[2];
+ here = .location();
+ if ((invobj = filter target in (targets) where ((target.location()) != here)))
+ return .tell(((invobj.to_english()) + (((invobj.length()) > 1) ? " are " : " is ")) + "not here in this location.");
.add_interaction('objs, targets);
line = (((.name()) + " (to ") + ((targets.mmap('name)).to_english())) + ") ";
if (message)
@@ -483,7 +483,7 @@
// exits should always be able to pull "bodies" through them
// this becomes sortof a big override returning, but ... *shrug*
- if (mover.is($exit))
+ if (mover.is($path))
return;
(> pass(mover, place) <);
};
diff -rwu ColdCore-3.0a9.02/src/body_cave.cdc ColdCore-3.0a10/src/body_cave.cdc
--- ColdCore-3.0a9.02/src/body_cave.cdc Sat Mar 14 15:40:33 1998
+++ ColdCore-3.0a10/src/body_cave.cdc Sat Mar 14 15:49:06 1998
@@ -1,13 +1,17 @@
new object $body_cave: $place;
+var $command_cache commands = 0;
+var $command_cache modules = [];
+var $command_cache shortcuts = 0;
var $described prose = [];
+var $event_handler hooked = #[];
var $event_handler hooks = #[];
var $has_commands local = #[];
var $has_commands remote = #[];
var $has_commands shortcuts = #[];
var $has_name name = ['uniq, "Body Cave", "the Body Cave"];
*var $location contents = ' ' body_cave.cdc
var $physical visibility = -100;
var $place entrances = [];
var $place exits = [];
@@ -22,6 +22,12 @@
public method .announce() {
arg @who_cares;
+};
+
+public method .will_attach() {
+ arg type, @by_whom;
+
+ throw(~perm, "Place is not publicly extendable.");
};
diff -rwu ColdCore-3.0a9.02/src/bug_handler.cdc ColdCore-3.0a10/src/bug_handler.cdc
--- ColdCore-3.0a9.02/src/bug_handler.cdc Sat Mar 14 15:40:25 1998
+++ ColdCore-3.0a10/src/bug_handler.cdc Sat Mar 14 15:49:25 1998
@@ -1,11 +1,10 @@
-new object $bug_handler: $misc, $has_name;
+new object $bug_handler: $misc;
var $bug_handler ticker = 0;
-var $bug_handler ticket = 30;
-var $bug_handler unclaimed_tally = 4;
+var $bug_handler ticket = 134;
+var $bug_handler unclaimed_tally = 26;
var $dmi_data descriptions = #[];
-var $has_name name = ['uniq, "Bug Report Handler", "the Bug Report Handler"];
var $root created_on = 866643320;
var $root flags = ['variables, 'methods, 'code, 'core];
var $root inited = 1;
diff -rwu ColdCore-3.0a9.02/src/builder.cdc ColdCore-3.0a10/src/builder.cdc
--- ColdCore-3.0a9.02/src/builder.cdc Sat Mar 14 15:40:31 1998
+++ ColdCore-3.0a10/src/builder.cdc Sat Mar 14 15:49:05 1998
@@ -4,6 +4,9 @@
var $channel_ui active_channels = #[];
var $channel_ui channel_dict = #[];
var $command_aliases command_aliases = [];
+var $command_cache commands = 0;
+var $command_cache modules = [];
+var $command_cache shortcuts = 0;
var $described prose = [];
var $foundation defined_msgs = #[["teleport", #[['branches, ["source", "dest", "actor"]]]]];
var $foundation msgs = #[["teleport", #[["actor", <$ctext_frob, [["You teleport to ", <$generator, ["dest", [], [], 'gen_dest]>, "."], #[['this, $builder]]]>], ["source", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " teleports to ", <$generator, ["dest", [], [], 'gen_dest]>, "."], #[['this, $builder]]]>], ["dest", <$ctext_frob, [[<$generator, ["actor", [], [], 'gen_actor]>, " teleports here from ", <$generator, ["source", [], [], 'gen_source]>, "."], #[['this, $builder]]]>]]]];
@@ -41,7 +44,7 @@
var $mail_ui current = #[['location, 0], ['list, $builder]];
var $mail_ui subscribed = #[[$builder, [791485891, 0]]];
var $root created_on = 796268969;
-var $root flags = ['methods, 'code, 'core, 'command_cache, 'variables];
+var $root flags = ['methods, 'code, 'core, 'variables, 'general_cache];
var $root inited = 1;
var $root managed = [$builder];
var $root manager = $builder;
@@ -57,6 +60,231 @@
var $user password = "*";
var $user task_connections = #[];
+protected method ._interactive_bug_cmd() {
+ var choice, category, bug, list, line;
+
+ while (choice != 'exit) {
+ choice = .do_menu("Bug Reports", "bug reports", "1=>Scan unclaimed open bugs", "2=>Scan your open bugs", "3=>Scan all open bugs", 'blank, "4=>Scan all repaired bugs", "5=>Scan all non-archived/non-dismissed", 'blank, "6=>Scan dismissed bugs", "7=>Report a new bug", "X=>Exit the Bug Handler", 'exit);
+ switch (choice) {
+ case "1":
+ // Unclaimed bugs:
+ // Create a list of bug obref's to pass to
+ // .scan_bugs():
+ list = [];
+ for category in ($bug_handler.categories()) {
+ for bug in (category.children()) {
+ if ((!(bug.owner())) && (!(bug.fixed())))
+ list = list + [bug];
+ refresh();
+ }
+ }
+ .scan_bugs(list.reverse());
+ case "2":
+ // Your bugs:
+ list = [];
+ for category in ($bug_handler.categories()) {
+ for bug in (category.children()) {
+ if (((bug.owner()) == this()) && (!(bug.fixed())))
+ list = [@list, bug];
+ refresh();
+ }
+ }
+ .scan_bugs(list.reverse());
+ case "3":
+ // All open bugs:
+ list = [];
+ for category in ($bug_handler.categories()) {
+ for bug in (category.children()) {
+ if (!(bug.fixed())) {
+ list = [@list, bug];
+ refresh();
+ }
+ }
+ }
+ .scan_bugs(list.reverse());
+ case "4":
+ // Scan all closed bugs:
+ list = [];
+ for category in ($bug_handler.categories()) {
+ for bug in (category.children()) {
+ if (bug.fixed()) {
+ list = [@list, bug];
+ refresh();
+ }
+ }
+ }
+ $user_scott.tell(list.to_english());
+ .scan_bugs(list.reverse());
+ case "5":
+ // Scan ALL bugs:
+ list = [];
+ for category in ($bug_handler.categories()) {
+ for bug in (category.children()) {
+ list = [@list, bug];
+ refresh();
+ }
+ }
+ .scan_bugs(list.reverse());
+
+ // case "6":
+ // Archived:
+ // list = $archived_bugs.children();
+ // .scan_bugs(list.reverse());
+ case "6":
+ // Dismissed:
+ list = $dismissed_bugs.children();
+ .scan_bugs(list.reverse());
+ case "7":
+ // Report a new bug:
+ .report_cmd("", "");
+ }
+ }
+ .tell("Exiting bug reports.");
+ $bug_handler.rehash_unclaimed_tally();
+};
+
+protected method ._passive_bug__add() {
+ arg args, opts;
+ var c, b, w, line, bug;
+
+ bug = toint(args[1]);
+
+ // no ticket database that I could find...inefficient this way
+ for c in ($bug_handler.categories()) {
+ for b in (c.children()) {
+ if ((b.ticket_number()) == bug) {
+ w = 1;
+ break;
+ }
+ }
+ }
+ if (!w)
+ return "No bug found with ticket #" + bug;
+
+ // Append Text:
+ .tell("Append text to bug report #" + bug);
+ line = .read();
+ if (line && (type(line) == 'list)) {
+ b.set_text((b.text()) + ["---", ("Addendum by " + (.name())) + ":", @line]);
+ .tell("Text appended.");
+ } else {
+ .tell("Aborted.");
+ }
+};
+
+protected method ._passive_bug__fix() {
+ arg args, opts;
+ var c, b, w, line, bug;
+
+ bug = toint(args[1]);
+
+ // no ticket database that I could find...inefficient this way
+ for c in ($bug_handler.categories()) {
+ for b in (c.children()) {
+ if ((b.ticket_number()) == bug) {
+ w = (b.format()) + ["---"];
+ break;
+ }
+ }
+ }
+ if (!w)
+ return "No bug found with ticket #" + bug;
+ if (b.fixed())
+ return ("Bug #" + bug) + " has already been fixed.";
+ .tell(w);
+ line = .prompt(["[A]bort, do not mark bug as fixed... OR", "Mark bug as fixed, then:", " [P]aste the bug report to the bug list", " [C]ompose a message to send to the list", " [RET] to do nothing"]);
+ if (line == "a") {
+ return "Aborting.";
+ } else if (line == "p") {
+ .bug_fixed("*bug", (.name()) + " has repaired the following bug:", [@$mail_lib.indent_reply(b.forum_format())]);
+ } else if (line == "c") {
+ line = .read();
+ if (line && (type(line) == 'list))
+ .bug_fixed("*bugs", (.name()) + " has repaired the following bug:", [@$mail_lib.indent_reply(b.forum_format())] + line);
+ else
+ return;
+ }
+ b.set_fixed(time());
+ .tell("You have marked this bug as being fixed.");
+};
+
+protected method ._passive_bug__list() {
+ arg args, opts;
+ var c, b, w, line, count, max;
+
+ w = (.linelen()) - 31;
+
+ // show any bugs needing to be fixed
+ if (args)
+ max = toint(args[1]);
+ if (max)
+ .tell(max + " unfixed bugs:");
+ else
+ .tell("All unfixed bugs:");
+ for c in ($bug_handler.categories()) {
+ for b in (c.children()) {
+ if (!(b.fixed())) {
+ .tell(strfmt("%4r: %11l %12l %*e", b.ticket_number(), $time.format("%d-%h-%Y", b.date()), (| (b.reporter()).name() |), w, join(b.text())));
+ count++;
+ }
+ refresh();
+ if (max && (count >= max))
+ break;
+ }
+ }
+ .tell(("--- " + count) + " total");
+};
+
+protected method ._passive_bug__view() {
+ arg args, opts;
+ var c, b, w, line, bug;
+
+ bug = toint(args[1]);
+
+ // no ticket database that I could find...inefficient this way
+ for c in ($bug_handler.categories()) {
+ for b in (c.children()) {
+ if ((b.ticket_number()) == bug)
+ return (b.format()) + ["---"];
+ }
+ }
+ return "No bug found with ticket #" + bug;
+};
+
+protected method ._passive_bug_cmd() {
+ arg args, opts;
+ var c, b, l, line, w, bug, count;
+
+ // this is just a quick solution to have a passive interface,
+ // will have to cruft it up more once I have time to dig into
+ // the bug system and learn its nuances. It is likely not
+ // fully compliant to TEC's bug system--Brandon
+ c = args[1];
+ args = sublist(args, 2);
+ switch (c) {
+ case "a", "add", "addendum":
+ if (!listlen(args))
+ return "No bug specified with '@bug addendum'";
+ return ._passive_bug__add(args, opts);
+ case "l", "list":
+ return ._passive_bug__list(args, opts);
+ case "v", "view":
+ if (!listlen(args))
+ return "No bug specified with '@bug view'";
+ return ._passive_bug__view(args, opts);
+ case "f", "fix":
+ if (!listlen(args))
+ return "No bug specified with '@bug fix'";
+ return ._passive_bug__fix(args, opts);
+ case "h", "help":
+ return "Syntax: @bug [list|view|fix|add?endum] [addtl info]";
+ default:
+ if (c.is_numeric())
+ return ._passive_bug__view([c] + args, opts);
+ return ("Unsupported option '" + c) + "'";
+ }
+};
+
protected method .attach_cmd() {
arg cmdstr, cmd, source, prep, dest;
var exit;
@@ -99,21 +327,6 @@
(> mail.send(list) <);
};
-protected method .build_attach_exit() {
- arg exit, source, dest;
- var line;
-
- catch any {
- exit.attach(source, dest);
- } with {
- .tell(("Unable to attach " + (exit.name())) + " because: ");
- .tell(" " + ((traceback()[1])[2]));
- line = .prompt("Continue building? ");
- if (line in ["no", "n"])
- throw(~abort, "Aborted");
- }
-};
-
protected method .build_cleanup() {
arg @what;
var obj;
@@ -129,7 +342,7 @@
protected method .build_cmd() {
arg cmdstr, cmd, args;
- var dest, source, exits, set, str, i;
+ var dest, source, path, set, str, i;
(> .perms(caller(), 'command) <);
str = (args[1]).join();
@@ -146,18 +359,12 @@
.build_cleanup(dest);
return "** Build Aborted **";
}
- exits = (> .build_get_exits(source, dest[1]) <);
- (> .build_attach_exit(exits[1], source, dest[1]) <);
- (> .build_attach_exit(exits[2], dest[1], source) <);
+ path = (> .build_get_path(source, dest[1]) <);
} with {
if (dest)
.build_cleanup(dest);
- if (exits) {
- if (exits[1])
- .build_cleanup([exits[1], 1]);
- if (exits[2])
- .build_cleanup([exits[2], 1]);
- }
+ if (path)
+ .build_cleanup([path, 1]);
if (error() == ~abort)
return "** Build Aborted **";
return [(traceback()[1])[2], "** Build Aborted **"];
@@ -173,68 +380,61 @@
set = #[['named_name, 1]];
if (dest[2])
(> (dest[1]).configure(set) <);
- if (exits[1])
- (> (exits[1]).configure(set) <);
- if (exits[2])
- (> (exits[2]).configure(set) <);
+ if (path)
+ (> path.configure(set) <);
return "Completed post-configuration.";
};
-protected method .build_generate_exit() {
- arg pname, source, dest;
- var parent, exit, name;
-
- name = pname[1];
- [parent, exit] = (> .build_parse_name(name[1], $exit) <);
- name = replace(name, 1, exit);
- pname = replace(pname, 1, name);
- exit = (| source.match_environment(exit) |);
- if (exit) {
- if (exit.is($exit))
- throw(~stop, (((name[1]) + " is already an exit from ") + (source.name())) + ".");
- if (exit.source())
- throw(~stop, (exit.namef('ref)) + " is alread linked.");
- return exit;
+protected method .build_generate_path() {
+ arg source, dest, spname, @dpname;
+ var parent, path, sname, dname, line;
+
+ sname = spname[1];
+ [parent, path] = (> .build_parse_name(sname[1], $path) <);
+ sname = replace(sname, 1, path);
+ spname = replace(spname, 1, sname);
+ path = (| source.match_environment(path) |);
+ if (path) {
+ if (path.is($path))
+ throw(~stop, (((sname[1]) + " is already a path from ") + (source.name())) + ".");
+ if (path.source(dest))
+ throw(~stop, (path.namef('ref)) + " is alread linked.");
+ }
+ if (dpname) {
+ [dpname] = dpname;
+ dname = dpname[1];
+ [parent, path] = (> .build_parse_name(dname[1], $path) <);
+ dname = replace(dname, 1, path);
+ dpname = replace(dpname, 1, dname);
+ path = (| dest.match_environment(path) |);
+ if (path) {
+ if (path.is($path))
+ throw(~stop, (((dname[1]) + " is already a path from ") + (dest.name())) + ".");
+ if (path.source(source))
+ throw(~stop, (path.namef('ref)) + " is alread linked.");
+ }
}
+ if (!path) {
catch any
- exit = (> parent.new() <);
+ path = (> parent.new() <);
with
- throw(~stop, "Unable to create exit: " + ((traceback()[1])[2]));
- return .build_set_name(exit, @pname);
-};
-
-protected method .build_get_exits() {
- arg source, dest;
- var eleave, earrive, opp, t;
-
- // Get the exits
- catch any {
- eleave = (> .build_query_exit(source, dest) <);
- if (eleave) {
- // try really hard to figure this out
- if (!(opp = $place_lib.opposite_direction(eleave.name()))) {
- for t in (eleave.name_templates()) {
- t = strsed(t, "[^a-z]+", "", "g");
- if ((opp = $place_lib.opposite_direction(eleave.name())))
- break;
- }
- }
- if (opp) {
- opp = strsed(explode(opp, "|")[1], "[^a-z]+", "", "g");
- earrive = (> .build_query_exit(dest, source, opp) <);
- } else {
- earrive = (> .build_query_exit(dest, source) <);
+ throw(~stop, "Unable to create path: " + ((traceback()[1])[2]));
}
+ catch any {
+ path.attach(source, dest);
+ .build_set_name(path, @spname, source);
+ if (dpname) {
+ path.attach(dest, source);
+ .build_set_name(path, @dpname, dest);
}
} with {
- if (eleave) {
- .build_cleanup([eleave, 1]);
- if (earrive)
- .build_cleanup([earrive, 1]);
- }
- rethrow(error());
+ .tell(("Unable to attach " + (path.name())) + " because: ");
+ .tell(" " + ((traceback()[1])[2]));
+ line = .prompt("Continue building? ");
+ if (line in ["no", "n"])
+ throw(~abort, "Aborted");
}
- return [eleave, earrive];
+ return path;
};
protected method .build_get_location() {
@@ -305,6 +505,9 @@
// set the realm
dest.set_setting_realm($place, "realm", realm);
+ // add this room to realm's 'local' variable
+ realm.add_local(dest);
+
// okee, done
return [dest, 1];
};
@@ -322,6 +525,47 @@
return out;
};
+protected method .build_get_path() {
+ arg source, dest;
+ var eleave, earrive, opp, t, path;
+
+ // Get the exits
+ // catch any {
+ while (!path) {
+ eleave = (> .build_query_exit(source, dest) <);
+ if (eleave) {
+ // try really hard to figure this out
+ if (!(opp = $place_lib.opposite_direction((eleave[1])[1]))) {
+ for t in (eleave[2]) {
+ t = strsed(t, "[^a-z]+", "", "g");
+ if ((opp = $place_lib.opposite_direction(t)))
+ break;
+ }
+ }
+ if (opp) {
+ opp = strsed(explode(opp, "|")[1], "[^a-z]+", "", "g");
+ earrive = (> .build_query_exit(dest, source, opp) <);
+ } else {
+ earrive = (> .build_query_exit(dest, source) <);
+ }
+ }
+
+ //} with {
+ // if (eleave) {
+ // .build_cleanup([eleave, 1]);
+ // if (earrive)
+ // .build_cleanup([earrive, 1]);
+ // }
+ // rethrow(error());
+ //}
+ catch any
+ path = .build_generate_path(source, dest, eleave, earrive);
+ with
+ .tell((traceback()[1])[2]);
+ }
+ return path;
+};
+
protected method .build_hint() {
arg n;
@@ -386,19 +630,20 @@
} else {
line += ": ";
}
- while (!exit) {
+ while (!name) {
catch ~skip
name = (> .build_get_name(line, def) <);
with
return 0;
if (((name[1])[1]) == "@none")
return 0;
- catch any
- exit = (> .build_generate_exit(name, source, dest) <);
- with
- .tell((traceback()[1])[2]);
+
+ // catch any
+ // exit = (> .build_create_and_attach_exit(name, source, dest) <);
+ // with
+ // .tell(traceback()[1][2]);
}
- return exit;
+ return name;
};
protected method .build_query_realm() {
@@ -427,18 +672,18 @@
};
protected method .build_set_name() {
- arg obj, name, templates;
+ arg obj, name, templates, @args;
var t, x;
catch any {
- obj = obj.set_name(@name);
+ obj = obj.set_name(@name, @args);
} with {
.tell("Unable to set name; " + ((traceback()[1])[2]));
.tell("Setting name as " + (obj.objname()));
obj = obj.set_name(tostr(obj.objname()));
}
for t in (templates)
- obj = obj.add_name_template(t);
+ obj = obj.add_name_template(t, @args);
return obj;
};
@@ -559,7 +804,7 @@
if (valid(obj))
.tell(("Unable to destroy " + name) + " immediately.");
else
- .tell(("Sucessfully destroyed " + name) + ".");
+ .tell(("Successfully destroyed " + name) + ".");
} with {
return (traceback()[1])[2];
}
@@ -568,7 +813,7 @@
public method .dig_cmd() {
arg cmdstr, cmd, args;
- var m, syn, name, dest, dnew, parent, name, lname, aname, leave, arrive, loc;
+ var m, syn, name, dest, dnew, parent, name, dname, lname, arrive, aname, path, loc;
(> .perms(caller(), 'command) <);
syn = ["Syntax: `@dig <new place>` OR", " `@dig <leaving exit>[;<arriving exit>] to <objref or new place>`", "You may also want to try @build."];
@@ -578,7 +823,7 @@
// are they essentially just @spawn'ing?
if (!(m = match_template(args, "* to *"))) {
- if ((args[1]) == "$")
+ if (match_regexp(args, "^\$[a-z0-9_]+$"))
return syn;
if (!(name = (> $code_lib.parse_name(args) <)))
return "Invalid name.";
@@ -599,12 +844,13 @@
// do some basic parsing before we needlessly create anything
[args, m, name] = m;
- [lname, (aname ?= "")] = split(args, " *; *");
+ [lname, (aname ?= "")] = split(args, " *[|;] *");
if ((!lname) || (!name))
return syn;
// create or parse the destination first
- if ((name[1]) == "$") {
+ name = name.trim();
+ if (match_regexp(name, "^\$[a-z0-9_]+$")) {
if (!(dest = (| lookup(tosym(substr(name, 2))) |)))
return "Invalid object name.";
if (!(dest.is($place)))
@@ -628,31 +874,61 @@
// first the leaving exit..
if (!(name = (| $code_lib.parse_name(lname) |)))
return ("Invalid exit name '" + lname) + "'";
- catch ~stop {
- leave = (> .build_generate_exit(name, loc, dest) <);
- (> .build_attach_exit(leave, loc, dest) <);
- .tell((("Attached exit " + (leave.name())) + " from ") + (loc.name()));
- } with {
- .tell((traceback()[1])[2]);
- return .build_cleanup([dest, dnew]);
+
+ //catch ~stop {
+ // leave = (> .build_create_and_attach_exit(name, loc, dest) <);
+ //
+ // (> .build_attach_exit(leave, loc, dest) <);
+ // .tell("Attached exit " + leave.name() + " from " + loc.name());
+ //} with {
+ // .tell(traceback()[1][2]);
+ // return .build_cleanup([dest, dnew]);
+ //}
+ // see if they want a return exit, if they didn't say anything
+ aname = aname.trim();
+ if (!aname) {
+ if (!(dname = $place_lib.opposite_direction(lname)))
+ dname = lname;
+ arrive = (.prompt(("Specify return exit, or 'none' for no return exit [" + dname) + "] ")).trim();
+ if (!arrive)
+ aname = dname;
+ else if (arrive != "none")
+ aname = strsub(arrive, "|", ",");
}
// now the (optional) arrival exit
if (aname) {
- if (!(name = (| $code_lib.parse_name(aname) |)))
+ if (!(dname = (| $code_lib.parse_name(aname) |)))
return ("Invalid exit name '" + cname) + "'";
+
+ // catch ~stop {
+ // arrive = (> .build_create_and_attach_exit(name, dest, loc) <);
+ // (> .build_attach_exit(arrive, dest, loc) <);
+ // .tell("Attached exit " + arrive.name() + " from " + dest.name());
+ // } with {
+ // .tell(traceback()[1][2]);
+ // thirty second leeway guess to if we created it or not
+ // ... what I do to keep from wrapping
+ // dnew = dnew.or(leave.created_on() > time() - 30 ? 2 : 0);
+ // return .build_cleanup([dest, dnew.and(1)], [leave, dnew.and(2)]);
+ // }
+ }
catch ~stop {
- arrive = (> .build_generate_exit(name, dest, loc) <);
- (> .build_attach_exit(arrive, dest, loc) <);
- .tell((("Attached exit " + (arrive.name())) + " from ") + (dest.name()));
+ if (aname) {
+ path = (> .build_generate_path(loc, dest, name, dname) <);
+
+ // (> .build_attach_exit(arrive, dest, loc) <);
+ } else {
+ path = (> .build_generate_path(loc, dest, name) <);
+ }
+ .tell((("Attached way " + (path.name())) + " from ") + (loc.name()));
} with {
.tell((traceback()[1])[2]);
// thirty second leeway guess to if we created it or not
// ... what I do to keep from wrapping
- dnew = dnew.or(((leave.created_on()) > (time() - 30)) ? 2 : 0);
- return .build_cleanup([dest, dnew.and(1)], [leave, dnew.and(2)]);
- }
+ dnew = dnew.or((path && ((path.created_on()) > (time() - 30))) ? 2 : 0);
+ return .build_cleanup([dest, dnew.and(1)], [path, dnew.and(2)]);
}
};
@@ -766,23 +1042,11 @@
.tell("Append text to report...");
junk = .read();
if (junk && (junk != 'aborted)) {
- bug.set_text((bug.text()) + ["----------------------------------------------------------------------------", ("Addendum by " + (.name())) + ":", @junk]);
+ bug.set_text((bug.text()) + ["---", ("Addendum by " + (.name())) + ":", @junk]);
.tell("Text appended.");
} else {
.tell("Aborted.");
}
-
- // case "A":
- // // Archive
- // if (.is($admin)) {
- // if (bug.fixed()) {
- // bug.chparents($archived_bugs);
- // .tell("Bug archived.");
- // } else {
- // .tell("You may only archive repaired bugs.");
- // choice = 'no_scroll;
- // }
- // }
case "D":
// Dismiss
.tell("Enter a description of the dismissal:");
@@ -816,6 +816,7 @@
str = .prompt("forum, [C]ompose a message to sent there, [RET] to do nothing, or e[X]it: ");
if (str == "P") {
.bug_fixed("*bug", (.name()) + " has repaired the following bug:", [@$mail_lib.indent_reply(bug.forum_format())]);
+ bug.set_fixed(time());
} else if (str == "C") {
junk = .read();
if (junk && (type(junk) == 'list)) {
diff -rwu ColdCore-3.0a9.02/src/channel_ui.cdc ColdCore-3.0a10/src/channel_ui.cdc
--- ColdCore-3.0a9.02/src/channel_ui.cdc Sat Mar 14 15:40:30 1998
+++ ColdCore-3.0a10/src/channel_ui.cdc Sat Mar 14 15:49:04 1998
@@ -5,6 +5,9 @@
var $channel_ui channel_creation = 1;
var $channel_ui channel_dict = #[];
var $channel_ui credits = ["Chuck and Brad"];
+var $command_cache commands = 0;
+var $command_cache modules = [];
+var $command_cache shortcuts = 0;
var $has_commands local = \
#[["@desc-c?hannel", [["@desc-c?hannel", "* as *", "@desc-c?hannel <any> as <any>", 'describe_channel_cmd, #[[1, ['any, []]], [3, ['any, []]]]]]],\
["@join-lock-channel|@jlc",\
@@ -28,7 +31,7 @@
var $has_commands remote = #[];
var $has_commands shortcuts = #[];
var $root created_on = 838251646;
-var $root flags = ['variables, 'methods, 'code, 'command_cache, 'fertile, 'core];
+var $root flags = ['variables, 'methods, 'code, 'fertile, 'core, 'general_cache];
var $root inited = 1;
var $root managed = [$channel_ui];
var $root manager = $channel_ui;
@@ -38,7 +41,7 @@
arg channel, message;
var q;
- if (!(caller() in [$channel_ui, $user, $sys]))
+ if (!(caller() in [$channel_ui, $user, $sys, $guest]))
throw(~perm, "You are not allowed to call $channel_ui._broadcast() directly");
for q in ($user_db.connected())
q.channel_msg(channel, message);
@@ -131,7 +134,10 @@
(> .channel_moderator_ok() <);
message = msg.subrange(2);
default:
- message = (spammer_name + ": ") + msg;
+ message = msg ? ($code_lib.punctuation_type(msg)) : "say";
+ message = ((((spammer_name + " ") + message) + "s, \"") + msg) + "\"";
+
+ // message = spammer_name + ": " + msg;
}
._broadcast(channel, message);
};
@@ -168,7 +174,7 @@
return ((("You un-" + modestr) + "lock channel ") + (db[1])) + ".";
} else {
catch ~objnf, ~parse {
- lock = $lock_parser.parse(str, sender());
+ lock = $lock_frob.parse(str, sender());
$channel_db.value_changed(channel, db.replace(mode, lock));
return ((((("You " + modestr) + "lock channel ") + (db[1])) + " with ") + (lock.lock_name('thing))) + ".";
} with {
@@ -429,7 +429,7 @@
msg = ("Channel alias " + args) + " deleted.";
if (!args)
return ("Syntax: " + cmd) + " <channel>";
- dict_var = channel_dict[args];
+ dict_var = (| channel_dict[args] |);
channel = (| (((channel_dict[args]).to_string()).lowercase()).to_symbol() |) || 0;
if (type(channel) == 'symbol) {
db = (| $channel_db.search(channel) |) || 0;
diff -rwu ColdCore-3.0a9.02/src/climate.cdc ColdCore-3.0a10/src/climate.cdc
--- ColdCore-3.0a9.02/src/climate.cdc Sat Mar 14 15:40:33 1998
+++ ColdCore-3.0a10/src/climate.cdc Sat Mar 14 15:49:09 1998
@@ -1,9 +1,10 @@
new object $climate: $has_commands, $weather_system;
-var $climate daylengths = 0;
-var $climate seasons = 0;
-var $climate weathers = 0;
+var $climate daylengths = [];
+var $climate realm = $realm_of_creation;
+var $climate seasons = [];
+var $climate weathers = #[];
var $has_commands local = #[];
var $has_commands remote = #[["@list-climate", [["@list-climate", "*", "@list-climate <this>", 'show_cmd, #[[1, ['this, []]]]]]], ["@setup", [["@setup", "* seasons * daylengths *", "@setup <this> seasons <any> daylengths <any>", 'setup_cmd, #[[1, ['this, []]], [3, ['any, []]], [5, ['any, []]]]]]], ["@add-weather", [["@add-weather", "* type * prob?abilities *", "@add-weather <this> type <descendant of $weather> prob?abilities <any>", 'add_weather_cmd, #[[1, ['this, []]], [3, ['descendant, [$weather]]], [5, ['any, []]]]]]], ["@del-weather", [["@del-weather", "* type *", "@del-weather <this> type <descendant of $weather>", 'del_weather_cmd, #[[1, ['this, []]], [3, ['descendant, [$weather]]]]]]]];
var $has_commands shortcuts = #[];
@@ -43,7 +44,7 @@
arg current, season, dependancies;
var dists, i, w, d, fuzz;
- fuzz = 10;
+ fuzz = 3;
dists = ._probabilities(current, season, fuzz);
dists = dists.sort(dists.slice(2));
for i in (dependancies) {
@@ -97,6 +98,10 @@
throw(~keynf, "No such weather in this climate.");
};
+public method .realm() {
+ return realm;
+};
+
public method .setup_cmd() {
arg cmdstr, cmd, this, p, vals, p, dls;
var s, line, attrs, att2, extras, ex2, i;
@@ -110,9 +110,16 @@
public method .show_cmd() {
arg cmdstr, cmd, this;
- var out, x, i;
+ var out, x, i, hdr;
- return ((map i in (weathers) to ([(i[1]).name(), @i[2]]).transpose()).tabulate([["Weather type", "------------"], @map i in (seasons) to ([i, "".pad(i.length(), "-")])])) + ["---"];
+ if (definer() == this())
+ return "The base climate object does not define anything--refer to its children.";
+ hdr = [];
+ for x in [1 .. listlen(seasons)] {
+ i = (((seasons[x]) + " (") + (daylengths[x])) + ")";
+ hdr += [[i, pad("", strlen(i), "-")]];
+ }
+ return ((map i in (weathers) to ([(i[1]).name(), @i[2]]).transpose()).tabulate([["Weather type", "------------"]] + hdr)) + ["---"];
};
diff -rwu ColdCore-3.0a9.02/src/cml_color.cdc ColdCore-3.0a10/src/cml_color.cdc
--- ColdCore-3.0a9.02/src/cml_color.cdc Sat Mar 14 15:40:26 1998
+++ ColdCore-3.0a10/src/cml_color.cdc Sat Mar 14 15:49:03 1998
@@ -14,7 +14,8 @@
out = ["COLOR RGB ANSI"];
for c in (colors)
- out += [strfmt("%12 #%6l %3l", c[1], @c[2])];
+ out += [strfmt("%12s #%6l %3l", c[1], @c[2])];
+ return out;
};
public method .get_color() {
diff -rwu ColdCore-3.0a9.02/src/cml_lib.cdc ColdCore-3.0a10/src/cml_lib.cdc
--- ColdCore-3.0a9.02/src/cml_lib.cdc Sat Mar 14 15:40:50 1998
+++ ColdCore-3.0a10/src/cml_lib.cdc Sat Mar 14 15:49:25 1998
@@ -16,6 +16,12 @@
return br;
};
+public method .format_dfn_tag() {
+ arg args;
+
+ return (<$format, ["dfn", [], [args], 'do_dfn]>);
+};
+
public method .format_hr_tag() {
return hr;
};
@@ -27,12 +27,15 @@
};
public method .format_obj_tag() {
- arg context, object, name, @options;
+ arg context, object, name, @args;
+ var opt, src;
- if (options)
- return (<$format, ["obj", [["context", context], ["options", options[1]], ["name", name]], [object], 'do_obj]>);
- else
+ if (args) {
+ [opt, (src ?= sender())] = args;
+ return (<$format, ["obj", [["context", context], ["name", name], ["options", opt]], [object, src], 'do_obj]>);
+ } else {
return (<$format, ["obj", [["context", context], ["name", name]], [object], 'do_obj]>);
+ }
};
public method .format_p_tag() {
diff -rwu ColdCore-3.0a9.02/src/code_lib.cdc ColdCore-3.0a10/src/code_lib.cdc
--- ColdCore-3.0a9.02/src/code_lib.cdc Sat Mar 14 15:40:24 1998
+++ ColdCore-3.0a10/src/code_lib.cdc Sat Mar 14 15:49:02 1998
@@ -1,7 +1,7 @@
new object $code_lib: $libraries;
-var $code_lib quotes = [["\"Abandon all hope, ye who enter here.\""], ["\"Pull out Wedge, your not doing any more good back there.\"", "", "- Luke Skywalker, StarWars"], ["\"God is in the details.\""], ["\"I don't practice what I preach,", "because I'm not the type of person I'm preaching too.\"", "", "- Bob Dobbs"], ["\"I haven't shaved for six years.", "I seem to be cursed with a thin beard.\"", "", "- Calvin, Age 6 (of Calvin & Hobbes)"], ["\"I may be a Dreamer, but I'm not the only one.\"", "", "- John Lennon"], ["\"C code. C code run. Run, Code, Run! Please!?\"", "", "- Anonymous C hacker."], ["\"They who dream by day are cognizant of many things", "which escape those who dream only by night.\"", "", "- Edgar Allan Poe"], ["\"The good die first,", "and they whose hearts are dry as a summer dust", "burn to the socket.\"", "", "- William Wordsworth"], ["\"Banning guns to prevent murder", "is like banning word processors to prevent libel.\"", "", "- Unknown"], ["\"You will not be punished for your anger,", "you will be punished by your anger.\"", "", "- Buddha"], ["What part of:", "", "main() { printf(&unix[\"021%six0120\"],(unix)[\"have\"]+\"fun\"-0x60);}", "", "do you not understand?", "", "(taken from the 1987 Obfuscated C Code Contest)"], ["\"The goal of computer science is to build something that will", "last at least until we've finished building it.\""], ["\"Give me ambiguity or give me something else.\""], ["\"We are born naked, wet and hungry. Then things get worse.\""], ["\"Make it idiot proof and someone will make a better idiot.\""], ["\"Lottery: A tax on people who are bad at math.\""], ["\"There's too much blood in my caffeine system.\""], ["\"Artificial Intelligence usually beats real stupidity.\""], ["\"Ever notice how fast MS-Windows runs? Neither did I.\""], ["\"Very funny, Scotty. Now beam down my clothes.\""], ["\"Consciousness: that annoying time between naps.\""], ["\"The gene pool could use a little chlorine.\""], ["\"When there's a will, I want to be in it.\""], ["\"Change is inevitable, except from a vending machine.\""], ["\"MS-Windows is a virus:", "it takes over your computer and makes it run bad.\""], ["\"I have not failed 10,000 times,", "I have sucessfully found 10,000 ways that do not work.\"", "- Thomas Edison"], ["\"The difference between literature and journalism is", "that journalism is unreadable and literature is not read.\"", "", "- Oscar Wilde (1854-1900)"], ["\"The man who reads nothing at all is better educated", "than the man who reads nothing but newspapers.\"", "", "- Thomas Jefferson (1743-1826)"], ["\"In the mind of the beginner, there are many possibilities.", "In the mind of the expert there are few.\"", "", "- Shunryu Suzuki"], ["\"Time is a great teacher, but unfortunately it kills all of its pupils.\"", "", "- Hector Berlioz"], ["\"After I'm dead I'd rather have people ask", "why I have no monument, than why I have one.\"", "", "- Cato the Elder (234-249 B.C.)"], ["\"I loathe people who keep dogs. They are cowards who haven't", "got the guts to bite people themselves.\"", "", "-August Strindberg"], ["\"By the time I'd grown up, I natrually supposed that I'd be grown up.\"", "", "-Eve Babitz"], ["\"Every place has a spirit:", "it may be good, it may be bad", "it can be restful as eternity.", "This place-spirit can inhabit a book, a house, a town, a valley;", "the nature of the spirits is they remain.\"", "", "- William S. Burroughs"], ["\"I have never been lost... but I will admit to being confused for several weeks.\"", "", "- Daniel Boon"], ["Time is what keeps things from happening all at once."], ["According to my calculations the problem doesn't exist."], ["Forget about World Peace ... visualize using your turn signal."], ["Ever stop to think, and forget to start again?"], ["Diplomacy is the art of saying \"nice doggie!\"...till you can find a rock."], ["\"The sign of growing up is being able to form independent opinions,", "The sign of maturity is knowing when they are not wanted.\""]];
+var $code_lib quotes = [["\"Abandon all hope, ye who enter here.\""], ["\"Pull out Wedge, your not doing any more good back there.\"", "", "- Luke Skywalker, StarWars"], ["\"God is in the details.\""], ["\"I don't practice what I preach,", "because I'm not the type of person I'm preaching too.\"", "", "- Bob Dobbs"], ["\"I haven't shaved for six years.", "I seem to be cursed with a thin beard.\"", "", "- Calvin, Age 6 (of Calvin & Hobbes)"], ["\"I may be a Dreamer, but I'm not the only one.\"", "", "- John Lennon"], ["\"C code. C code run. Run, Code, Run! Please!?\"", "", "- Anonymous C hacker."], ["\"They who dream by day are cognizant of many things", "which escape those who dream only by night.\"", "", "- Edgar Allan Poe"], ["\"The good die first,", "and they whose hearts are dry as a summer dust", "burn to the socket.\"", "", "- William Wordsworth"], ["\"Banning guns to prevent murder", "is like banning word processors to prevent libel.\"", "", "- Unknown"], ["\"You will not be punished for your anger,", "you will be punished by your anger.\"", "", "- Buddha"], ["What part of:", "", "main() { printf(&unix[\"021%six0120\"],(unix)[\"have\"]+\"fun\"-0x60);}", "", "do you not understand?", "", "(taken from the 1987 Obfuscated C Code Contest)"], ["\"The goal of computer science is to build something that will", "last at least until we've finished building it.\""], ["\"Give me ambiguity or give me something else.\""], ["\"We are born naked, wet and hungry. Then things get worse.\""], ["\"Make it idiot proof and someone will make a better idiot.\""], ["\"Lottery: A tax on people who are bad at math.\""], ["\"There's too much blood in my caffeine system.\""], ["\"Artificial Intelligence usually beats real stupidity.\""], ["\"Ever notice how fast MS-Windows runs? Neither did I.\""], ["\"Very funny, Scotty. Now beam down my clothes.\""], ["\"Consciousness: that annoying time between naps.\""], ["\"The gene pool could use a little chlorine.\""], ["\"When there's a will, I want to be in it.\""], ["\"Change is inevitable, except from a vending machine.\""], ["\"MS-Windows is a virus:", "it takes over your computer and makes it run bad.\""], ["\"I have not failed 10,000 times,", "I have sucessfully found 10,000 ways that do not work.\"", "- Thomas Edison"], ["\"The difference between literature and journalism is", "that journalism is unreadable and literature is not read.\"", "", "- Oscar Wilde (1854-1900)"], ["\"The man who reads nothing at all is better educated", "than the man who reads nothing but newspapers.\"", "", "- Thomas Jefferson (1743-1826)"], ["\"In the mind of the beginner, there are many possibilities.", "In the mind of the expert there are few.\"", "", "- Shunryu Suzuki"], ["\"Time is a great teacher, but unfortunately it kills all of its pupils.\"", "", "- Hector Berlioz"], ["\"After I'm dead I'd rather have people ask", "why I have no monument, than why I have one.\"", "", "- Cato the Elder (234-249 B.C.)"], ["\"I loathe people who keep dogs. They are cowards who haven't", "got the guts to bite people themselves.\"", "", "-August Strindberg"], ["\"By the time I'd grown up, I natrually supposed that I'd be grown up.\"", "", "-Eve Babitz"], ["\"Every place has a spirit:", "it may be good, it may be bad", "it can be restful as eternity.", "This place-spirit can inhabit a book, a house, a town, a valley;", "the nature of the spirits is they remain.\"", "", "- William S. Burroughs"], ["\"I have never been lost... but I will admit to being confused for several weeks.\"", "", "- Daniel Boon"], ["Time is what keeps things from happening all at once."], ["According to my calculations the problem doesn't exist."], ["Forget about World Peace ... visualize using your turn signal."], ["Ever stop to think, and forget to start again?"], ["Diplomacy is the art of saying \"nice doggie!\"...till you can find a rock."], ["\"The sign of growing up is being able to form independent opinions,", "The sign of maturity is knowing when they are not wanted.\""], ["\"Microsoft seems hell-bent on repeating very many of the problems", "originally suffered by Unix almost 20 years ago.\"", "", "-Unknown"]];
var $root created_on = 796268969;
var $root flags = ['methods, 'code, 'variables, 'core];
var $root inited = 1;
@@ -33,7 +33,7 @@
};
public method ._do_method_href() {
- arg method, object;
+ arg method, object, options;
var mod_method, prefix, postfix, index;
prefix = "";
@@ -47,8 +47,10 @@
method = method.subrange(2);
}
postfix = "(";
+ if (options)
+ options = (options.mmap('join, "=")).join("&");
method = method.subrange(1, (method.length()) - 1);
- return (((((((prefix + "<A HREF=\"/bin/method?target=") + object) + ".") + method) + "\">") + method) + "</A>") + postfix;
+ return (((((((((prefix + "<A HREF=\"/bin/method?target=") + object) + ".") + method) + "()") + (options ? ("&" + options) : "")) + "\">") + method) + "</A>") + postfix;
};
public method ._profile_listing() {
@@ -82,7 +84,7 @@
}
max = 0.01 * (t - start);
out = map i in (times.keys()) to (refresh() && [i.chop(50), times[i], (times[i]) / max, sums[i], (sums[i]) / max]);
- out = out.sort(map i in (out) to (-(i[2])));
+ out = out.sort(map i in (out) to (refresh() && (-(i[2]))));
out = map i in (out) to (strfmt("%50l%7r%6.1r%%%7r%6.1r%%", @i));
out = head + out;
return out;
@@ -166,7 +168,7 @@
};
public method .code_to_html() {
- arg code, object;
+ arg code, object, options;
var line, object_parse, results, obj_regexp, meth_regexp, chunk, word, method_parse, last_word, mode, chunk_out, meth_r2;
obj_regexp = "\$[a-zA-Z0-9_]+";
@@ -174,18 +176,21 @@
meth_r2 = "^(\.[a-zA-Z0-9_]+\()(.*)$";
results = [];
for line in (code) {
+ if (match_regexp(line, "^ *//")) {
+ results += [("<font color=\"#a0a0a0\">" + line) + "</font>"];
+ } else {
object_parse = line.global_regexp(obj_regexp);
last_word = 0;
chunk_out = "";
while (object_parse) {
[chunk, (word ?= 0), @object_parse] = object_parse;
if (last_word && (method_parse = chunk.regexp(meth_r2))) {
- chunk_out += ._do_method_href(method_parse[1], last_word);
+ chunk_out += ._do_method_href(method_parse[1], last_word, options);
chunk = method_parse[2];
}
method_parse = chunk.global_regexp(meth_regexp);
mode = 0;
- chunk_out += map chunk in (method_parse) to ((mode = !mode) ? chunk : (._do_method_href(chunk, object))).join("");
+ chunk_out += map chunk in (method_parse) to ((mode = !mode) ? chunk : (._do_method_href(chunk, object, options))).join("");
if (word) {
last_word = word;
if ((| $object_lib.to_dbref(word) |))
@@ -196,6 +201,7 @@
}
results += [chunk_out + (object_parse.join(""))];
}
+ }
return results;
};
@@ -250,6 +256,8 @@
// used to parse $has_name names and name templates
[name, flag] = $parse_lib.opt(name, "u?nique", "p?roper", "n?ormal", "i?gnore");
name = name.join();
+
+ // Parse +prop +norm +uniq and +ignore flags
if (flag) {
def = [@def, ["p?roper", "p", 1, ""]][1];
flag = (| flag.last() |) || def;
@@ -265,9 +273,14 @@
case "p?roper":
type = 'prop;
}
+ article = type;
}
+ } else {
+ article = 'prop;
}
[name, @tmps] = name.split(" *, *");
+
+ // Check to see if the name already has articles in it.
if (!ignore) {
if ((match = name.regexp("^the +(.*)$"))) {
article = 'uniq;
@@ -275,9 +288,9 @@
} else if ((match = name.regexp("^(a|an) +(.*)$"))) {
article = 'normal;
name = match[2];
- } else {
- article = 'prop;
}
+
+ // Complain if the flag does not agree with the given article
if (type && (article != type))
throw(~article, (("Conflicting name types " + type) + " and ") + article);
}
@@ -293,7 +306,7 @@
public method .punctuation_type() {
arg str;
- var end;
+ var end, offset, noses;
end = str.length();
switch (str[end]) {
@@ -305,10 +318,14 @@
return "say";
case ")":
if (end > 1) {
- switch (str[end - 1]) {
+ if ((end > 2) && ((str[end - 1]) == "-"))
+ offset = 2;
+ else
+ offset = 1;
+ switch (str[end - offset]) {
case ";":
return "wink";
- case ":":
+ case ":", "=":
return "smile";
case "8":
return "grin";
@@ -317,9 +334,15 @@
}
}
case "(":
- if ((end > 1) && ((str[end - 1]) in [":", "8"]))
+ if (end > 1) {
+ if ((end > 2) && ((str[end - 1]) == "-"))
+ offset = 2;
+ else
+ offset = 1;
+ if ((str[end - offset]) in ["=", "8", ":"])
return "frown";
}
+ }
return "say";
};
@@ -453,6 +453,23 @@
arg str;
return !match_regexp(str, "[^a-z0-9-]");
+};
+
+public method .valid_name() {
+ arg name, type;
+
+ if (!(type in ['prop, 'normal, 'uniq]))
+ throw(~invarg, "Type must be one of: 'prop, 'normal or 'uniq");
+ if ("\\" in name)
+ throw(~invname, "Names cannot include backslashes.");
+ if (name && ((name[1]) in ["$", "#"]))
+ throw(~invname, "Names cannot begin with \"$\" or \"#\".");
+ if (type(name) != 'string)
+ throw(~type, "New name must be given as a string.");
+ if ((type != 'prop) && (name.match_regexp("^(a|an|the) +")))
+ throw(~bad_name, "Articles included in unique or normal name.");
+ if (!(type in ['prop, 'normal, 'uniq]))
+ throw(~invarg, "Type must be one of: 'prop, 'normal or 'uniq");
};
public method .valid_setting_id() {
diff -rwu ColdCore-3.0a9.02/src/command_aliases.cdc ColdCore-3.0a10/src/command_aliases.cdc
--- ColdCore-3.0a9.02/src/command_aliases.cdc Sat Mar 14 15:40:30 1998
+++ ColdCore-3.0a10/src/command_aliases.cdc Sat Mar 14 15:49:04 1998
@@ -2,6 +2,9 @@
new object $command_aliases: $user_interfaces;
var $command_aliases command_aliases = [];
+var $command_cache commands = 0;
+var $command_cache modules = [];
+var $command_cache shortcuts = 0;
var $root created_on = 796268969;
var $root flags = ['methods, 'code, 'variables, 'core];
var $root inited = 1;
diff -rwu ColdCore-3.0a9.02/src/command_cache.cdc ColdCore-3.0a10/src/command_cache.cdc
--- ColdCore-3.0a9.02/src/command_cache.cdc Sat Mar 14 15:40:25 1998
+++ ColdCore-3.0a10/src/command_cache.cdc Sat Mar 14 15:49:04 1998
@@ -1,371 +1,299 @@
new object $command_cache: $has_commands;
-var $command_cache interfaces = 0;
-var $command_cache local_cache = 0;
-var $command_cache remote_cache = 0;
-var $command_cache shortcut_cache = 0;
+var $command_cache commands = 0;
+var $command_cache modules = [];
+var $command_cache shortcuts = 0;
+var $dmi_data descriptions = #[];
+var $has_commands local = #[];
+var $has_commands remote = #[];
var $has_commands shortcuts = #[];
-var $root created_on = 796605573;
-var $root fertile = 1;
-var $root flags = ['methods, 'code, 'fertile, 'variables, 'core];
+var $root created_on = 874602916;
+var $root defined_settings = #[["command-modules", #[['get, ['command_modules]], ['set, ['set_command_modules]], ['parse, ['parse_itemlist, 'parse_command_module]], ['format, ['format_itemlist]]]]];
+var $root flags = ['variables, 'methods, 'code, 'core];
+var $root help_node = $help_obj_command_cache;
var $root inited = 1;
var $root managed = [$command_cache];
var $root manager = $command_cache;
-public method .add_command_interface() {
- arg interface;
+public method .add_command_module() {
+ arg module;
- if (!(interface.has_flag('command_cache)))
- throw(~perm, ("Command interface " + interface) + " is not setup as a cache.");
- interfaces = setadd(interfaces || [], interface);
- interface.interface_link();
+ (> .perms(sender()) <);
+ if (!('general_cache in (module.flags())))
+ throw(~notcache, module + " is not marked as a general_cache");
+ modules = setadd(modules || [], module);
+ module.cache_server_init();
};
-private method .add_object_to_local_cache() {
- arg obj;
- var info, thing, element, part;
+protected method .add_to_cache() {
+ arg command, definer;
+ var part, cmd;
- info = (| obj.all_local_commands() |);
- if (info) {
- for element in (info) {
- for part in (element[2])
- .add_to_local_cache(part[1]);
- }
- }
+ if (type(commands) != 'dictionary)
+ commands = #[];
+ cmd = command.word(1);
+ for part in (cmd.explode_template_word())
+ commands = commands.setadd_elem(part, [cmd, definer]);
};
-public method .add_object_to_remote_cache() {
- arg obj;
- var info, thing, element, part;
+public method .cache_client_init() {
+ var p;
- info = (| obj.all_remote_commands() |);
- if (info) {
- for element in (info) {
- for part in (element[2])
- .add_to_remote_cache(part[1], element[1]);
- }
- }
+ if (sender() != this())
+ (> .perms(sender(), 'system) <);
+ modules ?= [];
+ for p in (([this()] + parents()) + Showing the first 100 KB of 788.5 KB. Download the archive for the full file.