|
Nela Lykin
Registered User
Join date: 16 Feb 2007
Posts: 4
|
05-06-2007 14:10
I need to compare the owners key of an object that was dropped inside a prim with the key of the person that dropped it. The person interacts through a menu after he put the object in the prim, so i get the key of the person easily. Now i want to check if the person who dropped the object in the prim is the one that interacts through the menu. I tried this code: integer CompareKeys(string objectname,key ownerkey) { key objectid; key objectownerkey; if(llGetInventoryType(objectname)!=INVENTORY_NONE) { objectid=llGetInventoryKey(objectname); objectownerkey=llGetOwnerKey(objectid); if(ownerkey!=objectownerkey) { llSay(0,"Ownerkey and ObjectOwnerKey do not match!"  ; //... } else { // do what we intended //... } } } The llGetOwnerKey function always returns the key of the object itself, but not the key of its owner, so they never match. Any ideas?
|
|
Jacques Groshomme
Registered User
Join date: 16 Mar 2005
Posts: 355
|
05-06-2007 14:13
There is no way you can tell who dropped an item into an object's contents.
The best workaround we've come up with is to make the person touch the object first, gather their UUID then, and hope that they are the ones who dropped inventory.
|
|
Nela Lykin
Registered User
Join date: 16 Feb 2007
Posts: 4
|
05-06-2007 14:19
As i said, the person interacts through a menu while he drops the item, so the persons key is no prob. But still could anybody else drop an item in parallel, cause the object allows it with llAllowInventoryDrop(TRUE);
I only want to get the owner of the item, cause this must be the person that dropped it.
Or can you explain why the llGetOwnerKey function doesn't behave like expected?
|
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
05-06-2007 14:34
Nela, once an object is dropped into another object's inventory, it becomes the property of that 2nd object's owner. You cannot move Object A owned by Owner X to Object B owned by Owner Y without Object A becoming owned by Owner Y.
I built a tool that used an llAllowInventoryDrop() and restricted the items to be allowed drop by checking against the object-creator...but at that point the person dropping Object A into Object B MUST be Object A's creator. For my project, the restriction was not only acceptable, it was desirable.
Otherwise...I'm afraid you're out of luck.
_____________________
--AeonVox--Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
|
|
Nela Lykin
Registered User
Join date: 16 Feb 2007
Posts: 4
|
05-06-2007 14:51
Ok, now i go at least why it doesn't work.
In my case it forces me not to check if the person that interacts with the menu is really the one who dropped the item.
Maybe i can make it a little more safe by allowing the InventoryDrop only while the person interacts with the menu. Or maybe i can allow it only for the person himself. Have to research that.
Thx so far.
|
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
05-06-2007 15:50
I suggest turning on llAllowInventoryDrop() when the person brings up the menu and then turning it off in response to the CHANGED_ALLOWED_DROP changed event. Such would keep the window as short as possible and turn off automatically as soon as someone makes their item-drop.
_____________________
--AeonVox--Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
|