Mail Name DB #78
Aliases: Mail Name DB
4 verbs · 7 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
add | this none this | rxd | #78 | 24 |
remove | this none this | rxd | #78 | 14 |
load | this none this | rxd | #78 | 14 |
init_for_core | this none this | rxd | #78 | 5 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
node_perms | #37 | rc | #36 | <clear> |
data | #37 | r | #36 | <clear> |
| #37 | | #36 | {"", "", {}, {}} |
key | #1 | c | #36 | 0 |
aliases | #1 | rc | #36 | {"Mail Name DB"} |
description | #1 | rc | #36 | "... for doing mail-recipient name lookups." |
object_size | #1 | r | #36 | {3383, -1090650497} |
Ancestry
Ancestors (nearest first): #37 Generic Database → #1 Root Class
Children: none
Call graph
Source
add
Referenced by
- #78:load line 8:
this:add
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
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
Referenced by
- #78:init_for_core line 4:
this:load
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
Referenced by
none
Source
1if (caller_perms().wizard) 2pass(); 3this:clearall(); 4`this:load() ! ANY => "archaic verb"'; 5endif