Wizard Utilities #24

Parent #79Owner #2Flags readSource QuestCore.db

Aliases: Wizard Utilities

46 verbs · 24 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
set_programmerthis none thisrxd#2430
set_playerthis none thisrxd#2439
set_ownerthis none thisrxd#2437
set_property_ownerthis none thisrxd#2429
unset_playerthis none thisrxd#2429
set_property_flagsthis none thisrxd#2430
_set_property_flagsthis none thisrxd#2417
random_passwordthis none thisrxd#2417
queued_tasksthis none thisrxd#2416
player_cmd_permsthis none thisrxd#240
isnewtthis none thisrxd#246
initialize_ownedthis none thisrxd#2417
verify_owned_objectsthis none thisrxd#2418
connected_wizards connected_wizards_unadvertisedthis none thisrxd#2415
all_wizards_advertised all_wizards all_wizards_unadvertisedthis none thisrxd#2415
rename_all_instancesthis none thisrxd#2414
missed_helpthis none thisrxd#2410
show_missing_helpthis none thisrxd#2419
init_for_corethis none thisrxd#2417
show_netwho_listingthis none thisrxd#2476
show_netwho_from_listingthis none thisrxd#2473
check_player_request check_reregistrationthis none thisrxd#2457
make_playerthis none thisrxd#2423
send_new_player_mailthis none thisrxd#2412
do_make_playerany any anyrxd#2443
do_registerthis none thisrxd#2429
do_new_passwordthis none thisrxd#2434
set_owner_newthis none thisrxd#2437
boot_idlersthis none thisrxd#2454
grant_objectthis none thisrxd#2428
connection_hashthis none thisrxd#248
newt_playerthis none thisrxd#2429
unset_programmerthis none thisrxd#2421
is_wizardthis none thisrxd#2413
expire_mailnone none nonerxd#245
expire_mail_weeklythis none thisrxd#247
check_prog_restrictedthis none thisrxd#2422
expire_mail_playersthis none thisrxd#2416
expire_mail_liststhis none thisrxd#2416
flush_editorsthis none thisrxd#2412
random_wizardthis none thisrxd#2410
set_email_addressthis none thisrxd#247
get_email_addressthis none thisrxd#247
_mac_moomail_fixthis none thisrxd#2416
make_init_verbthis none thisrxd#2449
checkpoint_started_msg checkpoint_failed_msg checkpoint_finished_msgthis none thisrxd#244

Properties

PropertyDefinerFlagsOwnerValue
default_programmer_quota#24rc#27
default_player_quota#24rc#27
missed_help_strings#24r#2{}
missed_help_counters#24r#2{}
record_missed_help#24rc#20
programmer_restricted#24rc#2{}
boot_task#24rc#2585440461
boot_exceptions#24rc#2{}
programmer_restricted_temp#24rc#2{}
suicide_string#24rc#2"You don't *really* want to commit suicide, do you?"
next_perm_index#24rc#21
wizards#24rc#2{#2}
old_task_perms_user#24rc#2{}
expiration_progress#24rc#2#-1
system_chars#24rc#2{#36, #38, #71}
new_core_message#24r#2
list of 147{"This RPG core was built upon the 1997 LambdaCore, with upgrades derived from the 2000 LambdaCore. Be sure to type \"help set-up\" after reading this. The following text is the original $wiz_utils.new_core_message from the 2000 LambdaCore:", "...", "Getting Started with your LambdaCore MOO", "========================================", "", "Thank you for choosing LambdaCore!", "", "Initial Setup Notes", "-------------------", "", "The \"welcome\" screen, seen when a player connects.", " -- this is stored in $login.welcome_message", "", "Do you want on-line character creation?", " -- this is stored in $login.create_enabled", " for more detailed information, edit $login:player_creation_enabled", "", "Do you want to limit the number of players on the MOO at once?", " -- look at $login.max_connections", " the `connection_limit' message on $login is the message printed", " when this limit is reached.", "", "Do you want a different default player class?", " -- set $player_class to a different value", " *do not* change $player", "", "You should also set the following:", " $network.postmaster", " -- your email address, or the email address of the person who will ", " handle your email", " $network.site", " -- the machine your MOO is running on (e.g. \"lambda.moo.mud.org\")", " $network.port", " -- the port your MOO is running on (e.g. 8888)", " $network.MOO_Name", " -- the name of your MOO (e.g. \"LambdaMOO\")", " $site_db.domain", " -- this is set to the `domain' of your address", " (eg `foo.com' for `moo.foo.com')", "", "If you compiled the server with open_network_connection() enabled (allowing the MOO to open up connections with other computers on the network), then you should set", " $network.active = 1", " This will enable @newpassword, @registerme, @password, @mailme, @netforward, and others to send mail from the MOO.", "", "-------------------------------------------------------------------", "", "Setting Yourself Up", "-------------------", "", "Set a password for yourself.", " -- @password <new-password>", "", "Set a description for yourself.", " -- @describe me as <anything>", "", "Set a gender for yourself.", " -- @gender <gender>", "", "There are, also, a large number of messages you can set on yourself. Setting them will enhance the virtual reality.", "", "-------------------------------------------------------------------", "", "About Guests", "------------", "", "To make a new Guest character:", " -- @make-guest <guestname>", " will make a new guest with the name you specify with `_Guest' appended", " and some other standard but useful aliases", "", "This is the easiest way to make Guest characters. The most important things to remember about Guests, if you want to make them yourself, are:", " -- make them owned by nonwizards, and not owned by themselves", " -- make sure they've got .password == 0, and that .password is nonclear", " -- at least one Guest must always be named `Guest'; this can be an alias", "", "To set the default description and gender for a guest:", " -- set .default_description to the description the guest should start with", " -- set .default_gender to the gender the guest should start with", " -- remember to set .description and .gender too, for the guest's first use", "", "-------------------------------------------------------------------", "", "Adding to the Newspaper", "-----------------------", "", "The newspaper is a special mailing list. To add a post to the newspaper, send mail to it (as *News or $news), and then note the number of your post (let's call it <x> and:", " -- @addnews <x> to *News", "... in general, `@addnews $ to *News' will work as well.", "", "-------------------------------------------------------------------", "", "Quota", "-----", "", "By default, LambdaCore runs with byte-based quota, an in-DB quota system, limiting users by total database space as opposed to total objects. You'll need to do two things:", " -- decide on the default quota:", " ;$byte_quota_utils.default_quota[1] = <a number of bytes>", " -- start the measurement task; see `help routine_tasks' for more information (Note: this help topic contains information about more than just the quota task; it should be read regardless of how quota is set).", "", "If you prefer the quota system documented in the LambdaMOO Programmer's Manual, directly supported by the server, you can enable object-based quota:", " -- set $quota_utils to $object_quota_utils", "", "It's best that you make this switch before users start, because converting existing users is an awkward (and inherently arbitrary and political) move.", "", "-------------------------------------------------------------------", "", "Making Programmers", "------------------", "", "The command to turn someone into a programmer is `@programmer' Its syntax is `@programmer <user>'. For example:", " -- @programmer Haakon", "The `@programmer' verb will prompt you if the user isn't set up with a description and a gender.", "", "No code to automatically grant programmer bits is included with LambdaCore.", "", "Making Wizards", "--------------", "", "THINK CAREFULLY.", "", "Be very careful before giving someone a wizard bit. That person can do gross damage to your database, and fixable but serious damage to the machine it runs on. That person can quite possibly open outbound network connections from your machine, and thus commit acts for which your host system will be blamed. That person can ruin your MOO's as-yet-untarnished reputation.", "", "Wizards have technical power, the ability to change anything within the database, to create anything within the database. Be careful with the idea of a `Social Wizard' -- a nontechnical person holding a wizard bit is fairly likely to, at some point, accidentally do something destructive. It's a good idea not to socialize as your wizard character, for the same reason, to make it less likely to be accidentally destructive.", "", "That said, in general you don't turn an existing character into a wizard, you make a -new- character to be the wizard. This is because the existing character probably owns code and objects which could be destructive if suddenly made wizardly; it's a good security measure to make a fresh player. So, to make a fresh player:", " -- @make-player (see `help @make-player' for more information)", " this will make you a new player. for this example, #123", "", "To make #123 a wizard:", " -- @programmer #123", " (a nonprogrammer wizard is a truly strange beast)", " -- ;#123.wizard = 1;", " -- @chparent #123 to $wiz", " -- ;#123.public_identity = <the player's nonwizard character's object number>", "", "-------------------------------------------------------------------", "", "Good luck with your new LambdaCore database!", "", "Visit us at LambdaMOO: lambda.moo.mud.org 8888", "", "Join the international mailing list for MOO coders: send an email message to moo-cows-request@the-b.org with the word `subscribe' as the body of your message.", "", "Do good things.", "", "The LambdaMOO Wizards", "[authored February 15, 1999]"}
checkpoint_started_msg#24rc#2"CHECKPOINT BEGUN--The MOO is saving the database. Please be patient with the possible lag."
checkpoint_failed_msg#24rc#2"The MOO failed to save the database! Contact the system administrator!"
checkpoint_finished_msg#24rc#2"CHECKPOINT ENDED--Have fun."
help_msg#79rc#2
list of 36{"Wizard Utilities", "----------------", "The following functions are substitutes for various server builtins.", "Anytime one feel tempted to use one of the expressions on the right,", "use the corresponding one on the left instead. This will take care", "of various things that the server (for whatever reason) does not handle.", "", ":set_programmer(object) object.programmer = 1;", " chparent object to $prog", " send mail to $prog_log", "", ":set_player(object[,nochown]) set_player_flag(object,1);", " set player flag, ", " add name/aliases to $player_db,", " and maybe do a self chown.", "", ":unset_player(object[,newowner]) set_player_flag(object,0);", " unset player flag,", " remove name/aliases from $player_db", " chown to newowner if given", "", ":set_owner(object, newowner) object.owner = newowner;", " change ownership on object", " change ownership on all +c properties", " juggle .ownership_quotas", "", ":set_property_owner(object, property, newowner[, suspend-ok])", " change owner on a given property", " if this is a -c property, we change the owner on all descendants", " for which this is also a -c property.", " Polite protest if property is +c and newowner != object.owner.", "", ":set_property_flags(object, property, flags[, suspend-ok])", " change the permissions on a given property and propagate these to ", " *all descendants*. property ownership is changed on descendants ", " where necessary."}
key#1c#2<clear>
aliases#1rc#2{"Wizard Utilities"}
description#1rc#2{"This is the Wizard Utilities utility package. See `help $wiz_utils' for more details."}
object_size#1r#36{59519, 1539462952}

