Registration Database #11

Parent #30Owner #29Flags readSource hellcore/hellcore.db

Aliases: Registration Database

8 verbs · 20 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
find* _only* _every*this none thisrxd#111
addthis none thisrxd#1113
init_for_corethis none thisrxd#115
suspicious_addressthis none thisrxd#1146
suspicious_useridthis none thisrxd#119
describe_registrationthis none thisrxd#119
prunethis none thisrxd#1143
report_prune_progressthis none thisrxd#1125

Properties

PropertyDefinerFlagsOwnerValue
registrar#11rc#29#2
prune_progress#11rc#29"zzz"
prune_stop#11rc#29"zzz"
total_pruned_people#11rc#29902
total_pruned_characters#11rc#2925
prune_task#11rc#291324995178
alphabet#11rc#29"abcdefghijklmnopqrstuvwxy0123456789_.@+z"
node_perms#30rc#29""
data#30r#29<clear>
#30#29{"", "", {"loooool@hotmail.com", "sensoz@gmail.com"}, {{{#372, ""}}, {{#661391, ""}, {#661393, ""}}}}
aliases#1rc#29{"Registration Database"}
description#1rc#29<clear>
object_size#1r#29{2398690, 1298433815}
hidden_verbs#1rc#29<clear>
phelp_msg#1rc#29<clear>
weight#1rc#29<clear>
owner_verbs#1rc#29<clear>
plural_name#1rc#29<clear>
client_image#1rc#29<clear>
listening#1rc#29<clear>

Ancestry

Ancestors (nearest first): #30 Generic Database Tree#1 root

Children: none

Call graph

calls n11_1 #11:add n30_1 #30:find_exact n11_1->n30_1 n30_6 #30:insert n11_1->n30_6 n47_18 #47:iassoc n11_1->n47_18 n11_2 #11:init_for_core n1_22 #1:init_for_core n11_2->n1_22 n30_12 #30:clearall n11_2->n30_12 n11_3 #11:suspicious_address n11_3->n30_1 n66_0 #66:parse_address n11_3->n66_0 n66_1 #66:local_domain n11_3->n66_1 n30_2 #30:find_all n11_3->n30_2 n45_0 #45:has_property n11_3->n45_0 n11_5 #11:describe_registration n17_39 #17:get_email_address n11_5->n17_39 n11_6 #11:prune n11_6->n30_1 n11_6->n30_6 n11_6->n30_2 n48_8 #48:suspend_if_needed n11_6->n48_8 n30_7 #30:delete n11_6->n30_7 n20_69 #20:incr_alpha n11_6->n20_69 n48_7 #48:running_out_of_time n11_6->n48_7 n17_37 #17:random_wizard n11_6->n17_37 n107_43 #107:tell n11_6->n107_43 n11_7 #11:report_prune_progress n11_7->n107_43 n51_37 #51:task_valid n11_7->n51_37

Source

find* _only* _every*

Spec this none thisFlags rxdOwner #29Definer #11

Referenced by

none

Source

1return ((caller == this) || caller_perms().wizard) ? pass(@args) | E_PERM;

add

Spec this none thisFlags rxdOwner #29Definer #11

Referenced by

Source

1":add(player,email[,comment])";
2if (!caller_perms().wizard)
3return E_PERM;
4endif
5{who, email, @comment} = args;
6l = this:find_exact(email);
7if (l == $failed_match)
8this:insert(email, {{who, @comment}});
9elseif (i = $list_utils:iassoc(who, l))
10this:insert(email, listset(l, {who, @comment}, i));
11else
12this:insert(email, {@l, {who, @comment}});
13endif

init_for_core

Spec this none thisFlags rxdOwner #29Definer #11

Referenced by

none

Source

1if (caller_perms().wizard)
2pass();
3this:clearall();
4this.registrar = #2;
5endif

suspicious_address

Spec this none thisFlags rxdOwner #361Definer #11

Referenced by

none

Source

