Login Commands #10

Parent #1Owner #2Flags readSource QuestCore.db

Aliases: Login Commands

44 verbs · 43 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
?any none anyrxd#1017
wel*come @wel*comeany none anyrxd#1016
w*ho @w*hoany none anyrxd#1020
co*nnect @co*nnectany none anyrxd#10123
cr*eate @cr*eateany none anyrxd#1049
q*uit @q*uitany none anyrxd#106
up*time @up*timeany none anyrxd#106
v*ersion @v*ersionany none anyrxd#106
parse_commandthis none thisrxd#1024
check_for_shutdownthis none thisrxd#1018
check_player_dbthis none thisrxd#1019
_match_playerthis none thisrxd#1019
notifythis none thisrxd#102
tellthis none thisrxd#102
player_creation_enabledthis none thisrxd#107
newt_registration_string registration_stringthis none thisrxd#101
init_for_corethis none thisrxd#1037
special_actionthis none thisx#101
blacklisted graylisted redlisted spooflistedthis none thisrxd#1030
blacklist_add*_temp graylist_add*_temp redlist_add*_temp spooflist_add*_tempthis none thisrxd#1015
blacklist_remove*_temp graylist_remove*_temp redlist_remove*_temp spooflist_remove*_tempthis none thisrxd#1021
listnamethis none thisrxd#101
record_connectionthis none thisrxd#1017
sample_lagthis none thisrxd#1024
is_laggingthis none thisrxd#101
max_connectionsthis none thisrxd#109
request_characterthis none thisrxd#1072
req*uest @req*uestany none anyrxd#1013
h*elp @h*elpany none anyrxd#1011
maybe_print_lagthis none thisrxd#1013
current_lagthis none thisrxd#101
maybe_limit_commandsthis none thisrxd#1030
server_startedthis none thisrxd#106
uptime_sincethis none thisrxd#1012
count_bg_playersthis none thisrxd#1012
blacklisted_temp graylisted_temp redlisted_temp spooflisted_tempthis none thisrxd#1036
templist_expiredthis none thisrxd#1012
temp_newt_registration_stringthis none thisrxd#101
add_interceptionthis none thisrxd#106
delete_interceptionthis none thisrxd#1010
interceptionthis none thisrxd#103
intercepted_passwordthis none thisrxd#1010
do_out_of_band_command doobcthis none thisrxd#102
check_for_checkpointthis none thisrxd#1015

Properties

PropertyDefinerFlagsOwnerValue
welcome_message#10rc#2
list of 6{"Welcome to the Centrac QuestCore Database. Developed from RPGCore.", "", "Type 'connect wizard' to login. Remember to set your password.", "", "You may wish to modify this text, located in $login.welcome_message.", ""}
newt_registration_string#10rc#2"Your character is temporarily hosed."
registration_string#10rc#2"Character creation is disabled."
registration_address#10rc#2""
create_enabled#10rc#21
bogus_command#10r#2"?"
blank_command#10r#2"welcome"
graylist#10#2{{}, {}}
blacklist#10#2{{}, {}}
redlist#10#2{{}, {}}
who_masks_wizards#10#20
max_player_name#10rc#240
spooflist#10#2{{}, {}}
ignored#10rc#2{}
max_connections#10rc#3699999
connection_limit_msg#10r#36"*** The MOO is too busy! The current lag is %l; there are %n connected. WAIT FIVE MINUTES BEFORE TRYING AGAIN."
lag_samples#10rc#2{0, 0, 0, 0, 0}
request_enabled#10rc#20
help_message#10rc#2
list of 11{"", "CENTRAC QUEST / LOGIN HELP", "", "connect <user> <password> - Connect to an existing character.", "create <user> <password> - Create a new character and set the password.", "who - Displays a list of users currently connected.", "uptime - Displays server uptime.", "version - Displays server version information.", "help - Displays this help text.", "quit - Disconnect from the server.", ""}
last_lag_sample#10rc#20
lag_sample_interval#10rc#215
boot_process#10rc#20
lag_cutoff#10rc#25
lag_exemptions#10rc#2{}
newted#10#2{}
current_connections#10rc#2{#-3}
current_numcommands#10rc#2{2}
max_numcommands#10rc#220
temporary_newts#10c#2{}
downtimes#10rc#2
list of 15{{1541645798, 0}, {1539532336, 0}, {1539483702, 0}, {1539462788, 0}, {1539461476, 0}, {1538781149, 0}, {1538329585, 0}, {1538262409, 0}, {1537082664, 0}, {1535158264, 0}, {1534700487, 0}, {1534383518, 0}, {1534281909, 0}, {1529536794, 0}, {1529432124, 0}}
print_lag#10rc#20
current_lag#10r#26
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#10rc#20
key#1c#2<clear>
aliases#1rc#2{"Login Commands"}
description#1rc#2"This provides everything needed by #0:do_login_command. See `help $login' on $core_help for details."
object_size#1r#36{41034, 1539462952}

Ancestry

Ancestors (nearest first): #1 Root Class

Children: none

Call graph

