@paranoid database #81
Aliases: @paranoid database, paranoid
10 verbs · 5 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
ensure_props_exist | this none this | rxd | #81 | 15 |
init_for_core | this none this | rxd | #81 | 8 |
add_data | this none this | rxd | #81 | 14 |
get_data | this none this | rxd | #81 | 11 |
erase_data | this none this | rxd | #81 | 8 |
set_kept_lines | this none this | rxd | #81 | 9 |
gc | this none this | rxd | #81 | 25 |
help_msg | this none this | rxd | #81 | 1 |
weekly | this none this | rxd | #81 | 9 |
is_paranoid | this none this | rxd | #81 | 2 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
key | #1 | c | #36 | 0 |
aliases | #1 | rc | #36 | {"@paranoid database", "paranoid"} |
description | #1 | rc | #36 | list of 19{"", "This object stores the @paranoid data from :tell. Normally it is not necessary to access these things directly. All verbs are controlled by a caller_perms() check. All data is stored in the old .responsible format.", "", ":add_data(who,data) adds one line's worth of data to the collection, trimming from the front as necessary.", "", ":get_data(who) retrieves the entire batch of data.", "", ":erase_data(who) sets the data to {}", "", ":set_kept_lines(who,number) Changes the number of kept lines. Maximum is 20.", "", "Core verbs that call the above are this are $player:tell, @check, @paranoid, and :erase_paranoid_data.", "", "Internal: ", " Properties used are", " tostr(player)+\"lines\"", " tostr(player)+\"pdata\"", " :ensure_props_exist(who,linesname,dataname): creates the above", " :GC() --- loops over all data and verifies they're for players."} |
object_size | #1 | r | #36 | {6362, -1090650497} |
html | #1 | rc | #36 | <clear> |
Ancestry
Ancestors (nearest first): #1 Root Class
Children: none
Call graph
Source
ensure_props_exist
Referenced by
- #81:add_data line 5:
this:ensure_props_exist - #81:set_kept_lines line 5:
this:ensure_props_exist
Source
1"*Must* be called with PDATA first, and LINES second."; 2if ((caller != this) && (!caller_perms().wizard)) 3return E_PERM; 4else 5try 6this.(args[2]); 7except (E_PROPNF) 8add_property(this, args[2], {}, {$hacker, ""}); 9endtry 10try 11this.(args[3]); 12except (E_PROPNF) 13add_property(this, args[3], 5, {$hacker, ""}); 14endtry 15endif
init_for_core
Referenced by
none
Source
1if (!caller_perms().wizard) 2return; 3else 4for x in (properties(this)) 5delete_property(this, x); 6$command_utils:suspend_if_needed(0); 7endfor 8endif
add_data
Referenced by
- #6:tell line 7:
$paranoid_db:add_data - #6:tell_lines line 14:
$paranoid_db:add_data
Source
1{who, newdata} = args; 2if ($perm_utils:controls(caller_perms(), who)) 3d = tostr(who, "pdata"); 4l = tostr(who, "lines"); 5this:ensure_props_exist(who, d, l); 6data = this.(d); 7lines = this.(l); 8"Icky G7 code copied straight out of $player:tell."; 9if (((len = length(this.(d) = {@data, newdata})) * 2) > (lines * 3)) 10this.(d) = this.(d)[(len - lines) + 1..len]; 11endif 12else 13return E_PERM; 14endif
get_data
Referenced by
- #6:@ch*eck-full line 1:
$paranoid_db:get_data
Source
1who = args[1]; 2if ($perm_utils:controls(caller_perms(), who)) 3d = tostr(who, "pdata"); 4if (typeof(`this.(d) ! ANY') == LIST) 5return this.(d); 6else 7return {}; 8endif 9else 10return E_PERM; 11endif
erase_data
Referenced by
- #6:erase_paranoid_data line 4:
$paranoid_db:erase_data
Source
1who = args[1]; 2if ($perm_utils:controls(caller_perms(), who)) 3d = tostr(who, "pdata"); 4"OK if this would toss its cookies if no prop, no damage."; 5`this.(d) = {} ! ANY'; 6else 7return E_PERM; 8endif
set_kept_lines
Referenced by
- #6:@paranoid line 2:
$paranoid_db:set_kept_lines - #6:@paranoid line 6:
$paranoid_db:set_kept_lines - #6:@paranoid line 11:
$paranoid_db:set_kept_lines - #6:@paranoid line 19:
$paranoid_db:set_kept_lines
Source
1maximum = 20; 2who = args[1]; 3if ($perm_utils:controls(caller_perms(), who)) 4l = tostr(who, "lines"); 5this:ensure_props_exist(who, l, l); 6this.(l) = min(args[2], maximum); 7else 8return E_PERM; 9endif
gc
Referenced by
- #81:weekly line 8:
this:gc
Source
1if (((caller_perms() != #-1) && (caller_perms() != player)) || (!player.wizard)) 2$error:raise(E_PERM); 3endif 4threshold = ((60 * 60) * 24) * 3; 5for x in (properties(this)) 6l = length(x); 7who = toobj(x[1..l - 5]); 8if (((!valid(who)) || (!is_player(who))) || (!this:is_paranoid(who))) 9delete_property(this, x); 10else 11if (index(x, "lines")) 12if (typeof(this.(x)) != INT) 13this.(x) = 10; 14endif 15elseif (index(x, "pdata")) 16if ((who.last_disconnect_time < (time() - threshold)) && (who.last_connect_time < (time() - threshold))) 17this.(x) = {}; 18endif 19if (typeof(this.(x)) != LIST) 20this.(x) = {}; 21endif 22endif 23endif 24(ticks_left() < 4000) && suspend(0); 25endfor
help_msg
Referenced by
none
Source
1return this:description();
weekly
Referenced by
- #81:weekly line 6:
this:weekly
Source
1if (!caller_perms().wizard) 2return E_PERM; 3else 4week = (7 * 24) * 3600; 5fork ((((7 * 60) * 60) + week) - (time() % week)) 6this:weekly(); 7endfork 8this:gc(); 9endif
is_paranoid
Referenced by
- #81:gc line 8:
this:is_paranoid
Source
1"Some people make their .paranoid !r. Wizardly verb to retrieve value."; 2return `args[1].paranoid ! ANY';