Login Commands #10
Aliases: Login Commands
44 verbs · 44 properties · 0 children
Verbs
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
welcome_message | #10 | rc | #2 | list of 5{"Welcome to the RPG-LambdaCore database, a version of the 1997 LambdaCore (with updates from the 2000 LambdaCore) revised for adventure gaming.", "", "Type 'connect wizard' to log in.", "", "You will probably want to change this text and the output of the `help' command, which are stored in $login.welcome_message and $login.help_message, respectively."} |
newt_registration_string | #10 | rc | #2 | "Your character is temporarily hosed." |
registration_string | #10 | rc | #2 | "Character creation is disabled." |
registration_address | #10 | rc | #2 | "" |
create_enabled | #10 | rc | #2 | 1 |
bogus_command | #10 | r | #2 | "?" |
blank_command | #10 | r | #2 | "welcome" |
graylist | #10 | | #2 | {{}, {}} |
blacklist | #10 | | #2 | {{}, {}} |
redlist | #10 | | #2 | {{}, {}} |
who_masks_wizards | #10 | | #2 | 0 |
max_player_name | #10 | rc | #2 | 40 |
spooflist | #10 | | #2 | {{}, {}} |
ignored | #10 | rc | #2 | {} |
max_connections | #10 | rc | #36 | 99999 |
connection_limit_msg | #10 | r | #36 | "*** The MOO is too busy! The current lag is %l; there are %n connected. WAIT FIVE MINUTES BEFORE TRYING AGAIN." |
lag_samples | #10 | rc | #2 | {0, 0, 0, 0, 0} |
request_enabled | #10 | rc | #2 | 0 |
help_message | #10 | rc | #2 | {"Sorry, but there's no help here yet. Type `?' for a list of commands."} |
last_lag_sample | #10 | rc | #2 | 0 |
lag_sample_interval | #10 | rc | #2 | 15 |
boot_process | #10 | rc | #2 | 0 |
lag_cutoff | #10 | rc | #2 | 5 |
lag_exemptions | #10 | rc | #2 | {} |
newted | #10 | | #2 | {} |
current_connections | #10 | rc | #2 | {#-2} |
current_numcommands | #10 | rc | #2 | {2} |
max_numcommands | #10 | rc | #2 | 20 |
temporary_newts | #10 | c | #2 | {} |
downtimes | #10 | rc | #2 | {{1789928693, 0}} |
print_lag | #10 | rc | #2 | 0 |
current_lag | #10 | r | #2 | 6 |
temporary_blacklist | #10 | | #2 | {{}, {}} |
temporary_redlist | #10 | | #2 | {{}, {}} |
temporary_spooflist | #10 | | #2 | {{}, {}} |
temporary_graylist | #10 | | #2 | {{}, {}} |
intercepted_players | #10 | | #36 | {} |
intercepted_actions | #10 | | #36 | {} |
checkpoint_in_progress | #10 | rc | #2 | 0 |
key | #1 | c | #2 | <clear> |
aliases | #1 | rc | #2 | {"Login Commands"} |
description | #1 | rc | #2 | "This provides everything needed by #0:do_login_command. See `help $login' on $core_help for details." |
object_size | #1 | r | #36 | {44540, -1090650497} |
html | #1 | rc | #2 | <clear> |
Ancestry
Ancestors (nearest first): #1 Root Class
Children: none
Call graph
Showing 48 of 69 verbs; 21 not shown.
Source
?
Referenced by
none
Source
1if ((caller != #0) && (caller != this)) 2return E_PERM; 3else 4clist = {}; 5for j in ({this, @$object_utils:ancestors(this)}) 6for i in [1..length(verbs(j))] 7if ((verb_args(j, i) == {"any", "none", "any"}) && index((info = verb_info(j, i))[2], "x")) 8vname = $string_utils:explode(info[3])[1]; 9star = index(vname + "*", "*"); 10clist = {@clist, $string_utils:uppercase(vname[1..star - 1]) + strsub(vname[star..$], "*", "")}; 11endif 12endfor 13endfor 14notify(player, "I don't understand that. Valid commands at this point are"); 15notify(player, " " + $string_utils:english_list(setremove(clist, "?"), "", " or ")); 16return 0; 17endif
wel*come @wel*come
Referenced by
none
Source
1if ((caller != #0) && (caller != this)) 2return E_PERM; 3else 4msg = this.welcome_message; 5version = server_version(); 6for line in ((typeof(msg) == LIST) ? msg | {msg}) 7if (typeof(line) == STR) 8notify(player, strsub(line, "%v", version)); 9endif 10endfor 11this:check_player_db(); 12this:check_for_shutdown(); 13this:check_for_checkpoint(); 14this:maybe_print_lag(); 15return 0; 16endif
w*ho @w*ho
Referenced by
none
Source
1masked = $login.who_masks_wizards ? $wiz_utils:connected_wizards() | {}; 2if ((caller != #0) && (caller != this)) 3return E_PERM; 4elseif (!args) 5plyrs = connected_players(); 6if (length(plyrs) > 100) 7this:notify(tostr("You have requested a listing of ", length(plyrs), " players. Please restrict the number of players in any single request to a smaller number. The lag thanks you.")); 8return 0; 9else 10$ansi_utils:show_who_listing($set_utils:difference(plyrs, masked)) || this:notify("No one logged in."); 11endif 12else 13plyrs = listdelete($command_utils:player_match_result($string_utils:match_player(args), args), 1); 14if (length(plyrs) > 100) 15this:notify(tostr("You have requested a listing of ", length(plyrs), " players. Please restrict the number of players in any single request to a smaller number. The lag thanks you.")); 16return 0; 17endif 18$ansi_utils:show_who_listing(plyrs, $set_utils:intersection(plyrs, masked)); 19endif 20return 0;
co*nnect @co*nnect
Referenced by
none
Source
1"$login:connect(player-name [, password])"; 2" => 0 (for failed connections)"; 3" => objnum (for successful connections)"; 4((caller == #0) || (caller == this)) || raise(E_PERM); 5"================================================================="; 6"=== Check arguments, print usage notice if necessary"; 7try 8{name, ?password = 0} = args; 9name = strsub(name, " ", "_"); 10except (E_ARGS) 11notify(player, tostr("Usage: ", verb, " <existing-player-name> <password>")); 12return 0; 13endtry 14try 15"================================================================="; 16"=== Is our candidate name invalid?"; 17if (!valid(candidate = orig_candidate = this:_match_player(name))) 18raise(E_INVARG, tostr("`", name, "' matches no player name.")); 19endif 20"================================================================="; 21"=== Is our candidate unable to connect for generic security"; 22"=== reasons (ie clear password, non-player object)?"; 23if (`is_clear_property(candidate, "password") ! E_PROPNF' || (!$object_utils:isa(candidate, $player))) 24server_log(tostr("FAILED CONNECT: ", name, " (", candidate, ") on ", connection_name(player), ($string_utils:connection_hostname(connection_name(player)) in candidate.all_connect_places) ? "" | "******")); 25raise(E_INVARG); 26endif 27"================================================================="; 28"=== Check password"; 29if (typeof(cp = candidate.password) == STR) 30"=== Candidate requires a password"; 31if (password) 32"=== Candidate requires a password, and one was provided"; 33if (strcmp(crypt(password, cp), cp)) 34"=== Candidate requires a password, and one was provided, which was wrong"; 35server_log(tostr("FAILED CONNECT: ", name, " (", candidate, ") on ", connection_name(player), ($string_utils:connection_hostname(connection_name(player)) in candidate.all_connect_places) ? "" | "******")); 36raise(E_INVARG, "Invalid password."); 37else 38"=== Candidate requires a password, and one was provided, which was right"; 39endif 40else 41"=== Candidate requires a password, and none was provided"; 42set_connection_option(player, "binary", 1); 43notify(player, "Password: "); 44set_connection_option(player, "binary", 0); 45set_connection_option(player, "client-echo", 0); 46this:add_interception(player, "intercepted_password", candidate); 47return 0; 48endif 49elseif (cp == 0) 50"=== Candidate does not require a password"; 51else 52"=== Candidate has a nonstandard password; something's wrong"; 53raise(E_INVARG); 54endif 55"================================================================="; 56"=== Is the player locked out?"; 57if ($no_connect_message && (!candidate.wizard)) 58notify(player, $no_connect_message); 59server_log(tostr("REJECTED CONNECT: ", name, " (", candidate, ") on ", connection_name(player))); 60return 0; 61endif 62"================================================================="; 63"=== Check guest connections"; 64if ($object_utils:isa(candidate, $guest) && (!valid(candidate = candidate:defer()))) 65if (candidate == #-2) 66server_log(tostr("GUEST DENIED: ", connection_name(player))); 67notify(player, "Sorry, guest characters are not allowed from your site at the current time."); 68else 69notify(player, "Sorry, all of our guest characters are in use right now."); 70endif 71return 0; 72endif 73"================================================================="; 74"=== Check newts"; 75if (candidate in this.newted) 76if (entry = $list_utils:assoc(candidate, this.temporary_newts)) 77if ((uptime = this:uptime_since(entry[2])) > entry[3]) 78"Temporary newting period is over. Remove entry. Oh, send mail, too."; 79this.temporary_newts = setremove(this.temporary_newts, entry); 80this.newted = setremove(this.newted, candidate); 81fork (0) 82player = this.owner; 83$mail_agent:send_message(player, $newt_log, tostr("automatic @unnewt ", candidate.name, " (", candidate, ")"), {"message sent from $login:connect"}); 84endfork 85else 86notify(player, ""); 87notify(player, this:temp_newt_registration_string(entry[3] - uptime)); 88boot_player(player); 89return 0; 90endif 91else 92notify(player, ""); 93notify(player, this:newt_registration_string()); 94boot_player(player); 95return 0; 96endif 97endif 98"================================================================="; 99"=== Connection limits based on lag"; 100if ((((!candidate.wizard) && (!(candidate in this.lag_exemptions))) && ((howmany = length(connected_players())) >= (max = this:max_connections()))) && (!$object_utils:connected(candidate))) 101notify(player, $string_utils:subst(this.connection_limit_msg, {{"%n", tostr(howmany)}, {"%m", tostr(max)}, {"%l", tostr(this:current_lag())}, {"%t", candidate.last_connect_attempt ? ctime(candidate.last_connect_attempt) | "not recorded"}})); 102if ($object_utils:has_property($local, "mudlist")) 103notify(player, "You may wish to try another MUD while waiting for the MOO to unlag. Here are a few that we know of:"); 104for l in ($local.mudlist:choose(3)) 105notify(player, l); 106endfor 107endif 108candidate.last_connect_attempt = time(); 109server_log(tostr("CONNECTION LIMIT EXCEEDED: ", name, " (", candidate, ") on ", connection_name(player))); 110boot_player(player); 111return 0; 112endif 113"================================================================="; 114"=== Log the player on!"; 115if (candidate != orig_candidate) 116notify(player, tostr("Okay,... ", name, " is in use. Logging you in as `", candidate.name, "'")); 117endif 118this:record_connection(candidate); 119return candidate; 120except (E_INVARG) 121notify(player, "Either that player does not exist, or has a different password."); 122return 0; 123endtry
cr*eate @cr*eate
Referenced by
none
Source
1if ((caller != #0) && (caller != this)) 2return E_PERM; 3"... caller isn't :do_login_command()..."; 4elseif (!this:player_creation_enabled(player)) 5notify(player, this:registration_string()); 6"... we've disabled player creation ..."; 7elseif (length(args) != 2) 8notify(player, tostr("Usage: ", verb, " <new-player-name> <new-password>")); 9elseif ($player_db.frozen) 10notify(player, "Sorry, can't create any new players right now. Try again in a few minutes."); 11elseif ((!(name = args[1])) || (name == "<>")) 12notify(player, "You can't have a blank name!"); 13if (name) 14notify(player, "Also, don't use angle brackets (<>)."); 15endif 16elseif ((name[1] == "<") && (name[$] == ">")) 17notify(player, "Try that again but without the angle brackets, e.g.,"); 18notify(player, tostr(" ", verb, " ", name[2..$ - 1], " ", strsub(strsub(args[2], "<", ""), ">", ""))); 19notify(player, "This goes for other commands as well."); 20elseif (index(name, " ")) 21notify(player, "Sorry, no spaces are allowed in player names. Use dashes or underscores."); 22"... lots of routines depend on there not being spaces in player names..."; 23elseif ((!$player_db:available(name)) || (this:_match_player(name) != $failed_match)) 24notify(player, "Sorry, that name is not available. Please choose another."); 25"... note the :_match_player call is not strictly necessary..."; 26"... it is merely there to handle the case that $player_db gets corrupted."; 27elseif (!(password = args[2])) 28notify(player, "You must set a password for your player."); 29else 30new = $quota_utils:bi_create($player_class, $nothing); 31set_player_flag(new, 1); 32new.name = name; 33new.aliases = {name}; 34new.programmer = $player_class.programmer; 35new.password = crypt(password); 36new.last_password_time = time(); 37new.last_connect_time = $maxint; 38"Last disconnect time is creation time, until they login."; 39new.last_disconnect_time = time(); 40"make sure the owership quota isn't clear!"; 41$quota_utils:initialize_quota(new); 42this:record_connection(new); 43$player_db:insert(name, new); 44`move(new, $player_start) ! ANY'; 45return new; 46endif 47return 0;
q*uit @q*uit
Referenced by
none
Source
1if ((caller != #0) && (caller != this)) 2return E_PERM; 3else 4boot_player(player); 5return 0; 6endif
up*time @up*time
Referenced by
none
Source
1if ((caller != #0) && (caller != this)) 2return E_PERM; 3else 4notify(player, tostr("The server has been up for ", $time_utils:english_time(time() - $last_restart_time), ".")); 5return 0; 6endif
v*ersion @v*ersion
Referenced by
none
Source
1if ((caller != #0) && (caller != this)) 2return E_PERM; 3else 4notify(player, tostr("The MOO is currently running version ", server_version(), " of the LambdaMOO server code.")); 5return 0; 6endif
parse_command
Referenced by
- #0:do_login_command line 19:
$login:parse_command
Source
1":parse_command(@args) => {verb, args}"; 2"Given the args from #0:do_login_command,"; 3" returns the actual $login verb to call and the args to use."; 4"Commands available to not-logged-in users should be located on this object and given the verb_args \"any none any\""; 5if ((caller != #0) && (caller != this)) 6return E_PERM; 7endif 8if (li = this:interception(player)) 9return {@li, @args}; 10endif 11if (!args) 12return {this.blank_command, @args}; 13elseif ((verb = args[1]) && (!$string_utils:is_numeric(verb))) 14for i in ({this, @$object_utils:ancestors(this)}) 15try 16if ((verb_args(i, verb) == {"any", "none", "any"}) && index(verb_info(i, verb)[2], "x")) 17return args; 18endif 19except (ANY) 20continue i; 21endtry 22endfor 23endif 24return {this.bogus_command, @args};
check_for_shutdown
Referenced by
- #10:wel*come line 12:
this:check_for_shutdown
Source
1when = $shutdown_time - time(); 2if (when >= 0) 3line = "***************************************************************************"; 4notify(player, ""); 5notify(player, ""); 6notify(player, line); 7notify(player, line); 8notify(player, "****"); 9notify(player, ("**** WARNING: The server will shut down in " + $time_utils:english_time(when - (when % 60))) + "."); 10for piece in ($generic_editor:fill_string($shutdown_message, 60)) 11notify(player, "**** " + piece); 12endfor 13notify(player, "****"); 14notify(player, line); 15notify(player, line); 16notify(player, ""); 17notify(player, ""); 18endif
check_player_db
Referenced by
- #10:wel*come line 11:
this:check_player_db
Source
1if ($player_db.frozen) 2line = "***************************************************************************"; 3notify(player, ""); 4notify(player, line); 5notify(player, "***"); 6for piece in ($generic_editor:fill_string("The character-name matcher is currently being reloaded. This means your character name might not be recognized even though it still exists. Don't panic. You can either wait for the reload to finish or you can connect using your object number if you remember it (e.g., `connect #1234 yourpassword').", 65)) 7notify(player, "*** " + piece); 8endfor 9notify(player, "***"); 10for piece in ($generic_editor:fill_string("Repeat: Do not panic. In particular, please do not send mail to any wizards or the registrar asking about this. It will finish in time. Thank you for your patience.", 65)) 11notify(player, "*** " + piece); 12endfor 13if (this:player_creation_enabled(player)) 14notify(player, "*** This also means that character creation is disabled."); 15endif 16notify(player, "***"); 17notify(player, line); 18notify(player, ""); 19endif
_match_player
Referenced by
- #10:co*nnect line 17:
this:_match_player - #10:cr*eate line 23:
this:_match_player - #24:check_player_request line 27:
$login:_match_player
Source
1":_match_player(name)"; 2"This is the matching routine used by @connect."; 3"returns either a valid player corresponding to name or $failed_match."; 4name = args[1]; 5if (valid(candidate = $string_utils:literal_object(name)) && is_player(candidate)) 6return candidate; 7endif 8".....uncomment this to trust $player_db and have `connect' recognize aliases"; 9if (valid(candidate = $player_db:find_exact(name)) && is_player(candidate)) 10return candidate; 11endif 12".....uncomment this if $player_db gets hosed and you want by-name login"; 13". for candidate in (players())"; 14". if (candidate.name == name)"; 15". return candidate; "; 16". endif "; 17". endfor "; 18"....."; 19return $failed_match;
notify
Referenced by
Source
1(caller != $ansi_utils) && set_task_perms(caller_perms()); 2notify(player, $ansi_utils:delete(args[1]));
tell
Referenced by
none
Source
1"keeps bad things from happening if someone brings this object into a room and talks to it."; 2return 0;
player_creation_enabled
Referenced by
- #10:cr*eate line 4:
this:player_creation_enabled - #10:check_player_db line 13:
this:player_creation_enabled - #31:boot line 5:
$login:player_creation_enabled - #31:create line 1:
$login:player_creation_enabled
Source
1"Accepts a player object. If player creation is enabled for that player object, then return true. Otherwise, return false."; 2"Default implementation checks the player's connecting host via $login:blacklisted to decide."; 3if (caller_perms().wizard) 4return this.create_enabled && (!this:blacklisted($string_utils:connection_hostname(connection_name(args[1])))); 5else 6return E_PERM; 7endif
newt_registration_string registration_string
Referenced by
- #10:co*nnect line 93:
this:newt_registration_string - #10:cr*eate line 5:
this:registration_string - #10:req*uest line 6:
this:registration_string - #24:newt_player line 21:
$login:newt_registration_string - #31:create line 4:
$login:registration_string
Source
1return $string_utils:subst(this.(verb), {{"%e", this.registration_address}, {"%%", "%"}});
init_for_core
Referenced by
none
Source
1if (caller_perms().wizard) 2pass(); 3this.lag_exemptions = {}; 4this.max_connections = 99999; 5this.lag_samples = {0, 0, 0, 0, 0}; 6this.print_lag = 0; 7this.last_lag_sample = 0; 8this.bogus_command = "?"; 9this.blank_command = "welcome"; 10this.create_enabled = 1; 11this.registration_address = ""; 12this.registration_string = "Character creation is disabled."; 13this.newt_registration_string = "Your character is temporarily hosed."; 14this.welcome_message = {"Welcome to the RPG-LambdaCore database, a version of the 1997 LambdaCore (with updates from the 2000 LambdaCore) revised for adventure gaming.", "", "Type 'connect wizard' to log in.", "", "You will probably want to change this text and the output of the `help' command, which are stored in $login.welcome_message and $login.help_message, respectively."}; 15this.help_message = {"Sorry, but there's no help here yet. Type `?' for a list of commands."}; 16this.redlist = this.blacklist = this.graylist = this.spooflist = {{}, {}}; 17this.temporary_redlist = this.temporary_blacklist = this.temporary_graylist = this.temporary_spooflist = {{}, {}}; 18this.who_masks_wizards = 0; 19this.newted = this.temporary_newts = {}; 20this.downtimes = {}; 21if ("monitor" in properties(this)) 22delete_property(this, "monitor"); 23endif 24if ("monitor" in verbs(this)) 25delete_verb(this, "monitor"); 26endif 27`set_verb_code(this, "connect", verb_code(this, "connect(core)")) ! E_VERBNF => ""'; 28`delete_verb(this, "connect(core)") ! E_VERBNF => ""'; 29if ("record_connection(real)" in verbs(this)) 30delete_verb(this, "record_connection"); 31info = verb_info(this, "record_connection(real)"); 32set_verb_info(this, "record_connection(real)", {info[1], "rxd", "record_connection"}); 33endif 34if ("special_action" in verbs(this)) 35set_verb_code(this, "special_action", {}); 36endif 37endif
special_action
Referenced by
none
Source
1
blacklisted graylisted redlisted spooflisted
Referenced by
- #0:do_login_command line 12:
$login:redlisted - #10:player_creation_enabled line 4:
this:blacklisted - #24:show_netwho_listing line 36:
$login:blacklisted - #24:show_netwho_listing line 39:
$login:graylisted - #24:check_player_request line 54:
$login:spooflisted - #31:defer line 5:
$login:blacklisted - #57:@guests line 32:
$login:blacklisted - #57:@guests line 35:
$login:graylisted
Source
1":blacklisted(hostname) => is hostname on the .blacklist"; 2":graylisted(hostname) => is hostname on the .graylist"; 3":redlisted(hostname) => is hostname on the .redlist"; 4sitelist = this.(this:listname(verb)); 5if (!caller_perms().wizard) 6return E_PERM; 7elseif (((hostname = args[1]) in sitelist[1]) || (hostname in sitelist[2])) 8return 1; 9elseif ($site_db:domain_literal(hostname)) 10for lit in (sitelist[1]) 11if ((index(hostname, lit) == 1) && ((hostname + ".")[length(lit) + 1] == ".")) 12return 1; 13endif 14endfor 15else 16for dom in (sitelist[2]) 17if (index(dom, "*")) 18"...we have a wildcard; let :match_string deal with it..."; 19if ($string_utils:match_string(hostname, dom)) 20return 1; 21endif 22else 23"...tail of hostname ..."; 24if ((r = rindex(hostname, dom)) && ((("." + hostname)[r] == ".") && (((r - 1) + length(dom)) == length(hostname)))) 25return 1; 26endif 27endif 28endfor 29endif 30return this:(verb + "_temp")(hostname);
blacklist_add*_temp graylist_add*_temp redlist_add*_temp spooflist_add*_temp
Referenced by
none
Source
1"To add a temporary entry, only call the `temp' version."; 2"blacklist_add_temp(Site, start time, duration)"; 3if (!caller_perms().wizard) 4return E_PERM; 5endif 6{where, ?start, ?duration} = args; 7lname = this:listname(verb); 8which = 1 + (!$site_db:domain_literal(where)); 9if (index(verb, "temp")) 10lname = "temporary_" + lname; 11this.(lname)[which] = setadd(this.(lname)[which], {where, start, duration}); 12else 13this.(lname)[which] = setadd(this.(lname)[which], where); 14endif 15return 1;
blacklist_remove*_temp graylist_remove*_temp redlist_remove*_temp spooflist_remove*_temp
Referenced by
none
Source
1"The temp version removes from the temporary property if it exists."; 2if (!caller_perms().wizard) 3return E_PERM; 4endif 5where = args[1]; 6lname = this:listname(verb); 7which = 1 + (!$site_db:domain_literal(where)); 8if (index(verb, "temp")) 9lname = "temporary_" + lname; 10if (entry = $list_utils:assoc(where, this.(lname)[which])) 11this.(lname)[which] = setremove(this.(lname)[which], entry); 12return 1; 13else 14return E_INVARG; 15endif 16elseif (where in this.(lname)[which]) 17this.(lname)[which] = setremove(this.(lname)[which], where); 18return 1; 19else 20return E_INVARG; 21endif
listname
Referenced by
- #10:blacklisted line 4:
this:listname - #10:blacklist_add*_temp line 7:
this:listname - #10:blacklist_remove*_temp line 6:
this:listname - #10:blacklisted_temp line 7:
this:listname - #57:@toad line 8:
$login:listname - #57:@blacklist line 12:
$login:listname
Source
1return {"???", "blacklist", "graylist", "redlist", "spooflist"}[1 + index("bgrs", (args[1] || "?")[1])];
record_connection
Referenced by
- #10:co*nnect line 118:
this:record_connection - #10:cr*eate line 42:
this:record_connection
Source
1":record_connection(plyr) update plyr's connection information"; 2"to reflect impending login."; 3if (!caller_perms().wizard) 4return E_PERM; 5else 6plyr = args[1]; 7plyr.first_connect_time = min(time(), plyr.first_connect_time); 8plyr.previous_connection = {plyr.last_connect_time, $string_utils:connection_hostname(plyr.last_connect_place)}; 9plyr.last_connect_time = time(); 10plyr.last_connect_place = cn = connection_name(player); 11chost = $string_utils:connection_hostname(cn); 12acp = setremove(plyr.all_connect_places, chost); 13plyr.all_connect_places = {chost, @acp[1..min($, 15)]}; 14if (!$object_utils:isa(plyr, $guest)) 15$site_db:add(plyr, chost); 16endif 17endif
sample_lag
Referenced by
- #10:sample_lag line 22:
this:sample_lag
Source
1if (!caller_perms().wizard) 2return E_PERM; 3endif 4lag = (time() - this.last_lag_sample) - 15; 5this.lag_samples = {lag, @this.lag_samples[1..3]}; 6"Now compute the current lag and store it in a property, instead of computing it in :current_lag, which is called a hundred times a second."; 7thislag = max(0, (time() - this.last_lag_sample) - this.lag_sample_interval); 8if (thislag > (60 * 60)) 9"more than an hour, probably the lag sampler stopped"; 10this.current_lag = 0; 11else 12samples = this.lag_samples; 13sum = 0; 14cnt = 0; 15for x in (listdelete(samples, 1)) 16sum = sum + x; 17cnt = cnt + 1; 18endfor 19this.current_lag = max(thislag, samples[1], samples[2], sum / cnt); 20endif 21fork (15) 22this:sample_lag(); 23endfork 24this.last_lag_sample = time();
is_lagging
Referenced by
- #10:max_connections line 3:
this:is_lagging - #32:show_who_listing line 87:
$login:is_lagging - #59:show_who_listing line 103:
$login:is_lagging
Source
1return this:current_lag() > this.lag_cutoff;
max_connections
Referenced by
- #10:co*nnect line 100:
this:max_connections - #24:boot_idlers line 20:
$login:max_connections - #24:boot_idlers line 42:
$login:max_connections
Source
1max = this.max_connections; 2if (typeof(max) == LIST) 3if (this:is_lagging()) 4max = max[1]; 5else 6max = max[2]; 7endif 8endif 9return max;
request_character
Referenced by
- #10:req*uest line 11:
$login:request_character - #31:@request line 13:
$login:request_character
Source
1"request_character(player, name, address)"; 2"return true if succeeded"; 3if (!caller_perms().wizard) 4return E_PERM; 5endif 6{who, name, address} = args; 7connection = $string_utils:connection_hostname(connection_name(who)); 8if (reason = $wiz_utils:check_player_request(name, address, connection)) 9prefix = ""; 10if (reason[1] == "-") 11reason = reason[2..$]; 12prefix = "Please"; 13else 14prefix = "Please try again, or, to register another way,"; 15endif 16notify(who, reason); 17msg = tostr(prefix, " send mail to ", $login.registration_address, ", with the character name you want."); 18for l in ($generic_editor:fill_string(msg, 70)) 19notify(who, l); 20endfor 21return 0; 22endif 23if (lines = $no_one:eval_d("$local.help.(\"multiple-characters\")")[2]) 24notify(who, "Remember, in general, only one character per person is allowed."); 25notify(who, tostr("Do you already have a ", $network.moo_name, " character? [enter `yes' or `no']")); 26answer = read(who); 27if (answer == "yes") 28notify(who, "Process terminated *without* creating a character."); 29return 0; 30elseif (answer != "no") 31return notify(who, tostr("Please try again; when you get this question, answer `yes' or `no'. You answered `", answer, "'")); 32endif 33notify(who, "For future reference, do you want to see the full policy (from `help multiple-characters'?"); 34notify(who, "[enter `yes' or `no']"); 35if (read(who) == "yes") 36for x in (lines) 37for y in ($generic_editor:fill_string(x, 70)) 38notify(who, y); 39endfor 40endfor 41endif 42endif 43notify(who, tostr("A character named `", name, "' will be created.")); 44notify(who, tostr("A random password will be generated, and e-mailed along with")); 45notify(who, tostr(" an explanatory message to: ", address)); 46notify(who, tostr(" [Please double-check your email address and answer `no' if it is incorrect.]")); 47notify(who, "Is this OK? [enter `yes' or `no']"); 48if (read(who) != "yes") 49notify(who, "Process terminated *without* creating a character."); 50return 0; 51endif 52if (!$network.active) 53$mail_agent:send_message(this.owner, $registration_db.registrar, "Player request", {"Player request from " + connection, ":", "", (("@make-player " + name) + " ") + address}); 54notify(who, tostr("Request for new character ", name, " email address '", address, "' accepted.")); 55notify(who, tostr("Please be patient until the registrar gets around to it.")); 56notify(who, tostr("If you don't get email within a week, please send regular")); 57notify(who, tostr(" email to: ", $login.registration_address, ".")); 58elseif ($player_db.frozen) 59notify(who, "Sorry, can't create any new players right now. Try again in a few minutes."); 60else 61new = $wiz_utils:make_player(name, address); 62password = new[2]; 63new = new[1]; 64notify(who, tostr("Character ", name, " (", new, ") created.")); 65notify(who, tostr("Mailing password to ", address, "; you should get the mail very soon.")); 66notify(who, tostr("If you do not get it, please do NOT request another character.")); 67notify(who, tostr("Instead, send regular email to ", $login.registration_address, ",")); 68notify(who, tostr("with the name of the character you requested.")); 69$mail_agent:send_message(this.owner, $new_player_log, tostr(name, " (", new, ")"), {address, tostr(" Automatically created at request of ", valid(player) ? player.name | "unconnected player", " from ", connection, ".")}); 70$wiz_utils:send_new_player_mail(tostr("Someone connected from ", connection, " at ", ctime(), " requested a character on ", $network.moo_name, " for email address ", address, "."), name, address, new, password); 71return 1; 72endif
req*uest @req*uest
Referenced by
none
Source
1if ((caller != #0) && (caller != this)) 2return E_PERM; 3endif 4"must be #0:do_login_command"; 5if (!this.request_enabled) 6for line in ($generic_editor:fill_string(this:registration_string(), 70)) 7notify(player, line); 8endfor 9elseif ((length(args) != 3) || (args[2] != "for")) 10notify(player, tostr("Usage: ", verb, " <new-player-name> for <email-address>")); 11elseif ($login:request_character(player, args[1], args[3])) 12boot_player(player); 13endif
h*elp @h*elp
Referenced by
none
Source
1if ((caller != #0) && (caller != this)) 2return E_PERM; 3else 4msg = this.help_message; 5for line in ((typeof(msg) == LIST) ? msg | {msg}) 6if (typeof(line) == STR) 7notify(player, line); 8endif 9endfor 10return 0; 11endif
maybe_print_lag
Referenced by
- #10:wel*come line 14:
this:maybe_print_lag
Source
1if ((caller == this) || (caller_perms() == player)) 2if (this.print_lag) 3lag = this:current_lag(); 4if (lag > 1) 5lagstr = tostr("approximately ", lag, " seconds"); 6elseif (lag == 1) 7lagstr = "approximately 1 second"; 8else 9lagstr = "low"; 10endif 11notify(player, tostr("The lag is ", lagstr, "; there ", ((l = length(connected_players())) == 1) ? "is " | "are ", l, " connected.")); 12endif 13endif
current_lag
Referenced by
- #10:co*nnect line 101:
this:current_lag - #10:is_lagging line 1:
this:current_lag - #10:maybe_print_lag line 3:
this:current_lag - #56:suspend_if_needed line 9:
$login:current_lag - #56:kill_if_laggy line 3:
$login:current_lag - #71:time line 3:
$login:current_lag - #90:disfunc line 8:
$login:current_lag
Source
1return this.current_lag;
maybe_limit_commands
Referenced by
- #0:do_login_command line 18:
$login:maybe_limit_commands
Source
1"This limits the number of commands that can be issued from the login prompt to prevent haywire login programs from lagging the MOO."; 2"$login.current_connections has the current player id's of people at the login prompt."; 3"$login.current_numcommands has the number of commands they have issued at the prompt so far."; 4"$login.max_numcommands has the maximum number of commands they may try before being booted."; 5if (!caller_perms().wizard) 6return E_PERM; 7else 8if (iconn = player in this.current_connections) 9knocks = this.current_numcommands[iconn] = this.current_numcommands[iconn] + 1; 10else 11this.current_connections = {@this.current_connections, player}; 12this.current_numcommands = {@this.current_numcommands, 1}; 13knocks = 1; 14"...sweep idle connections..."; 15for p in (this.current_connections) 16if (typeof(`idle_seconds(p) ! ANY') == ERR) 17n = p in this.current_connections; 18this.current_connections = listdelete(this.current_connections, n); 19this.current_numcommands = listdelete(this.current_numcommands, n); 20endif 21endfor 22endif 23if (knocks > this.max_numcommands) 24notify(player, "Sorry, too many commands issued without connecting."); 25boot_player(player); 26return 1; 27else 28return 0; 29endif 30endif
server_started
Referenced by
- #0:server_started line 4:
$login:server_started
Source
1"Called by #0:server_started when the server restarts."; 2if (caller_perms().wizard) 3this.lag_samples = {0, 0, 0, 0, 0}; 4this.downtimes = {{time(), this.last_lag_sample}, @this.downtimes[1..min($, 100)]}; 5this.intercepted_players = this.intercepted_actions = {}; 6endif
uptime_since
Referenced by
- #10:co*nnect line 77:
this:uptime_since - #10:templist_expired line 7:
this:uptime_since - #24:check_prog_restricted line 8:
$login:uptime_since
Source
1"uptime_since(time): How much time has LambdaMOO been up since `time'"; 2since = args[1]; 3up = time() - since; 4for x in (this.downtimes) 5if (x[1] < since) 6"downtime predates when we're asking about"; 7return up; 8endif 9"since the server was down between x[2] and x[1], don't count it as uptime"; 10up = up - (x[1] - max(x[2], since)); 11endfor 12return up;
count_bg_players
Referenced by
none
Source
1caller_perms().wizard || $error:raise(E_PERM); 2now = time(); 3tasks = queued_tasks(); 4sum = 0; 5for t in (tasks) 6delay = t[2] - now; 7interval = (delay <= 0) ? 1 | (delay * 2); 8"SUM is measured in hundredths of a player for the moment..."; 9(delay <= 300) && (sum = sum + (2000 / interval)); 10endfor 11count = sum / 100; 12return count;
blacklisted_temp graylisted_temp redlisted_temp spooflisted_temp
Referenced by
none
Source
1":blacklisted_temp(hostname) => is hostname on the .blacklist..."; 2":graylisted_temp(hostname) => is hostname on the .graylist..."; 3":redlisted_temp(hostname) => is hostname on the .redlist..."; 4":spooflisted_temp(hostname) => is hostname on the .spooflist..."; 5""; 6"... and the time limit hasn't run out."; 7lname = this:listname(verb); 8sitelist = this.("temporary_" + lname); 9if (!caller_perms().wizard) 10return E_PERM; 11elseif (entry = $list_utils:assoc(hostname = args[1], sitelist[1])) 12return this:templist_expired(lname, @entry); 13elseif (entry = $list_utils:assoc(hostname, sitelist[2])) 14return this:templist_expired(lname, @entry); 15elseif ($site_db:domain_literal(hostname)) 16for lit in (sitelist[1]) 17if ((index(hostname, lit[1]) == 1) && ((hostname + ".")[length(lit[1]) + 1] == ".")) 18return this:templist_expired(lname, @lit); 19endif 20endfor 21else 22for dom in (sitelist[2]) 23if (index(dom[1], "*")) 24"...we have a wildcard; let :match_string deal with it..."; 25if ($string_utils:match_string(hostname, dom[1])) 26return this:templist_expired(lname, @dom); 27endif 28else 29"...tail of hostname ..."; 30if ((r = rindex(hostname, dom[1])) && ((("." + hostname)[r] == ".") && (((r - 1) + length(dom[1])) == length(hostname)))) 31return this:templist_expired(lname, @dom); 32endif 33endif 34endfor 35endif 36return 0;
templist_expired
Referenced by
- #10:blacklisted_temp line 12:
this:templist_expired - #10:blacklisted_temp line 14:
this:templist_expired - #10:blacklisted_temp line 18:
this:templist_expired - #10:blacklisted_temp line 26:
this:templist_expired - #10:blacklisted_temp line 31:
this:templist_expired
Source
1"check to see if duration has expired on temporary_<colorlist>. Removes entry if so, returns true if still <colorlisted>"; 2":(listname, hostname, start time, duration)"; 3{lname, hname, start, duration} = args; 4if (!caller_perms().wizard) 5return E_PERM; 6endif 7if (this:uptime_since(start) > duration) 8this:(lname + "_remove_temp")(hname); 9return 0; 10else 11return 1; 12endif
temp_newt_registration_string
Referenced by
- #10:co*nnect line 87:
this:temp_newt_registration_string
Source
1return ("Your character is unavailable for another " + $time_utils:english_time(args[1])) + ".";
add_interception
Referenced by
- #10:co*nnect line 46:
this:add_interception
Source
1(caller == this) || raise(E_PERM); 2{who, verbname, @arguments} = args; 3(who in this.intercepted_players) && raise(E_INVARG, "Player already has an interception set."); 4this.intercepted_players = {@this.intercepted_players, who}; 5this.intercepted_actions = {@this.intercepted_actions, {verbname, @arguments}}; 6return 1;
delete_interception
Referenced by
- #10:intercepted_password line 2:
this:delete_interception
Source
1(caller == this) || raise(E_PERM); 2{who} = args; 3if (loc = who in this.intercepted_players) 4this.intercepted_players = listdelete(this.intercepted_players, loc); 5this.intercepted_actions = listdelete(this.intercepted_actions, loc); 6return 1; 7else 8"raise an error? nah."; 9return 0; 10endif
interception
Referenced by
- #10:parse_command line 8:
this:interception
Source
1(caller == this) || raise(E_PERM); 2{who} = args; 3return (loc = who in this.intercepted_players) ? this.intercepted_actions[loc] | 0;
intercepted_password
Referenced by
none
Source
1(caller == #0) || raise(E_PERM); 2this:delete_interception(player); 3set_connection_option(player, "client-echo", 1); 4notify(player, ""); 5try 6{candidate, ?password = ""} = args; 7except (E_ARGS) 8return 0; 9endtry 10return this:connect(tostr(candidate), password);
do_out_of_band_command doobc
Referenced by
- #0:do_out_of_band_command line 7:
$login:do_out_of_band_command
Source
1"This is where oob handlers need to be put to handle oob commands issued prior to assigning a connection to a player object. Right now it simply returns."; 2return;
check_for_checkpoint
Referenced by
- #10:wel*come line 13:
this:check_for_checkpoint
Source
1if (this.checkpoint_in_progress) 2line = "***************************************************************************"; 3notify(player, ""); 4notify(player, ""); 5notify(player, line); 6notify(player, line); 7notify(player, "****"); 8notify(player, "**** NOTICE: The server is very slow now."); 9notify(player, "**** The database is being saved to disk."); 10notify(player, "****"); 11notify(player, line); 12notify(player, line); 13notify(player, ""); 14notify(player, ""); 15endif