1"suspicious(address [,who])";
2"Determine whether an address appears to be another player in disguise.";
3"returns a list of similar addresses.";
4"If second argument given, then if all similar addresses are held by that";
5"person, let it pass---they're just switching departments at the same school";
6"or something.";
7"";
8"at the moment,";
9"  foo@bar.baz.bing.boo";
10"is considered 'similar' to anything matching";
11"  foo@*.bing.boo";
12if (!caller_perms().wizard)
13return E_PERM;
14endif
15{address, ?allowed = #-1} = args;
16{userid, site} = $network:parse_address(address);
17exact = (!site) && this:find_exact(address);
18if (!site)
19site = $network.site;
20endif
21site = $network:local_domain(site);
22sitelen = length(site);
23others = this:find_all_keys(userid + "@");
24for other in (others)
25if (other[max(1, ($ - sitelen) + 1)..$] != site)
26others = setremove(others, other);
27endif
28endfor
29if (exact)
30others = listinsert(others, address);
31endif
32for x in (others)
33allzapped = 1;
34for y in (this:find_exact(x))
35if ((((length(y) == 2) && ((y[2] == "zapped due to inactivity") || (y[2] == "toaded due to inactivity"))) || (y[1] == allowed)) || (($object_utils:has_property($local, "second_char_registry") && (typeof(them = $local.second_char_registry:other_chars(y[1])) == LIST)) && (allowed in them)))
36"let them change to the address if it is them, or if it is a registered char of theirs.";
37"Hrm. Need typeof==LIST check because returns E_INVARG for shared characters. bleah Ho_Yan 5/8/95";
38else
39allzapped = 0;
40endif
41endfor
42if (allzapped)
43others = setremove(others, x);
44endif
45endfor
46return others;

suspicious_userid

Spec this none thisFlags rxdOwner #361Definer #11

Referenced by

Source

1"suspicious_userid(userid)";
2"Return yes if userid is root or postmaster or something like that.";
3if ((has_property(#0, "local") && valid($local)) && has_property($local, "suspicious_userids"))
4extra = $local.suspicious_userids;
5else
6extra = {};
7endif
8return ((((args[1] in {@$network.suspicious_userids, @extra}) || match(args[1], "^guest")) || match(args[1], "^help")) || index(args[1], "-owner")) || index(args[1], "owner-");
9"Thinking about ruling out hyphenated names, on the grounds that they're probably mailing lists.";

describe_registration

Spec this none thisFlags rxdOwner #361Definer #11

Referenced by

Source

1"Returns a list of strings describing the registration data for an email address.  Args[1] should be the result of this:find.";
2set_task_perms(caller_perms());
3result = {};
4for x in (args[1])
5name = (valid(x[1]) && is_player(x[1])) ? x[1].name | "<recycled>";
6email = (valid(x[1]) && is_player(x[1])) ? $wiz_utils:get_email_address(x[1]) | "<???>";
7result = {@result, tostr("  ", name, " (", x[1], ") current email: ", email, (length(x) > 1) ? (" [" + x[2]) + "]" | "")};
8endfor
9return result;

prune

Spec this none thisFlags rxdOwner #361Definer #11

Referenced by

none

Source

1"Carefully loop through the db and delete items associated with reaped objects.  If that results in no objects remaining for a username, delete that username.";
2"Attempt to keep memory usage down by only asking for a small number of items at a time.  Should probably have some arguments to control this.";
3if (!caller_perms().wizard)
4raise(E_PERM);
5endif
6this.prune_task = task_id();
7probe = this.prune_progress;
8while (probe < this.prune_stop)
9for username in (this:find_all_keys(probe))
10items = this:find_exact(username);
11orig = items;
12for y in (items)
13{who, @whys} = y;
14if ((!valid(who)) || (!is_player(who)))
15nuke = 1;
16for why in (whys)
17if (((why && (why != "zapped due to inactivity")) && (why != "toaded due to inactivity")) && (why != "Additional email address"))
18nuke = 0;
19endif
20endfor
21if (nuke)
22items = setremove(items, y);
23endif
24endif
25$command_utils:suspend_if_needed(0);
26endfor
27if (!items)
28this:delete(username);
29this.total_pruned_people = this.total_pruned_people + 1;
30elseif (items != orig)
31this:insert(username, items);
32this.total_pruned_characters = (this.total_pruned_characters + length(orig)) - length(items);
33endif
34$command_utils:suspend_if_needed(0);
35endfor
36probe = $string_utils:incr_alpha(probe, this.alphabet);
37this.prune_progress = probe;
38if ($command_utils:running_out_of_time())
39set_task_perms($wiz_utils:random_wizard());
40suspend(0);
41endif
42endwhile
43player:tell("Prune stopped at ", toliteral(this.prune_progress));

report_prune_progress

Spec this none thisFlags rxdOwner #361Definer #11

Referenced by

none

Source

1player:tell("Prune is up to ", toliteral(this.prune_progress), ".");
2mine = 0;
3alphalen = length(this.alphabet);
4if (typeof(this.prune_progress) == STR)
5total = (alphalen * alphalen) * alphalen;
6for x in [1..3]
7mine = ((mine * alphalen) + index(this.alphabet, this.prune_progress[x])) - 1;
8endfor
9else
10total = 256 * 256;
11mine = (this.prune_progress[1] * 256) + this.prune_progress[2];
12endif
13percent = (100.0 * tofloat(mine)) / tofloat(total);
14player:tell("We have processed ", mine, " entries out of ", total, ", or ", toint(percent), ".", toint(10.0 * percent) % 10, "%.");
15player:tell("There were ", this.total_pruned_characters, " individual list entries removed, and ", this.total_pruned_people, " whole email addresses removed.");
16if ($code_utils:task_valid(this.prune_task))
17player:tell("Prune task is ", this.prune_task, ".  Stacktrace:");
18for x in (task_stack(this.prune_task, 1))
19if (valid(x[4]))
20player:tell(x[4], ":", x[2], " [", x[1], "]  ", x[3].name, "  (", x[6], ")");
21endif
22endfor
23else
24player:tell("The recorded task_id is no longer valid.");
25endif