Object Quota Utilities #73
Aliases: Object Quota Utilities
15 verbs · 14 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
initialize_quota | this none this | rxd | #73 | 5 |
init_for_core | this none this | rxd | #73 | 5 |
adjust_quota_for_programmer | this none this | rxd | #73 | 12 |
bi_create | this none this | rxd | #73 | 3 |
creation_permitted | this none this | rxd | #73 | 1 |
verb_addition_permitted property_addition_permitted | this none this | rxd | #73 | 1 |
display_quota | this none this | rxd | #73 | 16 |
get_quota quota_remaining | this none this | rxd | #73 | 5 |
charge_quota | this none this | rxd | #73 | 7 |
reimburse_quota | this none this | rxd | #73 | 7 |
set_quota | this none this | rxd | #73 | 7 |
preliminary_reimburse_quota | this none this | rxd | #73 | 1 |
can_peek | this none this | rxd | #73 | 2 |
can_touch | this none this | rxd | #73 | 2 |
object_bytes | this none this | rxd | #73 | 26 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
byte_based | #73 | rc | #29 | 0 |
too_large | #73 | rc | #29 | 1000000 |
large_objects | #73 | rc | #29 | {#5460, #17, #159, #2905, #13609, #46684, #81273, #98829} |
help_msg | #72 | rc | #29 | "This is the default package that interfaces to the $player/$prog quota manipulation verbs." |
aliases | #1 | rc | #29 | {"Object Quota Utilities"} |
description | #1 | rc | #29 | {"This is the Object Quota Utilities utility package. See `help $object_quota_utils' for more details."} |
object_size | #1 | r | #29 | {7929, 1298433815} |
hidden_verbs | #1 | rc | #29 | <clear> |
phelp_msg | #1 | rc | #29 | <clear> |
weight | #1 | rc | #29 | <clear> |
owner_verbs | #1 | rc | #29 | <clear> |
plural_name | #1 | rc | #29 | <clear> |
client_image | #1 | rc | #29 | <clear> |
listening | #1 | rc | #29 | <clear> |
Ancestry
Ancestors (nearest first): #72 Generic Utilities Package → #1 root
Children: none
Call graph
Source
initialize_quota
Referenced by
- #4:cr*eate line 44:
$quota_utils:initialize_quota - #17:make_player line 15:
$quota_utils:initialize_quota - #17:make_ur_player line 16:
$quota_utils:initialize_quota
Source
1if (!caller_perms().wizard) 2return E_PERM; 3else 4args[1].ownership_quota = $wiz_utils.default_player_quota; 5endif
init_for_core
Referenced by
none
Source
1if (!caller_perms().wizard) 2return E_PERM; 3else 4$quota_utils = this; 5endif
adjust_quota_for_programmer
Referenced by
- #17:set_programmer line 16:
$quota_utils:adjust_quota_for_programmer
Source
1if (!caller_perms().wizard) 2return E_PERM; 3else 4victim = args[1]; 5oldquota = victim.ownership_quota; 6if ($object_utils:has_property($local, "second_char_registry") && $local.second_char_registry:is_second_char(victim)) 7"don't increment quota for 2nd chars when programmering"; 8victim.ownership_quota = oldquota; 9else 10victim.ownership_quota = oldquota + ($wiz_utils.default_programmer_quota - $wiz_utils.default_player_quota); 11endif 12endif
bi_create
Referenced by
- #2:_create line 3:
$quota_utils:bi_create - #4:cr*eate line 29:
$quota_utils:bi_create - #17:make_player line 7:
$quota_utils:bi_create - #17:make_ur_player line 8:
$quota_utils:bi_create - #49:make-core-database line 9:
$quota_utils:bi_create - #49:@make-guest line 29:
$quota_utils:bi_create - #49:coredat line 5:
$quota_utils:bi_create - #57:_create line 12:
$quota_utils:bi_create - #57:resurrect line 6:
$quota_utils:bi_create
Source
1"Calls built-in create."; 2set_task_perms(caller_perms()); 3return `create(@args) ! ANY';
creation_permitted
Referenced by
none
Source
1return args[1].ownership_quota > 0;
verb_addition_permitted property_addition_permitted
Referenced by
- #0:bf_add_verb line 16:
$quota_utils:verb_addition_permitted - #0:bf_add_verb line 18:
$quota_utils:verb_addition_permitted - #0:bf_add_property line 12:
$quota_utils:property_addition_permitted - #0:bf_add_property line 14:
$quota_utils:property_addition_permitted - #50:@prop*erty line 6:
$quota_utils:property_addition_permitted - #50:@verb line 6:
$quota_utils:verb_addition_permitted - #50:@copy line 10:
$quota_utils:verb_addition_permitted - #50:@copy line 35:
$quota_utils:verb_addition_permitted
Source
1return 1;
display_quota
Referenced by
- #2:@quota line 11:
$quota_utils:display_quota
Source
1who = args[1]; 2if (caller_perms() == who) 3q = who.ownership_quota; 4total = (typeof(who.owned_objects) == LIST) ? length(setremove(who.owned_objects, who)) | 0; 5if (q == 0) 6player:tell(tostr("You can't create any more objects", (total < 1) ? "." | tostr(" until you recycle some of the ", total, " you already own."))); 7else 8player:tell(tostr("You can create ", q, " new object", (q == 1) ? "" | "s", (total == 0) ? "." | tostr(" without recycling any of the ", total, " that you already own."))); 9endif 10else 11if ($perm_utils:controls(caller_perms(), who)) 12player:tell(tostr(who.name, "'s quota is currently ", who.ownership_quota, ".")); 13else 14player:tell("Permission denied."); 15endif 16endif
get_quota quota_remaining
Referenced by
- #49:@programmer line 12:
$quota_utils:get_quota - #49:@quota line 25:
$quota_utils:get_quota
Source
1if ($perm_utils:controls(caller_perms(), args[1]) || (caller == this)) 2return args[1].ownership_quota; 3else 4return E_PERM; 5endif
charge_quota
Referenced by
- #17:set_owner line 34:
$quota_utils:charge_quota - #17:set_owner_new line 31:
$quota_utils:charge_quota
Source
1"Charge args[1] for the quota required to own args[2]"; 2{who, what} = args; 3if ((caller == this) || caller_perms().wizard) 4who.ownership_quota = who.ownership_quota - 1; 5else 6return E_PERM; 7endif
reimburse_quota
Referenced by
- #17:set_owner line 26:
$quota_utils:reimburse_quota - #17:set_owner_new line 23:
$quota_utils:reimburse_quota
Source
1"Reimburse args[1] for the quota required to own args[2]"; 2{who, what} = args; 3if ((caller == this) || caller_perms().wizard) 4who.ownership_quota = who.ownership_quota + 1; 5else 6return E_PERM; 7endif
set_quota
Referenced by
- #49:@quota line 35:
$quota_utils:set_quota
Source
1"Set args[1]'s quota to args[2]"; 2{who, quota} = args; 3if (caller_perms().wizard || (caller == this)) 4return who.ownership_quota = quota; 5else 6return E_PERM; 7endif
preliminary_reimburse_quota
Referenced by
none
Source
1return 0;
can_peek
Referenced by
none
Source
1"Is args[1] permitted to examine args[2]'s quota information?"; 2return $perm_utils:controls(args[1], args[2]);
can_touch
Referenced by
none
Source
1"Is args[1] permitted to examine args[2]'s quota information?"; 2return args[1].wizard;
object_bytes
Referenced by
none
Source
1"No need for lengthy algorithms to measure an object, we have a builtin now. Ho_Yan 10/31/96"; 2set_task_perms($wiz_utils:random_wizard()); 3o = args[1]; 4if (((($object_utils:has_property(o, "object_size") && (o.object_size[1] > this.too_large)) && (!caller_perms().wizard)) && (caller_perms() != this.owner)) && (caller_perms() != $hacker)) 5return o.object_size[1]; 6endif 7b = object_bytes(o); 8if ($object_utils:has_property(o, "object_size")) 9oldsize = is_clear_property(o, "object_size") ? 0 | o.object_size[1]; 10if ($object_utils:has_property(o.owner, "size_quota")) 11"Update quota cache."; 12if (oldsize) 13o.owner.size_quota[2] = o.owner.size_quota[2] + (b - oldsize); 14else 15o.owner.size_quota[2] = o.owner.size_quota[2] + b; 16if (o.owner.size_quota[4] > 0) 17o.owner.size_quota[4] = o.owner.size_quota[4] - 1; 18endif 19endif 20endif 21o.object_size = {b, time()}; 22endif 23if (b > this.too_large) 24this.large_objects = setadd(this.large_objects, o); 25endif 26return b;