|
Sterling Whitcroft
Registered User
Join date: 2 Jul 2006
Posts: 678
|
01-24-2007 20:16
Have hit a snag, and need some help:
Given a PRIM with a Script. The PRIM (through it's Script) accepts OBJECTS dropped into it, then it shares them back out to other avatars. (think of it as a DROP BOX to create FREEBIE bundles--but I only want original creations).
How can I be sure that the OBJECT dropped into the DROPBOX is okay to transfer back out? (I know about the standard permission flags...this is a special case.) The solution I'm trying is to determine if the CONTRIBUTOR AVATAR is the CREATOR of the item. If so, I'd accept the item. If not, I'd refuse it/return it.
I'm looking at the WIKI, and the closest seems to be: llGetInventoryCreator but it seems to only work on the PRIM in which the SCRIPT is running, not on the OBJECT that's dropped into the PRIM.
Is there some way to test that 'contributions' come from the actual content author?
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
01-25-2007 06:32
From the wiki
key llGetInventoryCreator(string item)
This function returns the UUID of the creator of item. If item is not found in inventory, the object says "No item named 'name' ".
Compare with llGetCreator.
When an item is dropped, call llGetInventoryCreator via a changed inventory event, using the name of the new item. This is the right function. (llGetCreator is for the prim in which the script resides.)
|
|
Elsewhere Essex
Registered User
Join date: 8 Sep 2006
Posts: 50
|
01-25-2007 07:02
actually.... i dont think the event flag is CHANGED_INVENTORY for a non owner working under llAllowInventoryDrop(); i believe when new inventory gets added it pops a changed event and fires off CHANGED_ALLOWED_DROP, so to play it safe use something like changed(integer change) { if(change & (CHANGED_ALLOWED_DROP | CHANGED_INVENTORY)) //do something here }
|
|
Sterling Whitcroft
Registered User
Join date: 2 Jul 2006
Posts: 678
|
01-25-2007 18:45
I C Let me try that.  Thanks, everyone!
|
|
Zaphod Kotobide
zOMGWTFPME!
Join date: 19 Oct 2006
Posts: 2,087
|
01-25-2007 19:20
In this case, it is CHANGED_ALLOWED_DROP. CHANGED_INVENTORY is only true when it is the owner of the receiving prim dropping stuff into it. CHANGED_ALLOWED_DROP covers the rest. So unless you want to check yourself, you only need the latter. From: Elsewhere Essex actually.... i dont think the event flag is CHANGED_INVENTORY for a non owner working under llAllowInventoryDrop(); i believe when new inventory gets added it pops a changed event and fires off CHANGED_ALLOWED_DROP, so to play it safe use something like changed(integer change) { if(change & (CHANGED_ALLOWED_DROP | CHANGED_INVENTORY)) //do something here }
|