Mail Name DB #78

Parent #37Owner #36Flags Source RPG Core/rpgcore-patched.db

Aliases: Mail Name DB

4 verbs · 8 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
addthis none thisrxd#7824
removethis none thisrxd#7814
loadthis none thisrxd#7814
init_for_corethis none thisrxd#785

Properties

PropertyDefinerFlagsOwnerValue
node_perms#37rc#36<clear>
data#37r#36<clear>
#37#36{"", "", {}, {}}
key#1c#360
aliases#1rc#36{"Mail Name DB"}
description#1rc#36"... for doing mail-recipient name lookups."
object_size#1r#36{3383, -1090650497}
html#1rc#36<clear>

Ancestry

Ancestors (nearest first): #37 Generic Database#1 Root Class

Children: none

Call graph

calls n78_0 #78:add n37_6 #37:insert n78_0->n37_6 n78_1 #78:remove n78_1->n37_6 n37_8 #37:delete2 n78_1->n37_8 n55_17 #55:assoc n78_1->n55_17 n78_2 #78:load n78_2->n78_0 n52_22 #52:descendants n78_2->n52_22 n6_10 #6:notify n78_2->n6_10 n56_8 #56:suspend_if_needed n78_2->n56_8 n78_3 #78:init_for_core n78_3->n78_2 n1_28 #1:init_for_core n78_3->n1_28 n37_12 #37:clearall n78_3->n37_12

Source

add

Spec this none thisFlags rxdOwner #36Definer #78

Referenced by

Source

1":add(object,parent,name[,is_alias])";
2"returns 1 if successful";
3"        #o if #o already has that parent/name pair";
4if (!(caller in {this, $mail_agent}))
5return E_PERM;
6endif
7{object, parent, name, ?is_alis = 0} = args;
8pn = {parent, name};
9if (oops = this:insert(tostr(parent, ":", name), object))
10if (oops[1] != object)
11return oops[1];
12endif
13elseif (olist = this:insert(colon_name = ":" + name, {object}))
14"...there was already a list of objects for this name.";
15"...reinsert them.";
16this:insert(colon_name, setadd(olist[1], object));
17endif
18if (!(i = pn in object.names))
19object.names = is_alias ? {@object.names, pn} | {pn, @object.names};
20"...maybe fix capitalization...";
21elseif (strcmp(object.names[i][2], name) != 0)
22object.names[i][2] = name;
23endif
24return 1;

remove

Spec this none thisFlags rxdOwner #36Definer #78

Referenced by

none

Source

1":remove(object,parent,name)";
2"removes {parent,name}.";
3if (!(caller in {this, $mail_agent}))
4return E_PERM;
5endif
6{object, parent, name} = args;
7object.names = setremove(object.names, {parent, name});
8this:delete2(tostr(parent, ":", name), object);
9if ($list_utils:assoc(name, object.names, 2))
10"...object still uses this name under other parents...";
11elseif (others = this:delete2(colon_name = ":" + name, {object}))
12"...other objects still use this name...";
13this:insert(colon_name, setremove(others[1], object));
14endif

load

Spec this none thisFlags rxdOwner #2Definer #78

Referenced by

Source

1if (!caller_perms().wizard)
2return E_PERM;
3endif
4for m in ($object_utils:descendents($mail_recipient))
5for n in (m.names || {})
6if (typeof(n) != LIST)
7player:notify(tostr(o:mail_name(), "n=", n));
8elseif (o = this:add(m, @n))
9else
10player:notify(tostr(m:mail_name(), " ", n[1], ":", n[2], " ", o));
11endif
12$command_utils:suspend_if_needed(0);
13endfor
14endfor

init_for_core

Spec this none thisFlags rxdOwner #2Definer #78

Referenced by

none

Source

1if (caller_perms().wizard)
2pass();
3this:clearall();
4`this:load() ! ANY => "archaic verb"';
5endif