Ancestry

Ancestors (nearest first): #79 Generic Utilities Package#1 Root Class

Children: none

Call graph

calls n24_0 #24:set_programmer n52_5 #52:isa n24_0->n52_5 n24_36 #24:check_prog_restricted n24_0->n24_36 n80_2 #80:adjust_quota_for_programmer n24_0->n80_2 n6_10 #6:notify n24_0->n6_10 n46_2 #46:send_message n24_0->n46_2 n42_0 #42:controls n24_36->n42_0 n24_1 #24:set_player n24_1->n52_5 n39_3 #39:available n24_1->n39_3 n24_2 #24:set_owner n24_1->n24_2 n39_6 #39:insert n24_1->n39_6 n24_2->n52_5 n52_1 #52:all_properties n24_2->n52_1 n80_12 #80:reimburse_quota n24_2->n80_12 n80_11 #80:charge_quota n24_2->n80_11 n24_3 #24:set_property_owner n24_3->n24_3 n24_4 #24:unset_player n24_4->n24_2 n52_0 #52:has_property n24_4->n52_0 n6_18 #6:tell n24_4->n6_18 n37_8 #37:delete2 n24_4->n37_8 n56_8 #56:suspend_if_needed n24_4->n56_8 n24_5 #24:set_property_flags n20_50 #20:char_list n24_5->n20_50 n24_5->n42_0 n24_6 #24:_set_property_flags n24_5->n24_6 n24_6->n24_6 n56_7 #56:running_out_of_time n24_6->n56_7 n24_11 #24:initialize_owned n24_11->n52_5 n24_11->n6_18 n24_11->n56_8 n24_12 #24:verify_owned_objects n24_11->n24_12 n24_12->n6_18 n24_12->n56_8 n20_59 #20:name_and_number n24_12->n20_59 n24_13 #24:connected_wizards n52_23 #52:leaves n24_13->n52_23 n24_14 #24:all_wizards_advertised n24_14->n52_23 n24_17 #24:show_missing_help n24_17->n6_18 n20_71 #20:redirect_ansi n24_17->n20_71 n55_15 #55:sort_suspended n24_17->n55_15 n24_18 #24:init_for_core n1_28 #1:init_for_core n24_18->n1_28 n24_19 #24:show_netwho_listing n24_19->n20_71 n20_53 #20:connection_hostname n24_19->n20_53 n10_18 #10:blacklisted n24_19->n10_18 n55_24 #55:sort_alist_suspended n24_19->n55_24 n24_20 #24:show_netwho_from_listing n24_20->n52_5 n24_20->n56_8 n24_20->n20_71 n37_2 #37:find_all n24_20->n37_2 n37_1 #37:find_exact n24_20->n37_1 n24_42 #24:get_email_address n24_20->n24_42 n20_6 #20:english_list n24_20->n20_6 n24_21 #24:check_player_request n24_21->n39_3 n24_21->n10_18 n10_11 #10:_match_player n24_21->n10_11 n16_3 #16:suspicious_address n24_21->n16_3 n72_8 #72:invalid_email_address n24_21->n72_8

Showing 48 of 97 verbs; 49 not shown.

Source

