@verb #53:"request" this none this rxdo #55 @program #53:"request" this none this ":request(object_number, parent[, owner[, perms]])" "Assigns the unused object number to owner as a child of parent." "Requesting #-1 does a hard create." "Returns: " "OK => 1" "Parent is not duplicatable by you => E_PERM" "Don't have permission to assign the owner => E_PERM" "Owner doesn't have quota => E_QUOTA" "Requested a reserved object number => E_PERM" "Requested an object number otherwise unavailable => E_PERM" this:sanity_check() {o, what, ?who = caller_perms(), ?perms = caller_perms()} = args if (!caller_perms():controls(perms)) raise(E_PERM) elseif (!perms:controls(who)) raise(E_PERM, tostr($string_utils:nn(perms), " can't create an object owned by ", $string_utils:nn(who), ".")) elseif (!perms.wizard && !$perm_utils:perm_f(perms, what)) raise(E_PERM, "Parent is not fertile.") elseif (valid(who) && who:is_over_quota()) raise(E_QUOTA, "Sorry, you are over quota.") elseif (o != #-1) if (!o:isa($trash)) raise(E_INVARG, tostr(o, " is not a garbage object.")) elseif (toint(o) < 1000 && !perms:isa($guardian)) raise(E_PERM, "Only guardians can request objects < 1000") elseif (o.recycled_time >= $recycler.last_complete_refkill_sweep && (callers()[1][2] != "do_retrieve" || !callers()[1][3].wizard)) raise(E_INVARG, "Sorry, the DB has not been swept clean of old object #s since this object was reycled. Either choose a different object, or kick the $recycler and try again in about an hour.") endif else if (!$quota:can_hard_create(perms)) raise(E_QUOTA, "Sorry, you aren't allowed to hard create.") endif $hard_creating_tasks = setadd($hard_creating_tasks, task_id()) o = create($garbage) endif if (!this:contains(o)) "well, it'd be nice if it were in the garbage place, but, what can ya do." "Who put this before line 22? This allowed anyone to request something! - whiz" move(o, this) endif o.owner = valid(who) ? who | o if (callers()[1][2] != "do_retrieve" || !callers()[1][3].wizard) for x in (o:filelist()) `o:filedelete(x) ! E_INVARG' endfor o:_obj_disk_size("reset size cache") elseif (0) "Keep all the files (except the ghost)" o:fileexists("ghost") && o:filedelete("ghost") endif for x in (o.contents) move(x, o.location) endfor $building_utils:chparent(o, what) this.location:sub_announce_all(this.msg_obj_created) if (o:isa($physical)) move(o, $czone) elseif (!o:isa($garbage)) move(o, $nothing) endif if (toint(o) < 1000 || `who:builder_option("solidify") ! ANY') o.best_before = 0 "Important Objects should be petrified. -Lao" endif return 1 "Last modified by Dax (#789) on Tue May 3 14:11:54 2005 MDT." .