View/Edit #12:@old-quota

Switch to edit mode.

Name(s): @old-quota
1:  "Prints out the quota stats for the requested player."
2:  "Also gives or revokes the .programmer bit to repentant/delinquent players"
3:  if (caller != this)
4:    return
5:  elseif (dobjstr == "")
6:    dobj = this
7:  elseif ($command_utils:player_match_failed(dobj = this:match_entity(dobjstr), dobjstr))
8:    return
9:  endif
10: spaceleft = dobj:free_bytes()
11: spacetotal = dobj:_get_max_vm(dobj) / $kb
12: if (spaceleft < 0 && dobj:is_over_quota())
13:   this:sub_tell("%D uses %1 too many kilobytes. %D~S will not be able to create any more objects NOR VERBS until this deficit is cleared.", -spaceleft / $kb)
14: else
15:   this:sub_tell("%D has a byte-quota of %2k, of which %1k are free.", spaceleft / $kb, spacetotal)
16: endif
17: qo = dobj:_get_max_obj()
18: lo = qo - dobj:free_objects()
19: if (lo < qo)
20:   this:sub_tell("%D has created %1 objects out of a possible %2.", lo, qo)
21: elseif (lo == qo)
22:   this:sub_tell("%D has created the maximum possible %1 objects.", lo)
23: else
24:   this:sub_tell("%D has created %1 objects, of which %d~s should only have been able to create %2.", lo, qo)
25: endif
26: if (dobj:free_objects() <= 0)
27:   this:sub_tell("%D~S won't be able to create any new objects until old ones are recycled.")
28: endif
29: dquota = dobj:_get_max_fs()
30: dfree = dobj:free_dbytes()
31: dsize = dquota - dfree
32: if (dfree <= 0)
33:   this:sub_tell("%D uses %1 too many kilobytes of disk space. %D~S will not be able to use any more disk space until this deficit is cleared.", -dfree / $kb)
34: else
35:   this:sub_tell("%D has a disk-quota of %2k, of which %1k are free.", dfree / $kb, dquota / $kb)
36: endif
37: for x in (dobj.quota_contribs)
38:   parts = {}
39:   if (x[2..4] == {0, 0, 0})
40:   else
41:     if (x[2])
42:       parts = {@parts, $msg:substitute(this, "%1 %2 of byte quota", x[2] > 0 ? "contributed" | "received", $quota:kb_string((x[2] < 0 ? -1 | 1) * x[2]))}
43:     endif
44:     if (x[3])
45:       parts = {@parts, $msg:substitute(this, "%1 %2 objects", x[3] > 0 ? "contributed" | "received", (x[3] < 0 ? -1 | 1) * x[3])}
46:     endif
47:     if (x[4])
48:       parts = {@parts, $msg:substitute(this, "%1 %2 of disk quota", x[4] > 0 ? "contributed" | "received", $quota:kb_string((x[4] < 0 ? -1 | 1) * x[4]))}
49:     endif
50:     this:sub_tell("%d has %1 %2 %3.", parts, index(parts[$], "contrib") ? "to" | "from", x[1])
51:   endif
52: endfor
53: "Last modified by Dax (#789) on Thu Nov  8 15:28:55 2001 MST."

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

You are not logged in.

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