depwl9992 / anomalyjobs

Automatically exported from code.google.com/p/anomalyjobs
0 stars 0 forks source link

Improve bucket search to exclude players #129

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a bucket named FOO
2. Have a player with an @alias of Foo in the JPO
3. +job/trans <#>=Foo

What is the expected output?
You have transferred the job from REQ to FOO.

What do you see instead?
There is no bucket by that name. Type '+buckets' for a list of valid buckets.

Please use labels and text to provide additional information.
Yes, this problem only occurs in the rare case that the codewiz who happens to 
have @tel'd to the JPO to futz with job hooks also happens to share an alias 
with a bucket name that someone's trying to access.  However, it shouldn't be 
too hard to fix FN_FIND-BUCKET to use locate() only on things (or to prefer 
them over players).

Original issue reported on code.google.com by widdis@gmail.com on 2 Sep 2010 at 9:52

GoogleCodeExporter commented 9 years ago
Three options here:

1. Do nothing. Normally everything in %vc is a bucket so this is rare enough 
not to worry about coding around.

2. Change the locate() in FN_FIND-BUCKET (and other places such as TRIG_APPLY) 
to use iT rather than just i, in order to prefer the bucket Things to a Player, 
probably the only time something other than a bucket will be in %vc.

3. Go all out and use a combination of lcon(%vc) and children(%vc) to check for 
bucket-ness.  (This is what the +buckets command does.)

Opinions?

Original comment by widdis@gmail.com on 8 Sep 2010 at 2:35

GoogleCodeExporter commented 9 years ago
Did option 2 in r362. Tossed it in for jobs and jgroups too, for completeness.

Original comment by widdis@gmail.com on 4 Nov 2010 at 7:17