calls n10_0 #10:? n52_6 #52:ancestors n10_0->n52_6 n20_38 #20:explode n10_0->n20_38 n20_14 #20:uppercase n10_0->n20_14 n20_6 #20:english_list n10_0->n20_6 n10_1 #10:wel*come n10_10 #10:check_player_db n10_1->n10_10 n10_9 #10:check_for_shutdown n10_1->n10_9 n10_43 #10:check_for_checkpoint n10_1->n10_43 n10_29 #10:maybe_print_lag n10_1->n10_29 n10_14 #10:player_creation_enabled n10_10->n10_14 n50_68 #50:fill_string n10_10->n50_68 n43_7 #43:english_time n10_9->n43_7 n10_9->n50_68 n10_30 #10:current_lag n10_29->n10_30 n10_2 #10:w*ho n24_13 #24:connected_wizards n10_2->n24_13 n10_12 #10:notify n10_2->n10_12 n32_9 #32:show_who_listing n10_2->n32_9 n56_1 #56:player_match_result n10_2->n56_1 n20_20 #20:match_player n10_2->n20_20 n27_1 #27:intersection n10_2->n27_1 n32_3 #32:delete n10_12->n32_3 n10_3 #10:co*nnect n10_11 #10:_match_player n10_3->n10_11 n52_5 #52:isa n10_3->n52_5 n20_53 #20:connection_hostname n10_3->n20_53 n10_38 #10:add_interception n10_3->n10_38 n55_17 #55:assoc n10_3->n55_17 n10_33 #10:uptime_since n10_3->n10_33 n46_2 #46:send_message n10_3->n46_2 n10_37 #10:temp_newt_registration_string n10_3->n10_37 n10_15 #10:newt_registration_string n10_3->n10_15 n10_25 #10:max_connections n10_3->n10_25 n52_16 #52:connected n10_3->n52_16 n10_3->n10_30 n52_0 #52:has_property n10_3->n52_0 n10_22 #10:record_connection n10_3->n10_22 n20_16 #20:literal_object n10_11->n20_16 n37_1 #37:find_exact n10_11->n37_1 n10_37->n43_7 n10_22->n52_5 n10_22->n20_53 n10_4 #10:cr*eate n10_4->n10_11 n10_4->n10_15 n10_4->n10_22 n10_4->n10_14 n39_3 #39:available n10_4->n39_3 n80_3 #80:bi_create n10_4->n80_3 n80_0 #80:initialize_quota n10_4->n80_0 n39_6 #39:insert n10_4->n39_6 n10_14->n20_53 n10_18 #10:blacklisted n10_14->n10_18 n10_6 #10:up*time n10_6->n43_7 n10_8 #10:parse_command n10_8->n52_6 n10_40 #10:interception n10_8->n10_40 n20_24 #20:is_integer n10_8->n20_24

Showing 48 of 69 verbs; 21 not shown.

Source

?

Spec any none anyFlags rxdOwner #2Definer #10

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

Spec any none anyFlags rxdOwner #2Definer #10

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

Spec any none anyFlags rxdOwner #2Definer #10

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

Spec any none anyFlags rxdOwner #2Definer #10

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

Spec any none anyFlags rxdOwner #2Definer #10

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.money = {{"gold", 32.0}};
35new.home = #62;
36new.programmer = $player_class.programmer;
37new.password = crypt(password);
38new.last_password_time = time();
39new.last_connect_time = $maxint;
40"Last disconnect time is creation time, until they login.";
41new.last_disconnect_time = time();
42"make sure the owership quota isn't clear!";
43$quota_utils:initialize_quota(new);
44this:record_connection(new);
45$player_db:insert(name, new);
46`move(new, $local_chargen) ! ANY';
47return new;
48endif
49return 0;

q*uit @q*uit

Spec any none anyFlags rxdOwner #2Definer #10

Referenced by

none

Source

1if ((caller != #0) && (caller != this))
2return E_PERM;
3else
4boot_player(player);
5return 0;
6endif

up*time @up*time

Spec any none anyFlags rxdOwner #2Definer #10

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

Spec any none anyFlags rxdOwner #2Definer #10

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

Source

1(caller != $ansi_utils) && set_task_perms(caller_perms());
2notify(player, $ansi_utils:delete(args[1]));

tell

Spec this none thisFlags rxdOwner #36Definer #10

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

Source

1return $string_utils:subst(this.(verb), {{"%e", this.registration_address}, {"%%", "%"}});

init_for_core

Spec this none thisFlags rxdOwner #2Definer #10

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

Spec this none thisFlags xOwner #2Definer #10

Referenced by

none

Source

1

blacklisted graylisted redlisted spooflisted

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #10

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

Spec this none thisFlags rxdOwner #2Definer #10

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

Source

1return {"???", "blacklist", "graylist", "redlist", "spooflist"}[1 + index("bgrs", (args[1] || "?")[1])];

record_connection

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

Source

1return this:current_lag() > this.lag_cutoff;

max_connections

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

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

Spec any none anyFlags rxdOwner #2Definer #10

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

Spec any none anyFlags rxdOwner #2Definer #10

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

Source

1return this.current_lag;

maybe_limit_commands

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #10

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

Spec this none thisFlags rxdOwner #2Definer #10

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

Source

1return ("Your character is unavailable for another " + $time_utils:english_time(args[1])) + ".";

add_interception

Spec this none thisFlags rxdOwner #36Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #10

Referenced by

Source

1(caller == this) || raise(E_PERM);
2{who} = args;
3return (loc = who in this.intercepted_players) ? this.intercepted_actions[loc] | 0;

intercepted_password

Spec this none thisFlags rxdOwner #2Definer #10

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

Spec this none thisFlags rxdOwner #36Definer #10

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #10

Referenced by

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