set_programmer

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1":set_programmer(victim[,mail from])  => 1 or error.";
2"Sets victim.programmer, chparents victim to $prog if necessary, and sends mail to $new_prog_log, mail is from optional second arg or caller_perms().";
3whodunnit = caller_perms();
4{victim, ?mailfrom = whodunnit} = args;
5if (!whodunnit.wizard)
6return E_PERM;
7elseif (!(valid(victim) && (is_player(victim) && $object_utils:isa(victim, $player))))
8return E_INVARG;
9elseif (victim.programmer)
10return E_NONE;
11elseif (this:check_prog_restricted(victim))
12return E_INVARG;
13elseif (typeof(e = `victim.programmer = 1 ! ANY') == ERR)
14return e;
15else
16$quota_utils:adjust_quota_for_programmer(victim);
17if (!$object_utils:isa(victim, $prog))
18if (typeof(e = `chparent(victim, $prog) ! ANY') == ERR)
19"...this isn't really supposed to happen but it could...";
20player:notify(tostr("chparent(", victim, ",", $prog, ") failed:  ", e));
21player:notify("Check for common properties.");
22endif
23else
24player:notify(tostr(victim.name, " was already a child of ", parent(victim).name, " (", parent(victim), ")"));
25endif
26if (!$mail_agent:send_message(mailfrom, {$new_prog_log, victim}, tostr("@programmer ", victim.name, " (", victim, ")"), tostr("I just gave ", victim.name, " a programmer bit."))[1])
27$mail_agent:send_message(mailfrom, {$new_prog_log}, tostr("@programmer ", victim.name, " (", victim, ")"), tostr("I just gave ", victim.name, " a programmer bit."));
28endif
29return 1;
30endif

set_player

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1":set_player(victim[,nochown]) => 1 or error";
2"Set victim's player flag, (maybe) chown to itself, add name and aliases to $player_db.";
3" E_NONE == already a player,";
4" E_NACC == player_db is frozen,";
5" E_RECMOVE == name is unavailable";
6{victim, ?nochown = 0} = args;
7if (!caller_perms().wizard)
8return E_PERM;
9elseif (!(valid(victim) && $object_utils:isa(victim, $player)))
10return E_INVARG;
11elseif (is_player(victim))
12return E_NONE;
13elseif ($player_db.frozen)
14return E_NACC;
15elseif (!$player_db:available(name = victim.name))
16return E_RECMOVE;
17else
18set_player_flag(victim, 1);
19if (0 && $object_utils:isa(victim, $prog))
20victim.programmer = 1;
21else
22victim.programmer = $player.programmer;
23endif
24if (!nochown)
25$wiz_utils:set_owner(victim, victim);
26endif
27$player_db:insert(name, victim);
28for a in (setremove(aliases = victim.aliases, name))
29if (index(a, " "))
30"..ignore ..";
31elseif ($player_db:available(a) in {this, 1})
32$player_db:insert(a, victim);
33else
34aliases = setremove(aliases, a);
35endif
36endfor
37victim.aliases = setadd(aliases, name);
38return 1;
39endif

set_owner

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1":set_owner(object,newowner[,suspendok])  does object.owner=newowner, taking care of c properties as well.  This should be used anyplace one is contemplating doing object.owner=newowner, since the latter leaves ownership of c properties unchanged.  (--Rog thinks this is a server bug).";
2{object, newowner, ?suspendok = 0} = args;
3if (!valid(object))
4return E_INVIND;
5elseif (!caller_perms().wizard)
6return E_PERM;
7elseif (!(valid(newowner) && is_player(newowner)))
8return E_INVARG;
9endif
10oldowner = object.owner;
11object.owner = newowner;
12for pname in ($object_utils:all_properties(object))
13if (suspendok && ((ticks_left() < 5000) || (seconds_left() < 2)))
14suspend(0);
15endif
16perms = property_info(object, pname)[2];
17if (index(perms, "c"))
18set_property_info(object, pname, {newowner, perms});
19endif
20endfor
21if ($object_utils:isa(oldowner, $player))
22if (is_player(oldowner) && (object != oldowner))
23$quota_utils:reimburse_quota(oldowner, object);
24endif
25if (typeof(oldowner.owned_objects) == LIST)
26oldowner.owned_objects = setremove(oldowner.owned_objects, object);
27endif
28endif
29if ($object_utils:isa(newowner, $player))
30if (object != newowner)
31$quota_utils:charge_quota(newowner, object);
32endif
33if (typeof(newowner.owned_objects) == LIST)
34newowner.owned_objects = setadd(newowner.owned_objects, object);
35endif
36endif
37return 1;

set_property_owner

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1":set_property_owner(object,prop,newowner[,suspendok])  changes the ownership of object.prop to newowner.  If the property is !c, changes the ownership on all of the descendents as well.  Otherwise, we just chown the property on the object itself and give a warning if newowner!=object.owner (--Rog thinks this is a server bug that one is able to do this at all...).";
2{object, pname, newowner, ?suspendok = 0} = args;
3if (!caller_perms().wizard)
4return E_PERM;
5elseif (!(info = `property_info(object, pname) ! ANY'))
6"... handles E_PROPNF and invalid object errors...";
7return info;
8elseif (!is_player(newowner))
9return E_INVARG;
10elseif (index(info[2], "c"))
11if (suspendok / 2)
12"...(recursive call)...";
13"...child property is +c while parent is -c??...RUN AWAY!!";
14return E_NONE;
15else
16set_property_info(object, pname, listset(info, newowner, 1));
17return (newowner == object.owner) || E_NONE;
18endif
19else
20set_property_info(object, pname, listset(info, newowner, 1));
21if ((suspendok % 2) && ((ticks_left() < 10000) || (seconds_left() < 2)))
22suspend(0);
23endif
24suspendok = 2 + suspendok;
25for c in (children(object))
26this:set_property_owner(c, pname, newowner, suspendok);
27endfor
28return 1;
29endif

unset_player

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1":unset_player(victim[,newowner])  => 1 or error";
2"Reset victim's player flag, chown victim to newowner (if given), remove all of victim's names and aliases from $player_db.";
3{victim, ?newowner = 0} = args;
4if (!caller_perms().wizard)
5return E_PERM;
6elseif (!valid(victim))
7return E_INVARG;
8elseif (!is_player(victim))
9return E_NONE;
10endif
11if (typeof(newowner) == OBJ)
12$wiz_utils:set_owner(victim, newowner);
13endif
14victim.programmer = 0;
15victim.wizard = 0;
16set_player_flag(victim, 0);
17if ($object_utils:has_property($local, "second_char_registry"))
18$local.second_char_registry:delete_player(victim);
19endif
20if ($player_db.frozen)
21player:tell("Warning:  player_db is in the middle of a :load().");
22endif
23$player_db:delete2(victim.name, victim);
24for a in (victim.aliases)
25$player_db:delete2(a, victim);
26"I don't *think* this is bad---we've already toaded the guy.  And folks with lots of aliases screw us. --Nosredna";
27$command_utils:suspend_if_needed(0);
28endfor
29return 1;

set_property_flags

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

none

Source

1":set_property_flags(object,prop,flags[,suspendok])  changes the permissions on object.prop to flags.  Unlike a mere set_property_info, this changes the flags on all descendant objects as well.  We also change the ownership on the descendent properties where necessary.";
2{object, pname, flags, ?suspendok = 0} = args;
3perms = caller_perms();
4if (!(info = `property_info(object, pname) ! ANY'))
5"... handles E_PROPNF and invalid object errors...";
6return info;
7elseif ($set_utils:difference($string_utils:char_list(flags), {"r", "w", "c"}))
8"...not r, w, or c?...";
9return E_INVARG;
10elseif ((pinfo = `property_info(parent(object), pname) ! ANY') && (flags != pinfo[2]))
11"... property doesn't actually live here...";
12"... only allowed to correct so that this property matches parent...";
13return E_INVARG;
14elseif (!(perms.wizard || (info[1] == perms)))
15"... you have to own the property...";
16return E_PERM;
17elseif (!(((!(c = index(flags, "c"))) == (!index(info[2], "c"))) || $perm_utils:controls(perms, object)))
18"... if you're changing the c flag, you have to own the object...";
19return E_PERM;
20else
21if (c)
22set_property_info(object, pname, {object.owner, kflags = flags});
23else
24set_property_info(object, pname, kflags = listset(info, flags, 2));
25endif
26for kid in (children(object))
27this:_set_property_flags(kid, pname, kflags, suspendok);
28endfor
29return 1;
30endif

_set_property_flags

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1"_set_property_flags(object, pname, {owner, flags} or something+\"c\", suspendok)";
2"auxiliary to :set_property_flags... don't call this directly.";
3if (caller != this)
4return E_PERM;
5endif
6if (args[4] && $command_utils:running_out_of_time(0))
7suspend(0);
8endif
9object = args[1];
10if (typeof(args[3]) != LIST)
11set_property_info(object, args[2], {object.owner, args[3]});
12else
13set_property_info(@args[1..3]);
14endif
15for kid in (children(object))
16this:_set_property_flags(@listset(args, kid, 1));
17endfor

random_password

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1"Generate a random password of length args[1].  Alternates vowels and consonants, for maximum pronounceability.  Uses its own list of consonants which exclude F and C and K to prevent generating obscene sounding passwords.";
2"Capital I and lowercase L are excluded on the basis of looking like each other.";
3vowels = "aeiouyAEUY";
4consonants = "bdghjmnpqrstvwxzBDGHJLMNPQRSTVWXZ";
5len = toint(args[1]);
6if (len)
7alt = random(2) - 1;
8s = "";
9for i in [1..len]
10newchar = alt ? vowels[random($)] | consonants[random($)];
11s = s + newchar;
12alt = !alt;
13endfor
14return s;
15else
16return E_INVARG;
17endif

queued_tasks

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1":queued_tasks(player) => list of queued tasks for that player.";
2"shouldn't the server builtin should work this way?  oh well";
3set_task_perms(caller_perms());
4if (typeof(e = `set_task_perms(who = args[1]) ! ANY') == ERR)
5return e;
6elseif (who.wizard)
7tasks = {};
8for t in (queued_tasks())
9if (t[5] == who)
10tasks = {@tasks, t};
11endif
12endfor
13return tasks;
14else
15return queued_tasks();
16endif

player_cmd_perms

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

none

Source

No program (verb defined but unprogrammed).

isnewt

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

none

Source

1"Return 1 if args[1] is a newted player.";
2if (!caller_perms().wizard)
3return E_PERM;
4else
5return args[1] in $login.newted;
6endif

initialize_owned

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1if (!caller_perms().wizard)
2return E_PERM;
3else
4set_task_perms(caller_perms());
5player:tell("Beginning initialize_owned:  ", ctime());
6for o in [#0..max_object()]
7if (valid(o))
8if ($object_utils:isa(owner = o.owner, $player) && (typeof(owner.owned_objects) == LIST))
9owner.owned_objects = setadd(owner.owned_objects, o);
10endif
11endif
12$command_utils:suspend_if_needed(0);
13endfor
14player:tell("Done adding, beginning verification pass.");
15this:verify_owned_objects();
16player:tell("Finished:  ", ctime());
17endif

verify_owned_objects

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1if (!caller_perms().wizard)
2return E_PERM;
3else
4for p in (players())
5if (typeof(p.owned_objects) == LIST)
6for o in (p.owned_objects)
7if (((typeof(o) != OBJ) || (!valid(o))) || (o.owner != p))
8p.owned_objects = setremove(p.owned_objects, o);
9player:tell("Removed ", $string_utils:nn(o), " from ", $string_utils:nn(p), "'s .owned_objects list.");
10if (((typeof(o) == OBJ) && valid(o)) && (typeof(o.owner.owned_objects) == LIST))
11o.owner.owned_objects = setadd(o.owner.owned_objects, o);
12endif
13endif
14$command_utils:suspend_if_needed(0, p);
15endfor
16endif
17endfor
18endif

connected_wizards connected_wizards_unadvertised

Spec this none thisFlags rxdOwner #36Definer #24

Referenced by

Source

1":connected_wizards() => list of currently connected wizards and players mentioned in .public_identity properties as being wizard counterparts.";
2wizzes = $object_utils:leaves($wiz);
3wlist = {};
4everyone = verb == "connected_wizards_unadvertised";
5for w in (wizzes)
6if (w.wizard && (w.advertised || everyone))
7if (`connected_seconds(w) ! ANY => 0')
8wlist = setadd(wlist, w);
9endif
10if (`connected_seconds(w.public_identity) ! ANY => 0')
11wlist = setadd(wlist, w.public_identity);
12endif
13endif
14endfor
15return wlist;

all_wizards_advertised all_wizards all_wizards_unadvertised

Spec this none thisFlags rxdOwner #36Definer #24

Referenced by

Source

1":all_wizards_advertised() => list of all wizards who have set .advertised true and players mentioned their .public_identity properties as being wizard counterparts";
2wizzes = $object_utils:leaves($wiz);
3wlist = {};
4everyone = verb == "all_wizards_unadvertised";
5for w in (wizzes)
6if (w.wizard && (w.advertised || everyone))
7if (is_player(w))
8wlist = setadd(wlist, w);
9endif
10if (`is_player(w.public_identity) ! ANY')
11wlist = setadd(wlist, w.public_identity);
12endif
13endif
14endfor
15return wlist;

rename_all_instances

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1":rename_all_instances(object,oldname,newname)";
2"Used to rename all instances of an unwanted verb (like recycle or disfunc)";
3"if said verb is actually defined on the object itself";
4if (caller_perms().wizard)
5found = 0;
6{object, oldname, newname} = args;
7while (info = `verb_info(object, oldname) ! ANY')
8`set_verb_info(object, oldname, listset(info, newname, 3)) ! ANY';
9found = 1;
10endwhile
11return found;
12else
13return E_PERM;
14endif

missed_help

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1if (this.record_missed_help && (callers()[1][4] == $player))
2miss = args[1];
3if (!(index = miss in this.missed_help_strings))
4this.missed_help_strings = {miss, @this.missed_help_strings};
5this.missed_help_counters = {{0, 0}, @this.missed_help_counters};
6index = 1;
7endif
8which = args[2] ? 2 | 1;
9this.missed_help_counters[index][which] = this.missed_help_counters[index][which] + 1;
10endif

show_missing_help

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

none

Source

1mhs = this.missed_help_strings;
2cnt = this.missed_help_counters;
3"save values first, so subsequent changes during suspends wont affect it";
4thresh = args ? args[1] | 5;
5strs = {};
6for i in [1..length(mhs)]
7(ticks_left() < 4000) && suspend(0);
8if ((cnt[i][1] + cnt[i][2]) > thresh)
9strs = {@strs, ((($string_utils:right(tostr(cnt[i][1]), 5) + " ") + $string_utils:right(tostr(cnt[i][2]), 5)) + " ") + mhs[i]};
10endif
11endfor
12sorted = $list_utils:sort_suspended(0, strs);
13len = length(sorted);
14player:tell(" miss ambig word");
15for x in [1..len]
16(ticks_left() < 4000) && suspend(0);
17player:tell(sorted[(len - x) + 1]);
18endfor
19player:tell(" - - - - - - - - -");

init_for_core

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

none

Source

1if (caller_perms().wizard)
2pass();
3`delete_property(this, "guest_feature_restricted") ! ANY';
4this.boot_exceptions = {};
5this.programmer_restricted = {};
6this.programmer_restricted_temp = {};
7this.record_missed_help = 0;
8this.missed_help_counters = this.missed_help_strings = {};
9this.suicide_string = "You don't *really* want to commit suicide, do you?";
10this.wizards = {#2};
11this.next_perm_index = 1;
12this.system_chars = {$hacker, $no_one, $housekeeper};
13this.expiration_progress = $nothing;
14this.checkpoint_started_msg = "CHECKPOINT BEGUN--The MOO is saving the database. Please be patient with the possible lag.";
15this.checkpoint_failed_msg = "The MOO failed to save the database! Contact the system administrator!";
16this.checkpoint_finished_msg = "CHECKPOINT ENDED--Have fun.";
17endif

show_netwho_listing

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1":show_netwho_listing(tell,player_list)";
2" prints a listing of the indicated players showing connect sites.";
3{who, unsorted} = args;
4if (!caller_perms().wizard)
5return E_PERM;
6endif
7if (!unsorted)
8return;
9endif
10su = $string_utils;
11alist = {};
12footnotes = {};
13nwidth = length("Player name");
14for u in (unsorted)
15(ticks_left() < 5000) && suspend(0);
16if (u.programmer)
17pref = "% ";
18footnotes = setadd(footnotes, "prog");
19else
20pref = "  ";
21endif
22if (u in connected_players())
23lctime = ctime(time() - connected_seconds(u));
24where = connection_name(u);
25else
26lctime = ctime(u.last_connect_time);
27where = u.last_connect_place;
28endif
29name = u.name;
30if (length(name) > 15)
31name = name[1..13] + "..";
32endif
33u3 = {tostr(pref, u.name, " (", u, ")"), lctime[5..10] + lctime[20..24]};
34nwidth = max(length(u3[1]), nwidth);
35where = $string_utils:connection_hostname(where);
36if ($login:blacklisted(where))
37where = "(*) " + where;
38footnotes = setadd(footnotes, "black");
39elseif ($login:graylisted(where))
40where = "(+) " + where;
41footnotes = setadd(footnotes, "gray");
42endif
43alist = {@alist, {@u3, where}};
44endfor
45alist = $list_utils:sort_alist_suspended(0, alist, 3);
46(ticks_left() < 5000) && suspend(0);
47headers = {"Player name", "Last Login", "From Where"};
48before = {0, nwidth + 3, (nwidth + length(ctime(0))) - 11};
49tell1 = "  " + headers[1];
50tell2 = "  " + su:space(headers[1], "-");
51for j in [2..3]
52tell1 = su:left(tell1, before[j]) + headers[j];
53tell2 = su:left(tell2, before[j]) + su:space(headers[j], "-");
54endfor
55who:notify(tell1);
56who:notify(tell2);
57for a in (alist)
58(ticks_left() < 5000) && suspend(0);
59tell1 = a[1];
60for j in [2..3]
61tell1 = su:left(tell1, before[j]) + a[j];
62endfor
63who:notify(tell1[1..min($, 79)]);
64endfor
65if (footnotes)
66who:notify("");
67if ("prog" in footnotes)
68who:notify(" %  == programmer.");
69endif
70if ("black" in footnotes)
71who:notify("(*) == blacklisted site.");
72endif
73if ("gray" in footnotes)
74who:notify("(+) == graylisted site.");
75endif
76endif

show_netwho_from_listing

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1":show_netwho_from_listing(tell,site)";
2"@net-who from hoststring prints all players who have connected from that host or host substring.  Substring can include *'s, e.g. @net-who from *.foo.edu.";
3if (!caller_perms().wizard)
4return E_PERM;
5endif
6{tellwho, where} = args;
7su = $string_utils;
8if (!index(where, "*"))
9"Oh good... search for users from a site... the fast way.  No wild cards.";
10nl = 0;
11bozos = {};
12sites = $site_db:find_all_keys(where);
13while (sites)
14s = sites;
15sites = {};
16for domain in (s)
17"Temporary kluge until $site_db is repaired. --Nosredna";
18for b in ($site_db:find_exact(domain) || {})
19$command_utils:suspend_if_needed(0, "..netwho..");
20if (typeof(b) == STR)
21sites = setadd(sites, (b + ".") + domain);
22else
23bozos = setadd(bozos, b);
24nl = max(length(tostr(b, (valid(b) && is_player(b)) ? b.name | "*** recreated ***")), nl);
25endif
26endfor
27endfor
28endwhile
29if (bozos)
30tellwho:notify(tostr(su:left("  Player", nl + 7), "From"));
31tellwho:notify(tostr(su:left("  ------", nl + 7), "----"));
32for who in (bozos)
33st = su:left(tostr((valid(who) && is_player(who)) ? (who.programmer ? "% " | "  ") + who.name | "", " (", who, ")"), nl + 7);
34comma = 0;
35if ($object_utils:isa(who, $player) && is_player(who))
36for p in ({$wiz_utils:get_email_address(who) || "*Unregistered*", @who.all_connect_places})
37if (comma && (length(p) >= (78 - length(st))))
38tellwho:notify(tostr(st, ","));
39st = su:space(nl + 7) + p;
40else
41st = tostr(st, comma ? ", " | "", p);
42endif
43comma = 1;
44(ticks_left() < 5000) && suspend(0);
45endfor
46else
47st = st + (valid(who) ? "*** recreated ***" | "*** recycled ***");
48endif
49tellwho:notify(st);
50endfor
51tellwho:notify("");
52tellwho:notify(tostr(length(bozos), " player", (length(bozos) == 1) ? "" | "s", " found."));
53else
54tellwho:notify(tostr("No sites matching `", where, "'"));
55endif
56else
57"User typed 'from'.  Go search for users from this site.  (SLOW!)";
58howmany = 0;
59for who in (players())
60(ticks_left() < 5000) && suspend(0);
61matches = {};
62for name in (who.all_connect_places)
63if ((index(where, "*") && su:match_string(name, where)) || ((!index(where, "*")) && index(name, where)))
64matches = {@matches, name};
65endif
66endfor
67if (matches)
68howmany = howmany + 1;
69tellwho:notify(tostr(who.name, " (", who, "): ", su:english_list(matches)));
70endif
71endfor
72tellwho:notify(tostr(howmany || "No", " matches found."));
73endif

check_player_request check_reregistration

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1":check_player_request(name [,email [,connection]])";
2" check if the request for player and email address is valid;";
3" return empty string if it valid, or else a string saying why not.";
4" The result starts with - if this is a 'send email, don't try again' situation.";
5":check_reregistration(who, email, connection)";
6"  Since name is ignored, only check the 'email' parts and use the first arg";
7"  for the re-registering player.";
8if (!caller_perms().wizard)
9return E_PERM;
10"accesses registration information -- wiz only";
11endif
12name = args[1];
13if (verb == "check_reregistration")
14"don't check player name";
15elseif (!name)
16return "A blank name isn't allowed.";
17elseif (name == "<>")
18return "Names with angle brackets aren't allowed.";
19elseif (index(name, " "))
20return "Names with spaces are not allowed. Use dashes or underscores.";
21elseif (match(name, "^<.*>$"))
22return tostr("Try using ", name[2..$ - 1], " instead of ", name, ".");
23elseif ($player_db.frozen)
24return "New players cannot be created at the moment, try again later.";
25elseif (!$player_db:available(name))
26return ("The name '" + name) + "' is not available.";
27elseif ($login:_match_player(name) != $failed_match)
28return ("The name '" + name) + "' doesn't seem to be available.";
29endif
30if (length(args) == 1)
31"no email address supplied.";
32return "";
33endif
34address = args[2];
35addrargs = (verb == "check_reregistration") ? {name} | {};
36if ($registration_db:suspicious_address(address, @addrargs))
37return "-There has already been a character with that or a similar email address.";
38endif
39if (reason = $network:invalid_email_address(address))
40return reason + ".";
41endif
42parsed = $network:parse_address(address);
43if ($registration_db:suspicious_userid(parsed[1]))
44return tostr("-Automatic registration from an account named ", parsed[1], " is not allowed.");
45endif
46connection = (length(args) > 2) ? args[3] | parsed[2];
47if ((connection[max($ - 2, 1)..$] == ".uk") && (parsed[2][1..3] == "uk."))
48return tostr("Addresses must be in internet form. Try ", parsed[1], "@", $string_utils:from_list($list_utils:reverse($string_utils:explode(parsed[2], ".")), "."), ".");
49elseif ((verb == "check_player_request") && match(connection, "^[0-9.]+$"))
50"Allow reregistration from various things we wouldn't allow registration from.  Let them register to their yahoo acct...";
51return "-The system cannot resolve the name of the system you're connected from.";
52elseif ((verb == "check_player_request") && ((a = $network:local_domain(connection)) != (b = $network:local_domain(parsed[2]))))
53return tostr("-The connection is from '", a, "' but the mail address is '", b, "'; these don't seem to be the same place.");
54elseif ((verb == "check_player_request") && $login:spooflisted(parsed[2]))
55return tostr("-Automatic registration is not allowed from ", parsed[2], ".");
56endif
57return "";

make_player

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1"create a player named NAME with email address ADDRESS; return {object, password}.  Optional third arg is comment to be put in registration db.";
2"assumes $wiz_utils:check_player_request() has been called and it passes.";
3if (!caller_perms().wizard)
4return E_PERM;
5endif
6{name, address, @rest} = args;
7new = $quota_utils:bi_create($player_class, $nothing);
8new.name = name;
9new.aliases = {name};
10new.password = crypt(password = $wiz_utils:random_password(5));
11new.last_password_time = time();
12new.last_connect_time = $maxint;
13"Last disconnect time is creation time, until they login.";
14new.last_disconnect_time = time();
15$quota_utils:initialize_quota(new);
16if (!(error = $wiz_utils:set_player(new)))
17return player:tell("An error, ", error, " occurred while trying to make ", new, " a player. The database is probably inconsistent.");
18endif
19$wiz_utils:set_email_address(new, address);
20$registration_db:add(new, address, @rest);
21move(new, $player_start);
22new.programmer = $player_class.programmer;
23return {new, password};

send_new_player_mail

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1":send_new_player_mail(preface, name, address, character#, password)";
2"  used by $wiz:@make-player and $guest:@request";
3if (!caller_perms().wizard)
4return E_PERM;
5endif
6{preface, name, address, new, password} = args;
7msg = {preface};
8msg = {@msg, tostr("A character has been created, with name \"", name, "\" and password \"", password, "\"."), "Passwords are case sensitive, which means you have to type it exactly as", "it appears here, including capital and lowercase letters.", "So, to log in, you would type:", tostr("  Connect ", name, " ", password)};
9if ($object_utils:has_property($local, "new_player_message"))
10msg = {@msg, @$local.new_player_message};
11endif
12return $network:sendmail(address, (("Your " + $network.moo_name) + " character, ") + name, "Reply-to: " + $login.registration_address, @msg);

do_make_player

Spec any any anyFlags rxdOwner #2Definer #24

Referenced by

Source

1"do_maker_player(name,email,[comment])";
2"Common code for @make-player";
3"If no password is given, generates a random password for the player.";
4"Email-address is stored in $registration_db and on the player object.";
5if (!caller_perms().wizard)
6return E_PERM;
7endif
8{name, email, @comments} = args;
9comments = $string_utils:from_list(comments, " ");
10reason = $wiz_utils:check_player_request(name, email);
11if (others = $registration_db:find_exact(email))
12player:notify(email + " is the registered address of the following characters:");
13for x in (others)
14player:notify(tostr(valid(x[1]) ? x[1].name | "<recycled>", (valid(x[1]) && (!is_player(x[1]))) ? " {nonplayer}" | "", " (", x[1], ") ", (length(x) > 1) ? ("[" + tostr(@x[2..$])) + "]" | ""));
15endfor
16if (!reason)
17reason = "Already registered.";
18endif
19endif
20if (reason)
21player:notify(reason);
22if (!$command_utils:yes_or_no("Create character anyway? "))
23player:notify("Character not created.");
24return;
25endif
26endif
27new = $wiz_utils:make_player(name, email, comments);
28player:notify(tostr(name, " (", new[1], ") created with password `", new[2], "' for ", email, comments ? (" [" + comments) + "]" | ""));
29$mail_agent:send_message(player, $new_player_log, tostr(name, " (", new[1], ")"), tostr(email, comments ? " " + comments | ""));
30if ($network.active)
31if ($command_utils:yes_or_no(("Send email to " + email) + " with password? "))
32player:notify(tostr("Sending the password to ", email, "."));
33if ((result = $wiz_utils:send_new_player_mail(tostr("From ", player.name, "@", $network.moo_name, ":"), name, email, new[1], new[2])) == 0)
34player:notify(tostr("Mail sent successfully to ", email, "."));
35else
36player:tell("Cannot send mail: ", result);
37endif
38else
39player:notify("No mail sent.");
40endif
41else
42player:notify("Sorry, the network isn't active.");
43endif

do_register

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1"do_register(name, email_address [,comments])";
2"change player's email address.";
3if (!caller_perms().wizard)
4return E_PERM;
5endif
6{whostr, email, @comments} = args;
7comments = $string_utils:from_list(comments);
8who = $string_utils:match_player(whostr);
9if ($command_utils:player_match_failed(who, whostr))
10return;
11endif
12if (((whostr != who.name) && (!(whostr in who.aliases))) && (whostr != tostr(who)))
13player:notify(tostr("Must be a full name or an object number:  ", who.name, "(", who, ")"));
14return;
15endif
16if (reason = $network:invalid_email_address(email))
17player:notify(reason);
18if (!$command_utils:yes_or_no("Register anyway?"))
19return player:notify("re-registration aborted.");
20endif
21endif
22if (comments)
23$registration_db:add(who, email, comments);
24else
25$registration_db:add(who, email);
26endif
27old = $wiz_utils:get_email_address(who);
28$wiz_utils:set_email_address(who, email);
29player:notify(tostr(who.name, " (", who, ") formerly ", old ? old | "unregistered", ", registered at ", email, ".", comments ? (" [" + comments) + "]" | ""));

do_new_password

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1"do_new_password(who, [password])";
2if (!caller_perms().wizard)
3return E_PERM;
4endif
5{who, ?password = $wiz_utils:random_password(6)} = args;
6if (!password)
7password = $wiz_utils:random_password(6);
8endif
9whostr = $string_utils:nn(who);
10player:notify(tostr("About to change password for ", whostr, ". Old encrypted password is \"", who.password, "\""));
11who.password = crypt(password);
12who.last_password_time = time();
13$mail_agent:send_message(player, $new_password_log, tostr("@newpassword ", who.name, " (", who, ")"), {tostr("I just gave ", who.name, " a new password.")});
14player:notify(tostr(whostr, " new password is `", password, "'."));
15if (!$wiz_utils:get_email_address(who))
16player:notify(tostr(whostr, " doesn't have a registered email_address, cannot mail password; tell them some some other way."));
17elseif ((who.last_connect_time == $maxint) && $command_utils:yes_or_no(tostr(who.name, " has never logged in.  Send mail with the password as though this were a new player request?")))
18if ((result = $wiz_utils:send_new_player_mail(tostr("From ", player.name, "@", $network.moo_name, ":"), who.name, $wiz_utils:get_email_address(who), who, password)) == 0)
19player:tell("Mail sent.");
20else
21player:tell("Trouble sending mail: ", result);
22endif
23elseif ($command_utils:yes_or_no(tostr("Email new password to ", whostr, "?")))
24player:notify("Sending the password via email.");
25$network:adjust_postmaster_for_password("enter");
26if ((result = $network:sendmail($wiz_utils:get_email_address(who), ("Your " + $network.moo_name) + " password", ("The password for your " + $network.moo_name) + " character:", " " + whostr, "has been changed. The new password is:", " " + password, "", "Please note that passwords are case sensitive.")) == 0)
27player:tell("Mail sent.");
28else
29player:tell("Trouble sending mail: ", result);
30endif
31$network:adjust_postmaster_for_password("exit");
32else
33player:tell("No mail sent.");
34endif

set_owner_new

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

none

Source

1":set_owner(object,newowner[,suspendok])  does object.owner=newowner, taking care of c properties as well.  This should be used anyplace one is contemplating doing object.owner=newowner, since the latter leaves ownership of c properties unchanged.  (--Rog thinks this is a server bug).";
2{object, newowner, ?suspendok = 0} = args;
3if (!valid(object))
4return E_INVIND;
5elseif (!caller_perms().wizard)
6return E_PERM;
7elseif (!(valid(newowner) && is_player(newowner)))
8return E_INVARG;
9endif
10oldowner = object.owner;
11object.owner = newowner;
12for pname in ($object_utils:all_properties(object))
13if (suspendok && ((ticks_left() < 5000) || (seconds_left() < 2)))
14suspend(0);
15endif
16perms = property_info(object, pname)[2];
17if (index(perms, "c"))
18set_property_info(object, pname, {newowner, perms});
19endif
20endfor
21if ($object_utils:isa(oldowner, $player))
22if (is_player(oldowner) && (object != oldowner))
23$quota_utils:reimburse_quota(oldowner, object);
24endif
25if (typeof(oldowner.owned_objects) == LIST)
26oldowner.owned_objects = setremove(oldowner.owned_objects, object);
27endif
28endif
29if ($object_utils:isa(newowner, $player))
30if (object != newowner)
31$quota_utils:charge_quota(newowner, object);
32endif
33if (typeof(newowner.owned_objects) == LIST)
34newowner.owned_objects = setadd(newowner.owned_objects, object);
35endif
36endif
37return 1;

boot_idlers

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

none

Source

1if (!caller_perms().wizard)
2return E_PERM;
3endif
4"------- constants ---- ";
5"20 minutes idle for regular players";
6mintime = 60 * 20;
7"10 minutes for guests";
8minguest = 60 * 10;
9"wait 3 minutes before actually booting";
10bootdelay = 3;
11"start booting when there are 20 less than max players";
12threshold = 20;
13" ----------------------";
14if ($code_utils:task_valid(this.boot_task) && (task_id() != this.boot_task))
15"starting a new one: kill the old one";
16kill_task(this.boot_task);
17this.boot_task = 0;
18endif
19fork taskn ((bootdelay * 60) * 3)
20maxplayers = $login:max_connections() - threshold;
21if (length(pl = connected_players()) > maxplayers)
22pll = {};
23plt = {};
24for x in (pl)
25suspend(0);
26min = $object_utils:isa(x, $guest) ? minguest | mintime;
27if ((((idle = `idle_seconds(x) ! ANY => 0') > min) && (!x.wizard)) && (!(x in this.boot_exceptions)))
28pll = {x, @pll};
29plt = {idle, @plt};
30endif
31endfor
32if (pll)
33"Sort by idle time, and choose person who has been idle longest.";
34pll = $list_utils:sort(pll, plt);
35booted = pll[$];
36guest = $object_utils:isa(booted, $guest);
37min = guest ? minguest | mintime;
38if (`idle_seconds(booted) ! ANY => 0' > min)
39notify(booted, tostr("*** You've been idle more than ", min / 60, " minutes, and there are more than ", maxplayers, " players connected. If you're still idle and LambdaMOO is still busy in ", bootdelay, " minute", (bootdelay == 1) ? "" | "s", ", you will be booted. ***"));
40fork (60 * bootdelay)
41idle = `idle_seconds(booted) ! ANY => 0';
42if ((idle > min) && (length(connected_players()) > ($login:max_connections() - threshold)))
43notify(booted, "*** You've been idle too long and LambdaMOO is still too busy ***");
44server_log(tostr("IDLE: ", booted.name, " (", booted, ") idle ", idle / 60));
45boot_player(booted);
46endif
47endfork
48endif
49endif
50endif
51this:(verb)(@args);
52endfork
53this.boot_task = taskn;
54"This is set up so that it forks the task first, and this.boot_task is the task_id of whatever is running the idle booter";

grant_object

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

none

Source

1":grant_object(what, towhom);";
2"Ownership of the object changes as in @chown and :set_owner (i.e., .owner and all c properties change).  In addition all verbs and !c properties owned by the original owner change ownership as well.  Finally, for !c properties, instances on descendant objects change ownership (as in :set_property_owner).";
3if (!caller_perms().wizard)
4return E_PERM;
5endif
6{object, newowner} = args;
7if (!is_player(newowner))
8return E_INVARG;
9endif
10same = object.owner == newowner;
11for vnum in [1..length(verbs(object))]
12info = verb_info(object, vnum);
13if (!((info[1] != object.owner) && (valid(info[1]) && is_player(info[1]))))
14same = same && (info[1] == newowner);
15set_verb_info(object, vnum, listset(info, newowner, 1));
16endif
17endfor
18for prop in (properties(object))
19(ticks_left() < 5000) && suspend(0);
20info = property_info(object, prop);
21if (!(index(info[2], "c") || (((info[1] != object.owner) && valid(info[1])) && is_player(info[1]))))
22same = same && (info[1] == newowner);
23$wiz_utils:set_property_owner(object, prop, newowner, 1);
24endif
25endfor
26suspend(0);
27$wiz_utils:set_owner(object, newowner, 1);
28return same ? "nothing changed" | "grant changed";

connection_hash

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1"connection_hash(forwhom, host [,seed])";
2"Compute an encrypted hash of the host for 'forwhom', using 'crypt'.";
3{forwhom, host, @seed} = args;
4hash = toint(forwhom);
5for i in [1..length(host)]
6hash = (hash * 14) + index($string_utils.ascii, host[i]);
7endfor
8return crypt(tostr(hash), @seed);

newt_player

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1":newt_player(who [ , commentary] [, temporary])";
2{who, ?comment = "", ?temporary = 0} = args;
3if (!caller_perms().wizard)
4$error:raise(E_PERM);
5elseif (length(args) < 1)
6$error:raise(E_ARGS);
7elseif ((typeof(who = args[1]) != OBJ) || (!is_player(who)))
8$error:raise(E_INVARG);
9else
10if (!comment)
11player:notify("So why has this player been newted?");
12comment = $command_utils:read();
13endif
14if (temporary)
15comment = temporary + comment;
16endif
17$login.newted = setadd($login.newted, who);
18if (msg = player:newt_victim_msg())
19notify(who, msg);
20endif
21notify(who, $login:newt_registration_string());
22boot_player(who);
23player:notify(tostr(who.name, " (", who, ") has been turned into a newt."));
24$mail_agent:send_message(player, $newt_log, tostr("@newt ", who.name, " (", who, ")"), {$string_utils:from_list(who.all_connect_places, " "), @comment ? {comment} | {}});
25if ($object_utils:isa(who.location, $room) && (msg = player:newt_msg()))
26who.location:announce_all_but({who}, msg);
27endif
28player:notify(tostr("Mail sent to ", $mail_agent:name($newt_log), "."));
29endif

unset_programmer

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1":unset_programmer(victim[,reason[,start time,duration]]) => 1 or error.";
2"Resets victim.programmer, adds victim to .programmer_restricted.";
3"Put into temporary list if 3rd and 4th arguments are given. Which restricts the victim for uptime duration since start time. Must give a reason, though it can be blank, in this case.";
4{victim, ?reason = "", ?start = 0, ?duration = 0} = args;
5if (!caller_perms().wizard)
6return E_PERM;
7elseif (!valid(victim))
8return E_INVARG;
9elseif ((!victim.programmer) && this:check_prog_restricted(victim))
10return E_NONE;
11else
12victim.programmer = 0;
13if (is_player(victim) && $object_utils:isa(victim, $player))
14this.programmer_restricted = setadd(this.programmer_restricted, victim);
15if (start)
16this.programmer_restricted_temp = setadd(this.programmer_restricted_temp, {victim, start, duration});
17endif
18endif
19$mail_agent:send_message(caller_perms(), {$newt_log}, tostr("@deprogrammer ", victim.name, " (", victim, ")"), reason ? (typeof(reason) == STR) ? {reason} | reason | {});
20return 1;
21endif

is_wizard

Spec this none thisFlags rxdOwner #36Definer #24

Referenced by

none

Source

1":is_wizard(who) => whether `who' is a wizard or is the .public_identity of some wizard.";
2"This verb is used for permission checks on commands that should only be accessible to wizards or their ordinary-player counterparts.  It will return true for unadvertised wizards.";
3who = args[1];
4if (who.wizard)
5return 1;
6else
7for w in ($object_utils:leaves($wiz))
8if ((w.wizard && is_player(w)) && (who == `w.public_identity ! ANY'))
9return 1;
10endif
11endfor
12endif
13return 0;

expire_mail

Spec none none noneFlags rxdOwner #2Definer #24

Referenced by

Source

1if (!caller_perms().wizard)
2return E_PERM;
3endif
4this:expire_mail_lists();
5this:expire_mail_players();

expire_mail_weekly

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

none

Source

1if (!caller_perms().wizard)
2return E_PERM;
3endif
4fork (((7 * 24) * 60) * 60)
5this:(verb)();
6endfork
7this:expire_mail();

check_prog_restricted

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1"Checks to see if args[1] is restricted from programmer either permanently or temporarily. Removes from temporary list if time is up";
2if ((caller != this) && (!$perm_utils:controls(caller_perms(), this)))
3return E_PERM;
4endif
5if ((who = args[1]) in this.programmer_restricted)
6"okay, who is restricted. Now check to see if it is temporary";
7if (entry = $list_utils:assoc(who, this.programmer_restricted_temp))
8if ($login:uptime_since(entry[2]) > entry[3])
9"It's temporary and the time is up, remove and return false";
10this.programmer_restricted_temp = setremove(this.programmer_restricted_temp, entry);
11this.programmer_restricted = setremove(this.programmer_restricted, who);
12return 0;
13else
14"time is not up";
15return 1;
16endif
17else
18return 1;
19endif
20else
21return 0;
22endif

expire_mail_players

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1if (!caller_perms().wizard)
2return E_PERM;
3endif
4s = 0;
5for p in (players())
6this.expiration_progress = p;
7if ((p.owner == p) && is_player(p))
8s = s + (p:expire_old_messages() || 0);
9endif
10if (ticks_left() < 10000)
11set_task_perms($wiz_utils:random_wizard());
12suspend(0);
13endif
14endfor
15$mail_agent:send_message(player, player, verb, tostr(s, " messages have been expired from players."));
16return s;

expire_mail_lists

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1if (!caller_perms().wizard)
2return E_PERM;
3endif
4sum = 0;
5for x in ($object_utils:leaves_suspended($mail_recipient))
6this.expiration_progress = x;
7temp = x:expire_old_messages();
8if (typeof(temp) == INT)
9sum = sum + temp;
10endif
11"just suspend for every fucker, I'm tired of losing.";
12set_task_perms($wiz_utils:random_wizard());
13suspend(0);
14endfor
15$mail_agent:send_message(player, player, verb, tostr(sum, " messages have been expired from mailing lists."));
16return sum;

flush_editors

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

none

Source

1if (!caller_perms().wizard)
2return E_PERM;
3else
4fork (86400 * 7)
5this:(verb)();
6endfork
7player:tell("Flushing ancient editor sessions.");
8for x in ({$verb_editor, $note_editor, $mail_editor})
9x:do_flush(time() - (30 * 86400), 0);
10(ticks_left() < 5000) && suspend(0);
11endfor
12endif

random_wizard

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1"Put all your wizards in $wiz_utils.wizards.  Then various long-running tasks will cycle among the permissions, spreading out the scheduler-induced personal lag.";
2w = this.wizards;
3i = this.next_perm_index;
4if (i == length(w))
5i = 1;
6else
7i = i + 1;
8endif
9this.next_perm_index = i;
10return w[i];

set_email_address

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1set_task_perms(caller_perms());
2{who, email} = args;
3if (typeof(who.email_address) == LIST)
4who.email_address[1] = email;
5else
6who.email_address = email;
7endif

get_email_address

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1set_task_perms(caller_perms());
2{who} = args;
3if (typeof(who.email_address) == LIST)
4return who.email_address[1];
5else
6return who.email_address;
7endif

_mac_moomail_fix

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

none

Source

1"Run this verb if you're server is on a mac and time() returns a negative number.";
2"$mail_recipient_class:make_current_message() will continue to fix the problem if there is a $server_options.is_mac property and it is on (not 0 or empty).";
3"This is a kludgy fix. A bypass of the builtin time() function would be better.";
4if (!caller_perms().wizard)
5player:notify("Nice try.");
6endif
7for x in ($object_utils:descendants_suspended($mail_recipient_class))
8x.current_message[2] = -1300000000;
9if ((l = length(x.current_message)) > 2)
10for m in [3..l]
11(ticks_left() < 4000) && suspend(0);
12`e = x.current_message[m][3] = -1300000000 ! ANY => player:notify(tostr(e))';
13endfor
14endif
15endfor
16`$server_options.is_mac = 1 ! E_PROPNF => "Somebody erased the prop!"';

make_init_verb

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1"USAGE: :make_init_verb(obj, core name)";
2if (valid(object = args[1]) && caller_perms().wizard)
3if (!`!(!property_info(#0, args[2])) ! ANY => 0')
4return player:notify("ERROR: invalid core name.");
5endif
6try
7x = add_verb(object, {#2, "rxd", "init_for_core"}, {"this", "none", "this"});
8player:notify(tostr("Verb added (", length(verbs(object)), ")."));
9except error (ANY)
10player:notify(error[2]);
11endtry
12corn = args[2];
13lines = {"if (caller_perms().wizard)", tostr("if (this == $", corn, ")")};
14for p in (properties(object))
15(ticks_left() < 4000) && suspend(0);
16if (typeof(o = object.(p)) == OBJ)
17if (o in $core_objects())
18for q in (properties(#0))
19if (o == #0.(q))
20break;
21endif
22(ticks_left() < 2000) && suspend(0);
23endfor
24lines = {@lines, tostr("this.", p, " = $", q, ";")};
25elseif (is_player(o))
26lines = o.wizard ? {@lines, tostr("this.", p, " = #2;")} | {@lines, tostr("this.", p, " = $hacker;")};
27else
28lines = {@lines, tostr("this.", p, " = $nothing;")};
29endif
30else
31lines = {@lines, tostr("this.", p, " = ", toliteral(object.(p)), ";")};
32endif
33endfor
34suspend(0);
35lines = {@lines, "else", tostr("for p in (properties($", corn, "))"), "if (!p in {\"build_help\", \"help_msg\"})", "clear_property(this, p);", "endif", "endfor", "endif", "return pass(@args);", "endif"};
36try
37if (result = set_verb_code(object, "init_for_core", lines))
38player:notify_lines(result);
39player:notify(tostr(length(result), " error(s)."));
40player:notify("Verb not programmed.");
41else
42player:notify("0 errors.");
43player:notify("Verb programmed.");
44endif
45except error (ANY)
46player:notify(error[2]);
47player:notify("Verb not programmed.");
48endtry
49endif

checkpoint_started_msg checkpoint_failed_msg checkpoint_finished_msg

Spec this none thisFlags rxdOwner #2Definer #24

Referenced by

Source

1"Messages told to all the MOO when a checkpoint begins, ends, or fails.";
2"Method provided in case some fancy substitutions wanna be done, such as last checkpoint times, durations, etc.";
3elapsed = `$local.dump_finished - $local.dump_started ! ANY => 0';
4return elapsed ? strsub(this.(verb), "$elapsed", $time_utils:english_time(elapsed)) | this.(verb);