View/Edit #12:_audit

Switch to edit mode.

Name(s): _audit
1:  caller == this || raise(E_PERM)
2:  set_task_perms(caller_perms())
3:  lines = sizes = {}
4:  toasty = 0
5:  nbytes = nobjs = ndisk = 0
6:  folders = {}
7:  removeable = {}
8:  for y in [1..length(this.audit_folders)]
9:    for z in [1..length(this.audit_folders[y][2])]
10:     what = this.audit_folders[y][2][z]
11:     if (!$recycler:valid(what) || what.owner != this)
12:       removeable[1..0] = {{y, z}}
13:     endif
14:   endfor
15: endfor
16: for y in (removeable)
17:   this.audit_folders[y[1]][2] = listdelete(this.audit_folders[y[1]][2], y[2])
18: endfor
19: for x in (args)
20:   if (!$recycler:valid(x))
21:     continue
22:   endif
23:   folder_idx = -1
24:   if (x.owner == this)
25:     for y in [1..length(this.audit_folders)]
26:       if (x in this.audit_folders[y][2])
27:         folder_idx = y
28:         break
29:       endif
30:     endfor
31:   endif
32:   size = `x:object_bytes() ! E_PERM => "<font color='red'>UnReadable</font>"'
33:   dsize = x:_obj_disk_size()
34:   if (`x:_get_subsidised() ! E_PROPNF => 0')
35:     dsizestr = "<font color='blue'>[subsidised]</font>"
36:   else
37:     dsizestr = dsize || ""
38:   endif
39:   sizestr = size || ""
40:   if (`x:_get_petrified() ! E_PROPNF => 1')
41:     expire = "<font color='green'>[petrified]</font>"
42:   elseif (x:_get_solidified())
43:     expire = "<font color='yellow'>[solidified]</font>"
44:   elseif ($object_utils:isa(x, $player))
45:     expire = ""
46:   elseif (x:is_expired())
47:     expire = "<font color='red'>*EXPIRED*</font>"
48:     toasty = toasty + 1
49:   else
50:     expire = $string_utils:from_seconds(x.best_before - time())
51:   endif
52:   $cmd_utils:suspend_if_needed(0)
53:   audit_line = {tostr(x), `this:general_option("antiparanoia") && $cecil_utils:is_malicious(x, "title") ? x.name | x:title() ! ANY => "???"', `$code_utils:classify_object(x) ! ANY => "???"', tostr(sizestr), tostr(dsizestr), expire}
54:   if (folder_idx == -1)
55:     sizes[1..0] = {size}
56:     lines[1..0] = {audit_line}
57:   else
58:     idx = $list_utils:iassoc(this.audit_folders[folder_idx][1], folders)
59:     if (!idx)
60:       folders = {@folders, {this.audit_folders[folder_idx][1], {}}}
61:       idx = length(folders)
62:     endif
63:     folders[idx][2][1..0] = {audit_line}
64:   endif
65:   if (!(`x:_get_petrified() ! E_PROPNF' || `x:_get_subsidised() ! E_PROPNF'))
66:     nobjs = nobjs + 1
67:     nbytes = nbytes + (typeof(size) == $INT ? size | 0)
68:     ndisk = ndisk + dsize
69:   endif
70:   $command_utils:suspend_if_needed()
71: endfor
72: $tcm || (lines = $list_utils:sort(lines, sizes))
73: lines = {@lines, "-"}
74: lines = {@lines, {"", "Total quota used:", tostr(nobjs), tostr(nbytes), tostr(ndisk), ""}}
75: lines = {@lines, {"", "Free quota:", tostr(dobj:free_objects()), tostr(dobj:free_bytes()), tostr(dobj:free_dbytes()), ""}}
76: for x in (folders)
77:   lines = {{"", x[1], "", "", "", ""}, @x[2], "-", @lines}
78: endfor
79: this:tellColumns(3, {20, 10, 15, 20, 20, 20}, {"#", "name", "type", "bytes", "dsize", "good for"}, @lines)
80: if (toasty)
81:   this:sub_tell("Total %2 expired objects... %1's coming...", $repo_man, toasty)
82: endif
83: "Last modified by Dax (#789) on Wed Jan 24 17:28:20 2007 EST."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

[home | help | who | search | setup | code]