Wizard Utilities #17
Aliases: Wizard Utilities
53 verbs · 27 properties · 0 children
Verbs
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
default_programmer_quota | #17 | rc | #361 | 1073741823 |
default_player_quota | #17 | rc | #361 | 1073741823 |
missed_help_strings | #17 | r | #361 | {} |
missed_help_counters | #17 | r | #361 | {} |
record_missed_help | #17 | rc | #361 | 0 |
programmer_restricted | #17 | rc | #361 | {} |
boot_task | #17 | rc | #361 | 585440461 |
boot_exceptions | #17 | rc | #361 | {} |
programmer_restricted_temp | #17 | rc | #361 | {} |
suicide_string | #17 | rc | #361 | "You don't *really* want to commit suicide, do you?" |
next_perm_index | #17 | rc | #361 | 1 |
wizards | #17 | rc | #361 | {#361} |
old_task_perms_user | #17 | rc | #361 | {#39} |
expiration_progress | #17 | rc | #361 | #-1 |
system_chars | #17 | rc | #361 | {#29, #31, #65} |
new_core_message | #17 | r | #361 | list of 145{"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]"} |
help_msg | #72 | rc | #361 | list of 55{"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.", "", ":teleport_work(something going, where they're going to)", " move someone through an exit, which conveniently takes them to ", " where they're going, even though it will never do that for", " anyone else. magical hacks.", "", ":set_verb_code(object, verbname, code)", " using caller_perms(), set verb as given, and log the change to ", " both $changelog and the server log.", "", ":recursive_recycle(object) and :recursive_chown(object, new-owner)", " exactly what you'd expect, suspends as needed and changes ", " the entire hierarchy of objects from the given object.", " use with caution, a shot of scotch, etc.", "", ":move_prop_down(prop_name, ancestor, descendant)", " brings a prop down from ancestor to descendant, keeping their values by", " using a temporary backup prop for migration. removes the property from", " ancestor permanently."} |
aliases | #1 | rc | #361 | {"Wizard Utilities"} |
description | #1 | rc | #361 | {"This is the Wizard Utilities utility package. See `help $wiz_utils' for more details."} |
object_size | #1 | r | #29 | {66384, 1298433815} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | <clear> |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #72 Generic Utilities Package → #1 root
Children: none
Call graph
Showing 48 of 107 verbs; 59 not shown.
Source
set_programmer
Referenced by
- #49:@programmer line 11:
$wiz_utils:set_programmer
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
Referenced by
- #17:make_player line 16:
$wiz_utils:set_player - #17:make_ur_player line 17:
$wiz_utils:set_player - #49:@untoad line 10:
$wiz_utils:set_player - #49:@make-guest line 32:
$wiz_utils:set_player
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
Referenced by
- #2:@dig line 8:
$wiz_utils:set_owner - #2:@dig line 29:
$wiz_utils:set_owner - #17:set_player line 25:
$wiz_utils:set_owner - #17:unset_player line 12:
$wiz_utils:set_owner - #17:grant_object line 27:
$wiz_utils:set_owner - #17:recursive_chown line 7:
$wiz_utils:set_owner - #21:transfer_ownership(useless) line 12:
$wiz_utils:set_owner - #49:@chown*# line 59:
$wiz_utils:set_owner - #49:@old-grant line 63:
$wiz_utils:set_owner - #50:@chown*# line 115:
$wiz_utils:set_owner - #57:_recycle line 35:
$wiz_utils:set_owner - #57:setup_toad line 7:
$wiz_utils:set_owner - #57:resurrect line 12:
$wiz_utils:set_owner - #114:chown line 4:
$wiz_utils:set_owner - #114:chown line 6:
$wiz_utils:set_owner - #114:chown line 11:
$wiz_utils:set_owner - #142:_spawn line 7:
$wiz_utils:set_owner - #142:award_species_quest line 26:
$wiz_utils:set_owner - #147:do_make line 63:
$wiz_utils:set_owner - #167:create_channel line 6:
$wiz_utils:set_owner - #186:_new_clean line 39:
$wiz_utils:set_owner - #186:_new_clean line 58:
$wiz_utils:set_owner - #189:map_area line 3:
$wiz_utils:set_owner - #334:dig line 52:
$wiz_utils:set_owner - #334:dig line 64:
$wiz_utils:set_owner - #334:dig line 65:
$wiz_utils:set_owner - #342:_clone line 15:
$wiz_utils:set_owner
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; 12if (oldowner == newowner) 13return; 14endif 15for pname in ($object_utils:all_properties(object)) 16if (suspendok && ((ticks_left() < 5000) || (seconds_left() < 2))) 17suspend(0); 18endif 19perms = property_info(object, pname)[2]; 20if (index(perms, "c")) 21set_property_info(object, pname, {newowner, perms}); 22endif 23endfor 24if (is_a(oldowner, $player)) 25if (((oldowner != #984) && is_player(oldowner)) && (object != oldowner)) 26$quota_utils:reimburse_quota(oldowner, object); 27endif 28if (typeof(oldowner.owned_objects) == LIST) 29oldowner.owned_objects = setremove(oldowner.owned_objects, object); 30endif 31endif 32if (is_player(newowner)) 33if ((newowner != #984) && (object != newowner)) 34$quota_utils:charge_quota(newowner, object); 35endif 36if (typeof(newowner.owned_objects) == LIST) 37newowner.owned_objects = setadd(newowner.owned_objects, object); 38endif 39endif 40return 1;
set_property_owner
Referenced by
- #17:set_property_owner line 26:
this:set_property_owner - #17:grant_object line 23:
$wiz_utils:set_property_owner - #49:@chown*# line 47:
$wiz_utils:set_property_owner - #49:@old-grant line 57:
$wiz_utils:set_property_owner - #50:@chown*# line 86:
$wiz_utils:set_property_owner - #361:@unprop line 9:
$wiz_utils:set_property_owner
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
Referenced by
- #0:bf_recycle line 13:
$wiz_utils:unset_player - #49:@toad line 38:
$wiz_utils:unset_player
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
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
Referenced by
- #17:set_property_flags line 27:
this:_set_property_flags - #17:_set_property_flags line 16:
this:_set_property_flags
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
Referenced by
- #6:@registerme line 42:
$wiz_utils:random_password - #17:make_player line 10:
$wiz_utils:random_password - #17:do_new_password line 5:
$wiz_utils:random_password - #17:do_new_password line 7:
$wiz_utils:random_password - #17:make_ur_player line 11:
$wiz_utils:random_password - #17:reset_password line 6:
$wiz_utils:random_password - #17:reset_password line 8:
$wiz_utils:random_password - #37:@register line 33:
$wiz_utils:random_password
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
Referenced by
- #50:@forked line 19:
$wiz_utils:queued_tasks - #50:@forked-v*erbose line 19:
$wiz_utils:queued_tasks - #51:owns_task line 3:
$wiz_utils:queued_tasks
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
isnewt
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
Referenced by
- #49:mcd_2 line 93:
$wiz_utils:initialize_owned
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
Referenced by
- #17:initialize_owned line 15:
this:verify_owned_objects
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
Referenced by
- #0:bf_recycle line 7:
$wiz_utils:connected_wizards_unadvertised - #4:w*ho line 1:
$wiz_utils:connected_wizards
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
Referenced by
- #49:@lock-login line 17:
$wiz_utils:all_wizards_unadvertised
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
Referenced by
- #49:@toad line 30:
$wiz_utils:rename_all_instances - #49:@toad line 33:
$wiz_utils:rename_all_instances
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
Referenced by
- #2:?* line 17:
$wiz_utils:missed_help - #2:?* line 20:
$wiz_utils:missed_help - #90:get_help_topic line 15:
$wiz_utils:missed_help - #90:get_help_topic line 18:
$wiz_utils:missed_help
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
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$command_utils:suspend_if_needed(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$command_utils:suspend_if_needed(0); 17player:tell(sorted[(len - x) + 1]); 18endfor 19player:tell(" - - - - - - - - -");
init_for_core
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; 14endif
show_netwho_listing
Referenced by
- #49:@net-who line 18:
$wiz_utils:show_netwho_listing
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$command_utils:suspend_if_needed(0); 16if (u.programmer) 17pref = "% "; 18footnotes = setadd(footnotes, "prog"); 19else 20pref = " "; 21endif 22if (is_connected(u)) 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$command_utils:suspend_if_needed(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$command_utils:suspend_if_needed(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
check_player_request check_reregistration
Referenced by
- #4:request_character line 8:
$wiz_utils:check_player_request - #6:@registerme line 28:
$wiz_utils:check_reregistration - #17:do_make_player line 6:
$wiz_utils:check_player_request
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 (match(name, "^<.*>$")) 20return tostr("Try using ", name[2..$ - 1], " instead of ", name, "."); 21elseif (!$login:name_ok(name)) 22return "Sorry, that name won't work. Use a-z, 0-9, and underscores, and keep it under 20 characters."; 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} | {}; 36"if ($registration_db:suspicious_address(address, @addrargs))"; 37" return \"-There has already been a character with that or a similar email address.\";"; 38"endif"; 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], ".")), "."), "."); 49"elseif ((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..."; 51"return \"-The system cannot resolve the name of the system you're connected from.\";"; 52elseif ((verb == "check_player_request") && $login:spooflisted(parsed[2])) 53return tostr("-Automatic registration is not allowed from ", parsed[2], "."); 54endif 55return "";
make_player
Referenced by
- #4:request_character line 66:
$wiz_utils:make_player - #17:do_make_player line 23:
$wiz_utils:make_player
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; 23new.r = 1; 24return {new, password};
send_new_player_mail
Referenced by
- #4:request_character line 75:
$wiz_utils:send_new_player_mail - #17:do_new_password line 18:
$wiz_utils:send_new_player_mail - #17:do_make_player line 29:
$wiz_utils:send_new_player_mail
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_register
Referenced by
- #49:@register line 7:
$wiz_utils:do_register
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
Referenced by
- #49:@new-password line 11:
$wiz_utils:do_new_password
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
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 (is_a(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 (is_a(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
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
Referenced by
- #21:make_exit_pair line 16:
$wiz_utils:grant_object - #21:make_exit_pair line 17:
$wiz_utils:grant_object
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$command_utils:suspend_if_needed(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
Referenced by
none
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
Referenced by
- #49:@newt line 21:
$wiz_utils:newt_player - #49:@temp-newt line 16:
$wiz_utils:newt_player
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(temporary ? "@temp-newt " | "@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(dobj))) 26who.location:announce_all_but({who}, msg); 27endif 28player:notify(tostr("Mail sent to ", $mail_agent:name($newt_log), ".")); 29endif
unset_programmer
Referenced by
- #49:@deprog*rammer line 33:
$wiz_utils:unset_programmer
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
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
Referenced by
- #17:expire_mail_weekly line 7:
this:expire_mail
Source
1if (!caller_perms().wizard) 2return E_PERM; 3endif 4this:expire_mail_lists(); 5this:expire_mail_players();
expire_mail_weekly
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
Referenced by
- #17:set_programmer line 11:
this:check_prog_restricted - #17:unset_programmer line 9:
this:check_prog_restricted - #49:@programmer line 6:
$wiz_utils:check_prog_restricted
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
Referenced by
- #17:expire_mail line 5:
this:expire_mail_players - #298:expire_mail_weekly line 1:
$wu:expire_mail_players
Source
1if (!caller_perms().wizard) 2return E_PERM; 3endif 4s = 0; 5for p in (players()) 6$cu:sin(); 7if ((!is_a(p, $immortal)) && (p.email_address != "")) 8this.expiration_progress = p; 9if ((p.owner == p) && is_player(p)) 10s = s + (p:expire_old_messages() || 0); 11endif 12if (ticks_left() < 10000) 13set_task_perms($wiz_utils:random_wizard()); 14suspend(0); 15endif 16endif 17endfor 18$mail_agent:send_message(player, player, verb, tostr(s, " messages have been expired from players.")); 19return s;
expire_mail_lists
Referenced by
- #17:expire_mail line 4:
this:expire_mail_lists
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
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$command_utils:suspend_if_needed(0); 11endfor 12endif
random_wizard
Referenced by
- #11:prune line 39:
$wiz_utils:random_wizard - #17:expire_mail_players line 13:
$wiz_utils:random_wizard - #17:expire_mail_lists line 12:
$wiz_utils:random_wizard - #37:expire_old_messages line 3:
$wiz_utils:random_wizard - #38:raw_send line 16:
$wiz_utils:random_wizard - #73:object_bytes line 2:
$wiz_utils:random_wizard - #75:object_bytes line 2:
$wiz_utils:random_wizard - #75:task_perms line 3:
$wiz_utils:random_wizard
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
Referenced by
- #6:@registerme line 53:
$wiz_utils:set_email_address - #17:make_player line 19:
$wiz_utils:set_email_address - #17:do_register line 28:
$wiz_utils:set_email_address - #17:make_ur_player line 20:
$wiz_utils:set_email_address
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
Referenced by
- #6:@registerme line 13:
$wiz_utils:get_email_address - #6:@registerme line 14:
$wiz_utils:get_email_address - #6:@registerme line 25:
$wiz_utils:get_email_address - #6:@registerme line 43:
$wiz_utils:get_email_address - #11:describe_registration line 6:
$wiz_utils:get_email_address - #17:do_register line 27:
$wiz_utils:get_email_address - #17:do_new_password line 15:
$wiz_utils:get_email_address - #17:do_new_password line 18:
$wiz_utils:get_email_address - #17:do_new_password line 26:
$wiz_utils:get_email_address - #17:reset_password line 16:
$wiz_utils:get_email_address - #33:send_self_netmail line 5:
$wiz_utils:get_email_address - #33:send_self_netmail line 15:
$wiz_utils:get_email_address - #33:@netforw*ard line 7:
$wiz_utils:get_email_address - #33:expire_old_messages line 1:
$wiz_utils:get_email_address - #37:@register line 24:
$wiz_utils:get_email_address - #37:@register line 25:
$wiz_utils:get_email_address - #59:check_netmail line 8:
$wiz_utils:get_email_address - #81:check_email line 5:
$wiz_utils:get_email_address
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
teleport_walk
Referenced by
- #49:@summon line 6:
$wiz_utils:teleport_walk
Source
1who = args[1]; 2to = args[2]; 3from = who.location; 4exit = entrance = #-1; 5for x in (from.exits) 6if (x:allows(who) && valid(x.otherside)) 7exit = x; 8entrance = x.otherside; 9endif 10endfor 11if (!valid(exit)) 12return E_INVARG; 13endif 14entrance_home = entrance.location; 15entrance:moveto(to); 16exit:move(who); 17entrance:moveto(entrance_home);
set_verb_code
Referenced by
- #41:set_verb_code line 7:
$wiz_utils:set_verb_code - #50:@copy line 87:
$wiz_utils:set_verb_code - #50:@prog*ram line 96:
$wiz_utils:set_verb_code - #251:_do_add_verb line 4:
$wiz_utils:set_verb_code - #251:_do_set_verb line 3:
$wiz_utils:set_verb_code
Source
1{object, verbname, code} = args; 2who = caller_perms(); 3result = this:_set_verb_code(who, object, verbname, code); 4if ((typeof(result) != ERR) && (!result)) 5logmsg = tostr("VERB PROGRAMMED: ", object.name, " - ", object, ":", verbname, " by ", who.name, " (", who, ")"); 6server_log(logmsg); 7try 8if (toint(verbname) != 0) 9verbname = verb_info(object, verbname)[3]; 10endif 11$changelog:log(who, object, verbname); 12$nets.change:announce_change(who, object, verbname); 13except e (ANY) 14$rpg:report_error(e, "CHANGELOG"); 15endtry 16try 17if (who.wizard) 18info = verb_info(object, verbname); 19if ((info[1] != who) && (info[1] != #2)) 20if (info[1].wizard) 21info[1] = who; 22set_verb_info(object, verbname, info); 23else 24who:tell("Verb ownership not changed to you due to security (current owner is not a wizard.)"); 25endif 26endif 27endif 28except e (ANY) 29$rpg:report_error(e); 30endtry 31endif 32return result;
_set_verb_code
Referenced by
- #17:set_verb_code line 3:
this:_set_verb_code
Source
1{who, object, verbname, code} = args; 2set_task_perms(who); 3return `set_verb_code(object, verbname, code) ! ANY';
recursive_recycle
Referenced by
- #17:recursive_recycle line 11:
this:recursive_recycle - #49:@recycle-recursive line 20:
$wiz_utils:recursive_recycle
Source
1if (!caller_perms().wizard) 2return E_PERM; 3endif 4target = args[1]; 5who = (length(args) > 1) ? args[2] | #-1; 6if (!valid(target)) 7return E_INVARG; 8endif 9for x in (target.contents) 10$cu:suspend_if_needed(1); 11this:recursive_recycle(x, who); 12endfor 13valid(who) && who:tell("Recycling ", $su:nn(target)); 14$recycler:_recycle(target);
recursive_chown
Referenced by
- #17:recursive_chown line 12:
$wiz_utils:recursive_chown
Source
1set_task_perms(caller_perms()); 2what = args[1]; 3who = args[2]; 4if ((!is_a(who, $player)) || is_a(what, $player)) 5return E_INVARG; 6endif 7$wiz_utils:set_owner(what, who); 8$cu:sin(0); 9player:tell("Setting ownership for " + $su:nn(what)); 10for x in (what.contents) 11$cu:sin(0); 12$wiz_utils:recursive_chown(x, who); 13endfor
move_prop_down
Referenced by
none
Source
1":move_prop_down(STR prop_name, OBJ ancestor, OBJ descendant)"; 2set_task_perms(caller_perms()); 3prop_name = args[1]; 4ancestor = args[2]; 5descendant = args[3]; 6if (!$ou:defines_property(ancestor, prop_name)) 7return E_INVARG; 8elseif (!(ancestor in $ou:ancestors(descendant))) 9return E_NONE; 10endif 11propinfo = property_info(ancestor, prop_name); 12if (!$perm_utils:controls(propinfo[1], descendant)) 13return E_PERM; 14endif 15add_property(descendant, prop_name + "_backup", descendant.(prop_name), propinfo); 16for x in ($ou:descendants_suspended(descendant)) 17$cu:sin(0); 18x.(prop_name + "_backup") = x.(prop_name); 19endfor 20delete_property(ancestor, prop_name); 21add_property(descendant, prop_name, descendant.(prop_name + "_backup"), propinfo); 22for x in ($ou:descendants_suspended(descendant)) 23$cu:sin(0); 24x.(prop_name) = x.(prop_name + "_backup"); 25endfor 26delete_property(descendant, prop_name + "_backup");
move_prop_up
Referenced by
none
Source
1":move_prop_up(STR prop_name, OBJ ancestor, OBJ descendant)"; 2set_task_perms(caller_perms()); 3prop_name = args[1]; 4ancestor = args[2]; 5descendant = args[3]; 6if (!$ou:defines_property(descendant, prop_name)) 7return E_INVARG; 8elseif (!(descendant in $ou:branches_suspended(ancestor))) 9return E_NONE; 10endif 11for x in ($ou:siblings(descendant)) 12$cu:sin(0); 13for y in ({x, @$ou:branches_suspended(x)}) 14$cu:sin(0); 15if ($ou:defines_property(y, prop_name)) 16return (("can't move -- " + prop_name) + " is defined on ") + $su:nn(y); 17endif 18endfor 19endfor 20propinfo = property_info(descendant, prop_name); 21if (!$perm_utils:controls(propinfo[1], ancestor)) 22return E_PERM; 23endif 24add_property(descendant, prop_name + "_backup", descendant.(prop_name), propinfo); 25for x in ($ou:descendants_suspended(descendant)) 26$cu:sin(0); 27x.(prop_name + "_backup") = x.(prop_name); 28endfor 29delete_property(descendant, prop_name); 30add_property(ancestor, prop_name, descendant.(prop_name + "_backup"), propinfo); 31for x in ($ou:descendants_suspended(descendant)) 32$cu:sin(0); 33x.(prop_name) = x.(prop_name + "_backup"); 34endfor 35delete_property(descendant, prop_name + "_backup");
grab_next_objnum
Referenced by
- #4:cr*eate line 31:
$wiz_utils:grab_next_objnum
Source
1try 2o = create($thing); 3o.name = tostr(o); 4o.aliases = {o.name, tostr(tonum(o))}; 5o.weight = tonum(o); 6o:moveto(#215168); 7except e (ANY) 8$rpg:report_error(e); 9endtry 10$nets.prognet:announce(this, ("Object " + tostr(o)) + " was captured from max_object() and moved to the boiler room! Congratulations, db bloaters!!", 1); 11$nets.prognet:announce(this, " *fireworks etc* ", 1);
make_ur_player
Referenced by
none
Source
1"Copied from Wizard Utilities (#24):make_player by Gilmore (#98) Sun Mar 7 23:32:18 2010 CST"; 2"create a player named NAME with email address ADDRESS; return {object, password}. Optional third arg is comment to be put in registration db."; 3"assumes $wiz_utils:check_player_request() has been called and it passes."; 4if (!caller_perms().wizard) 5return E_PERM; 6endif 7{name, address, @rest} = args; 8new = $quota_utils:bi_create($ur_player_class, $nothing); 9new.name = name; 10new.aliases = {name}; 11new.password = crypt(password = $wiz_utils:random_password(5)); 12new.last_password_time = time(); 13new.last_connect_time = $maxint; 14"Last disconnect time is creation time, until they login."; 15new.last_disconnect_time = time(); 16$quota_utils:initialize_quota(new); 17if (!(error = $wiz_utils:set_player(new))) 18return player:tell("An error, ", error, " occurred while trying to make ", new, " a player. The database is probably inconsistent."); 19endif 20$wiz_utils:set_email_address(new, address); 21$registration_db:add(new, address, @rest); 22move(new, $ur_player_start); 23new.programmer = $ur_player_class.programmer; 24return {new, password};
send_new_password_mail
Referenced by
- #4:request_password line 49:
$wiz_utils:send_new_password_mail
Source
1"Copied from Wizard Utilities (#24):send_new_player_mail by Satan (#2) Mon May 3 13:04:09 2010 CDT"; 2":send_new_player_mail(preface, name, address, character#, password)"; 3" used by $wiz:@make-player and $guest:@request"; 4if (!caller_perms().wizard) 5return E_PERM; 6endif 7{preface, name, address, reqhash} = args; 8msg = {preface}; 9msg = {@msg, tostr("A password reset has been requested for ", name, " and the verification code ", reqhash, " has been generated. To complete the request and reset your password, connect again and type \"reset ", name, " ", reqhash, "\" (without the quotes).")}; 10return $network:sendmail(address, (("Password reset for your " + $network.moo_name) + " character, ") + name, "Reply-to: " + $login.registration_address, @msg);
emergency_announce
Referenced by
none
Source
1if (!caller_perms().wizard) 2raise(E_PERM); 3endif 4header = tostr($ansi.red, $ansi.bold_on, " [!!! ANNOUNCEMENT]", $ansi.reset); 5msg = tostr($ansi.red, $ansi.bold_on, " ", @args, $ansi.reset); 6for p in (connected_players()) 7if (p.programmer) 8notify(p, ""); 9notify(p, header); 10notify(p, msg); 11notify(p, ""); 12endif 13yield; 14endfor
reset_password
Referenced by
- #4:reset_password line 45:
$wiz_utils:reset_password
Source
1"Copied from Wizard Utilities (#24):do_new_password by Satan (#2) Sun May 16 03:36:36 2010 CDT"; 2"do_new_password(who, [password])"; 3if (!caller_perms().wizard) 4return E_PERM; 5endif 6{who, ?password = $wiz_utils:random_password(6)} = args; 7if (!password) 8password = $wiz_utils:random_password(6); 9endif 10whostr = $string_utils:nn(who); 11who.password = crypt(password); 12who.last_password_time = time(); 13$login.password_requests = hashremove($login.password_requests, who); 14$mail_agent:send_message(who, $new_password_log, tostr("Password reset for ", who.name, " (", who, ")"), {tostr("I just gave ", who.name, " a new password.")}); 15$network:adjust_postmaster_for_password("enter"); 16if ((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) 17endif 18$network:adjust_postmaster_for_password("exit");
do_make_player
Referenced by
- #49:@make-player line 13:
$wiz_utils:do_make_player
Source
1if (!caller_perms().wizard) 2return E_PERM; 3endif 4{name, email, @comments} = args; 5comments = $string_utils:from_list(comments, " "); 6reason = $wiz_utils:check_player_request(name, email); 7if (others = $registration_db:find_exact(email)) 8player:notify(email + " is the registered address of the following characters:"); 9for x in (others) 10player: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..$])) + "]" | "")); 11endfor 12if (!reason) 13reason = "Already registered."; 14endif 15endif 16if (reason) 17player:notify(reason); 18if (!$command_utils:yes_or_no("Create character anyway? ")) 19player:notify("Character not created."); 20return; 21endif 22endif 23new = $wiz_utils:make_player(name, email, comments); 24player:notify(tostr(name, " (", new[1], ") created with password `", new[2], "' for ", email, comments ? (" [" + comments) + "]" | "")); 25$mail_agent:send_message(player, $new_player_log, tostr(name, " (", new[1], ")"), tostr(email, comments ? " " + comments | "")); 26if ($network.active) 27if ($command_utils:yes_or_no(("Send email to " + email) + " with password? ")) 28player:notify(tostr("Sending the password to ", email, ".")); 29if ((result = $wiz_utils:send_new_player_mail(tostr("From ", player.name, "@", $network.moo_name, ":"), name, email, new[1], new[2])) == 0) 30player:notify(tostr("Mail sent successfully to ", email, ".")); 31else 32player:tell("Cannot send mail: ", result); 33endif 34else 35player:notify("No mail sent."); 36endif 37else 38player:notify("Sorry, the network isn't active."); 39endif