Method code for $sys.configure_core()

[Turn on line numbering]
var list, l, x, t, err, s;

if (caller() != $admin)
    (> .perms(sender()) <);
s = sender();

// if there is nothing left to config, leave..
if (configured) {
    if (!(list = config_set.set_difference(configured.keys())))
        return;
} else {
    configured = #[];
}
.add_to_system(s);

// wait for other things to finish printing messages to them
pause();
pause();

// expand on this as we go
s.tell(["*" * 78, strfmt("%78{*}c", " Welcome to ColdCore "), "*" * 78]);
s.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));
s.tell("*" * 78);

// first question please
if (!configured.contains('new_user_class)) {
    s.tell("What class should new users be created as?  Available classes:");
    list = filter x in ($user.descendants()) where ('general_cache in x.flags() && x != $guest);
    t = .get_new_user_class();
    list = map x in (list) to (list == t ? x + " (current class)" : x);
    s.tell(list.prefix("    "));
    while (!l) {
        refresh();
        l = (> s.prompt("New User Class [" + t + "] ") <);
        if (l == "@skip") {
            s.tell("Skipping..");
            break;
        }
        if (l) {
            catch any {
                l = $object_lib.to_dbref(l);
                if (!(l in list))
                    s.tell("Invalid selection, try again.");
            } with {
                s.tell("Invalid selection '" + l + "'");
                continue;
            }
        } else {
            l = t;
        }
        .set_setting("new-user-class", $sys, l);
        configured = configured.add('new_user_class, 1);
        s.tell("New User Class set to: " + l);
    }
    s.tell(["", "You can set this at any time, with the command:"]);
    s.tell("  @set $sys:new-user-class=" + l);
}
refresh();

// server name/title
if (!configured.contains('server_name)) {
    s.tell(["", "---"]);
    t = $motd.server_name();
    l = (> s.prompt("What is your server name? [" + t + "] ") <) || t;
    if (l == "@skip") {
        s.tell("Skipping..");
    } else {
        $motd.set_setting("server-name", $motd, l);
        configured = configured.add('server_name, 1);
        s.tell("Server name set to: " + l);
    }
    s.tell(["", "You can set this at any time, with the command:"]);
    s.tell("  @set $motd:server-name=" + l);
}
refresh();
if (!configured.contains('server_title)) {
    s.tell(["", "---"]);
    t = $motd.server_title();
    l = (> s.prompt("What is your server title? [" + t + "] ") <) || t;
    if (l == "@skip") {
        s.tell("Skipping..");
    } else {
        $motd.set_setting("server-title", $motd, l);
        configured = configured.add('server_title, 1);
        s.tell("Server title set to: " + l);
    }
    s.tell(["", "You can set this at any time, with the command:"]);
    s.tell("  @set $motd:server-title=" + l);
}
refresh();
if (!configured.contains('daemons)) {
    s.tell(["", "---"]);
    while (1) {
        refresh();
        list = $daemon.children().setremove($login_daemon);
        s.tell("Which network daemons do you want to have automatically startup,");
        s.tell("Other than $login_daemon.  Available daemons:");
        t = filter l in (startup['objects]) where (l.is($daemon));
        for l in (list) {
            if (l in t)
                s.tell(strfmt("  %20s (auto starting)", l));
            else
                s.tell("  " + l);
        }
        l = (> s.prompt("Auto-Start: [" + t.join(", ") + "] ") <);
        if (l == "@skip") {
            s.tell("Skipping..");
            break;
        } else if (!l) {
            s.tell("Using existing daemons: " + t.join(", "));
            configured = configured.add('daemons, 1);
            break;
        } else {
            err = 0;
            for x in (l.explode_english_list()) {
                catch any {
                    .set_setting("startup-objects", $sys, "+" + x);
                    s.tell("Added " + x + " as a startup daemon.");
                } with {
                    s.tell("Unable to add '" + x + "' as a daemon:");
                    s.tell("=> " + traceback()[1][2]);
                    err++;
                }
            }
            if (!err) {
                configured = configured.add('daemons, 1);
                break;
            }
            s.tell("Errors occurred...");
        }
    }
    s.tell(["", "You can set this at any time, with the command:"]);
    s.tell("  @set $sys:startup-objects=OBJECTS...");
}

// Other things to add: HTTP Virtual Hosting info,
// Let them know, if they actually saw anything..
s.tell(["", strfmt("%79{*}c", " Configuration Complete ")]);

// $#Edited: 04 Feb 98 14:50 $brandon
// $#Edited: 06 Mar 98 13:34 $brandon
// $#Edited: 24 Sep 98 16:53 $user_nolan
// $#Edited: 16 Dec 98 04:48 $brandon
// $#Edited: 27 Aug 01 11:07 $user_lynx

["// Created 26-Mar-1995 as a part of ColdCore, see: @help Credit"]

the Cold Dark