Diva Canto 2009-08-18 22:17:47 -07:00
parent 465d1095dd
commit 124f66bfc2
9 changed files with 52 additions and 30 deletions

View File

@ -78,6 +78,12 @@ namespace OpenSim.Framework
ID = id; ID = id;
} }
public InventoryFolderBase(UUID id, UUID owner)
{
ID = id;
Owner = owner;
}
public InventoryFolderBase(UUID id, string name, UUID owner, short type, UUID parent, ushort version) public InventoryFolderBase(UUID id, string name, UUID owner, short type, UUID parent, ushort version)
{ {
ID = id; ID = id;

View File

@ -6633,9 +6633,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
else // Agent else // Agent
{ {
//InventoryItemBase assetRequestItem = userInfo.RootFolder.FindItem(itemID);
IInventoryService invService = m_scene.RequestModuleInterface<IInventoryService>(); IInventoryService invService = m_scene.RequestModuleInterface<IInventoryService>();
InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(itemID)); InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, AgentId);
assetRequestItem = invService.GetItem(assetRequestItem);
if (assetRequestItem == null) if (assetRequestItem == null)
{ {
assetRequestItem = ((Scene)m_scene).CommsManager.UserProfileCacheService.LibraryRoot.FindItem(itemID); assetRequestItem = ((Scene)m_scene).CommsManager.UserProfileCacheService.LibraryRoot.FindItem(itemID);

View File

@ -130,7 +130,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
} }
else else
{ {
InventoryItemBase baseItem = invService.GetItem(new InventoryItemBase(appearance.Wearables[i].ItemID)); InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i].ItemID, userID);
baseItem = invService.GetItem(baseItem);
if (baseItem != null) if (baseItem != null)
{ {

View File

@ -65,7 +65,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
{ {
IInventoryService invService = m_scene.InventoryService; IInventoryService invService = m_scene.InventoryService;
InventoryItemBase item = invService.GetItem(new InventoryItemBase(gestureId)); InventoryItemBase item = new InventoryItemBase(gestureId, client.AgentId);
item = invService.GetItem(item);
if (item != null) if (item != null)
{ {
item.Flags = 1; item.Flags = 1;
@ -80,7 +81,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures
{ {
IInventoryService invService = m_scene.InventoryService; IInventoryService invService = m_scene.InventoryService;
InventoryItemBase item = invService.GetItem(new InventoryItemBase(gestureId)); InventoryItemBase item = new InventoryItemBase(gestureId, client.AgentId);
item = invService.GetItem(item);
if (item != null) if (item != null)
{ {
item.Flags = 0; item.Flags = 0;

View File

@ -258,7 +258,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip
InventoryItemBase item = invService.GetItem(new InventoryItemBase(inventoryEntityID)); InventoryItemBase item = new InventoryItemBase(inventoryEntityID, client.AgentId);
item = invService.GetItem(item);
InventoryFolderBase folder = null; InventoryFolderBase folder = null;
if (item != null && trashFolder != null) if (item != null && trashFolder != null)
@ -271,7 +272,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
} }
else else
{ {
folder = invService.GetFolder(new InventoryFolderBase(inventoryEntityID)); folder = new InventoryFolderBase(inventoryEntityID, client.AgentId);
folder = invService.GetFolder(folder);
if (folder != null & trashFolder != null) if (folder != null & trashFolder != null)
{ {
@ -451,10 +453,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
else else
{ {
UUID itemID = new UUID(msg.binaryBucket, 1); UUID itemID = new UUID(msg.binaryBucket, 1);
InventoryItemBase item = new InventoryItemBase(); InventoryItemBase item = new InventoryItemBase(itemID, user.ControllingClient.AgentId);
item.ID = itemID;
item.Owner = user.ControllingClient.AgentId;
// Fetch from service // Fetch from service
// //

View File

@ -483,12 +483,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
string userInventoryServerURI = HGNetworkServersInfo.ServerURI(uinfo.UserProfile.UserInventoryURI); string userInventoryServerURI = HGNetworkServersInfo.ServerURI(uinfo.UserProfile.UserInventoryURI);
string uri = m_LocalGridInventoryURI.TrimEnd('/'); string uri = m_LocalGridInventoryURI.TrimEnd('/');
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: IsLocalGridUser, comparing {0} to {1}.", userInventoryServerURI, uri);
if ((userInventoryServerURI == uri) || (userInventoryServerURI == "")) if ((userInventoryServerURI == uri) || (userInventoryServerURI == ""))
{ {
return true; return true;
} }
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: user is foreign({0} - {1})", userInventoryServerURI, uri);
return false; return false;
} }

View File

@ -966,7 +966,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (objectID == UUID.Zero) // User inventory if (objectID == UUID.Zero) // User inventory
{ {
IInventoryService invService = m_scene.InventoryService; IInventoryService invService = m_scene.InventoryService;
InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(notecard)); InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user);
assetRequestItem = invService.GetItem(assetRequestItem);
if (assetRequestItem == null) // Library item if (assetRequestItem == null) // Library item
{ {
assetRequestItem = scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); assetRequestItem = scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard);
@ -1385,7 +1386,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (objectID == UUID.Zero) // User inventory if (objectID == UUID.Zero) // User inventory
{ {
IInventoryService invService = m_scene.InventoryService; IInventoryService invService = m_scene.InventoryService;
InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(script)); InventoryItemBase assetRequestItem = new InventoryItemBase(script, user);
assetRequestItem = invService.GetItem(assetRequestItem);
if (assetRequestItem == null) // Library item if (assetRequestItem == null) // Library item
{ {
assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(script); assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(script);
@ -1479,7 +1481,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (objectID == UUID.Zero) // User inventory if (objectID == UUID.Zero) // User inventory
{ {
IInventoryService invService = m_scene.InventoryService; IInventoryService invService = m_scene.InventoryService;
InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(notecard)); InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user);
assetRequestItem = invService.GetItem(assetRequestItem);
if (assetRequestItem == null) // Library item if (assetRequestItem == null) // Library item
{ {
assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard);

View File

@ -140,7 +140,8 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns></returns> /// <returns></returns>
public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data)
{ {
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item);
if (item != null) if (item != null)
{ {
@ -315,7 +316,8 @@ namespace OpenSim.Region.Framework.Scenes
public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID,
UUID itemID, InventoryItemBase itemUpd) UUID itemID, InventoryItemBase itemUpd)
{ {
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item);
if (item != null) if (item != null)
{ {
@ -408,7 +410,8 @@ namespace OpenSim.Region.Framework.Scenes
{ {
Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem");
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemId)); InventoryItemBase item = new InventoryItemBase(itemId, senderId);
item = InventoryService.GetItem(item);
if ((item != null) && (item.Owner == senderId)) if ((item != null) && (item.Owner == senderId))
{ {
@ -558,7 +561,8 @@ namespace OpenSim.Region.Framework.Scenes
if (item == null) if (item == null)
{ {
item = InventoryService.GetItem(new InventoryItemBase(oldItemID)); item = new InventoryItemBase(oldItemID, remoteClient.AgentId);
item = InventoryService.GetItem(item);
if (item == null) if (item == null)
{ {
@ -636,7 +640,8 @@ namespace OpenSim.Region.Framework.Scenes
m_log.DebugFormat( m_log.DebugFormat(
"[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId); "[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId);
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item);
if (item != null) if (item != null)
{ {
@ -1224,7 +1229,8 @@ namespace OpenSim.Region.Framework.Scenes
UUID copyID = UUID.Random(); UUID copyID = UUID.Random();
if (itemID != UUID.Zero) if (itemID != UUID.Zero)
{ {
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item);
// Try library // Try library
if (null == item) if (null == item)
@ -1287,7 +1293,8 @@ namespace OpenSim.Region.Framework.Scenes
if (itemID != UUID.Zero) // transferred from an avatar inventory to the prim's inventory if (itemID != UUID.Zero) // transferred from an avatar inventory to the prim's inventory
{ {
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item);
// Try library // Try library
// XXX clumsy, possibly should be one call // XXX clumsy, possibly should be one call
@ -1672,7 +1679,7 @@ namespace OpenSim.Region.Framework.Scenes
if (DeRezAction.SaveToExistingUserInventoryItem == action) if (DeRezAction.SaveToExistingUserInventoryItem == action)
{ {
item = new InventoryItemBase(objectGroup.RootPart.FromUserInventoryItemID); item = new InventoryItemBase(objectGroup.RootPart.FromUserInventoryItemID, userID);
item = InventoryService.GetItem(item); item = InventoryService.GetItem(item);
//item = userInfo.RootFolder.FindItem( //item = userInfo.RootFolder.FindItem(
@ -1834,7 +1841,8 @@ namespace OpenSim.Region.Framework.Scenes
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup); string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item);
if (item != null) if (item != null)
{ {
@ -1984,7 +1992,8 @@ namespace OpenSim.Region.Framework.Scenes
BypassRayCast, bRayEndIsIntersection,true,scale, false); BypassRayCast, bRayEndIsIntersection,true,scale, false);
// Rez object // Rez object
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item);
if (item != null) if (item != null)
{ {
@ -2309,7 +2318,8 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence presence; ScenePresence presence;
if (TryGetAvatar(remoteClient.AgentId, out presence)) if (TryGetAvatar(remoteClient.AgentId, out presence))
{ {
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID, remoteClient.AgentId)); InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item);
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>(); IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>();
@ -2360,7 +2370,8 @@ namespace OpenSim.Region.Framework.Scenes
if (TryGetAvatar(remoteClient.AgentId, out presence)) if (TryGetAvatar(remoteClient.AgentId, out presence))
{ {
// XXYY!! // XXYY!!
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item);
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>(); IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>();
if (ava != null) if (ava != null)

View File

@ -404,7 +404,8 @@ namespace OpenSim.Region.Framework.Scenes
return; return;
} }
InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = InventoryService.GetItem(item);
if (item != null) if (item != null)
{ {