View/Edit #12:@check-quota

Switch to edit mode.

Name(s): @check-quota
1:  "Run through all objects in the database and verify which objects a player really owns (obj.owner is always right, player.owned_objects sometimes lies).  Then verify the real disk sizes of all objects."
2:  if (!valid(dobj = dobjstr ? dobj | this) && $command_utils:player_match_failed(dobj = player:match_entity(dobjstr), dobjstr))
3:    return
4:  endif
5:  whose = dobj == this ? "your" | dobj.name + "'s"
6:  player:tell("Searching for ", whose, " objects...")
7:  before = dobj.owned_objects
8:  s = {}
9:  for o in [#1..max_object()]
10:   if (valid(o) && o.owner == dobj)
11:     s = {@s, o}
12:   endif
13:   $command_utils:suspend_if_needed()
14: endfor
15: if (before != dobj.owned_objects)
16:   "Cute trick: @check-quota and @recreate low-numbered objects while it is running..."
17:   return player:tell("dobj.name +  appears to have created or recycled an object while ", verb, " was running.  ", verb, " exiting without making any changes.")
18: endif
19: dobj.owned_objects = s
20: player:tell(whose, " audit now contains: ", toliteral(s))
21: for x in (s)
22:   if (x:isa($garbage))
23:     player:sub_tell("Warning: %D owns the garbage object %1!", x)
24:   endif
25:   $cmd_utils:suspend_if_needed(1)
26: endfor
27: player:tell("Verifying the file size of all of ", whose, " objects...")
28: q = 0
29: for x in (dobj.owned_objects)
30:   q = q + x:_obj_disk_size(1)
31:   $cmd_utils:suspend_if_needed()
32: endfor
33: player:tell("All files verified. There is a total of ", $su:group_number(q), " bytes worth of files.")
34: "Last modified by Dax (#789) on Tue Jun  2 17:08:14 1998 EDT."

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

You are not logged in.

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