diff options
author | Melanie Thielker | 2016-07-04 03:35:48 +0100 |
---|---|---|
committer | Melanie Thielker | 2016-07-04 03:35:48 +0100 |
commit | ea8f3c83bf96453e8223d918933d5708fa49a3cc (patch) | |
tree | 288972a5d6f112426da2b5ab109fe18ba5aedc2e /OpenSim/Region/CoreModules/Framework/InventoryAccess | |
parent | increase xmlrpc timeout in xmlrpcgroups, disable its cache until its entries ... (diff) | |
download | opensim-SC_OLD-ea8f3c83bf96453e8223d918933d5708fa49a3cc.zip opensim-SC_OLD-ea8f3c83bf96453e8223d918933d5708fa49a3cc.tar.gz opensim-SC_OLD-ea8f3c83bf96453e8223d918933d5708fa49a3cc.tar.bz2 opensim-SC_OLD-ea8f3c83bf96453e8223d918933d5708fa49a3cc.tar.xz |
Finally remove the requirement for an InventoryItem/FolderBase object to
be passed into inventory queries.
This makes the API more homogenous and also will more clearly show
coding
errors related to HG inventory where the .Owner field has a meaning
for a query but wasn't always set.
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/InventoryAccess')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 19 |
2 files changed, 7 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 06a8f25..4119f90 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs | |||
@@ -314,9 +314,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
314 | 314 | ||
315 | //if (fromTaskID.Equals(UUID.Zero)) | 315 | //if (fromTaskID.Equals(UUID.Zero)) |
316 | //{ | 316 | //{ |
317 | InventoryItemBase item = new InventoryItemBase(itemID); | 317 | InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID); |
318 | item.Owner = remoteClient.AgentId; | ||
319 | item = m_Scene.InventoryService.GetItem(item); | ||
320 | //if (item == null) | 318 | //if (item == null) |
321 | //{ // Fetch the item | 319 | //{ // Fetch the item |
322 | // item = new InventoryItemBase(); | 320 | // item = new InventoryItemBase(); |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 64233d5..781b9ff 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -184,8 +184,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
184 | if (!m_Scene.Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) | 184 | if (!m_Scene.Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) |
185 | return; | 185 | return; |
186 | 186 | ||
187 | InventoryFolderBase f = new InventoryFolderBase(folderID, remoteClient.AgentId); | 187 | InventoryFolderBase folder = m_Scene.InventoryService.GetFolder(remoteClient.AgentId, folderID); |
188 | InventoryFolderBase folder = m_Scene.InventoryService.GetFolder(f); | ||
189 | 188 | ||
190 | if (folder == null && Enum.IsDefined(typeof(FolderType), (sbyte)invType)) | 189 | if (folder == null && Enum.IsDefined(typeof(FolderType), (sbyte)invType)) |
191 | { | 190 | { |
@@ -260,8 +259,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
260 | /// <returns></returns> | 259 | /// <returns></returns> |
261 | public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) | 260 | public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) |
262 | { | 261 | { |
263 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 262 | InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID); |
264 | item = m_Scene.InventoryService.GetItem(item); | ||
265 | 263 | ||
266 | if (item.Owner != remoteClient.AgentId) | 264 | if (item.Owner != remoteClient.AgentId) |
267 | return UUID.Zero; | 265 | return UUID.Zero; |
@@ -719,8 +717,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
719 | 717 | ||
720 | if (DeRezAction.SaveToExistingUserInventoryItem == action) | 718 | if (DeRezAction.SaveToExistingUserInventoryItem == action) |
721 | { | 719 | { |
722 | item = new InventoryItemBase(so.RootPart.FromUserInventoryItemID, userID); | 720 | item = m_Scene.InventoryService.GetItem(userID, so.RootPart.FromUserInventoryItemID); |
723 | item = m_Scene.InventoryService.GetItem(item); | ||
724 | 721 | ||
725 | //item = userInfo.RootFolder.FindItem( | 722 | //item = userInfo.RootFolder.FindItem( |
726 | // objectGroup.RootPart.FromUserInventoryItemID); | 723 | // objectGroup.RootPart.FromUserInventoryItemID); |
@@ -792,9 +789,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
792 | { | 789 | { |
793 | if (so.FromFolderID != UUID.Zero && so.RootPart.OwnerID == remoteClient.AgentId) | 790 | if (so.FromFolderID != UUID.Zero && so.RootPart.OwnerID == remoteClient.AgentId) |
794 | { | 791 | { |
795 | InventoryFolderBase f = new InventoryFolderBase(so.FromFolderID, userID); | 792 | folder = m_Scene.InventoryService.GetFolder(userID, so.FromFolderID); |
796 | if (f != null) | ||
797 | folder = m_Scene.InventoryService.GetFolder(f); | ||
798 | 793 | ||
799 | if(folder.Type == 14 || folder.Type == 16) | 794 | if(folder.Type == 14 || folder.Type == 16) |
800 | { | 795 | { |
@@ -830,8 +825,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
830 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) | 825 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) |
831 | { | 826 | { |
832 | // m_log.DebugFormat("[INVENTORY ACCESS MODULE]: RezObject for {0}, item {1}", remoteClient.Name, itemID); | 827 | // m_log.DebugFormat("[INVENTORY ACCESS MODULE]: RezObject for {0}, item {1}", remoteClient.Name, itemID); |
833 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 828 | InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID); |
834 | item = m_Scene.InventoryService.GetItem(item); | ||
835 | 829 | ||
836 | if (item == null) | 830 | if (item == null) |
837 | { | 831 | { |
@@ -1289,8 +1283,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
1289 | protected virtual InventoryItemBase GetItem(UUID agentID, UUID itemID) | 1283 | protected virtual InventoryItemBase GetItem(UUID agentID, UUID itemID) |
1290 | { | 1284 | { |
1291 | IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>(); | 1285 | IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>(); |
1292 | InventoryItemBase item = new InventoryItemBase(itemID, agentID); | 1286 | InventoryItemBase item = invService.GetItem(agentID, itemID); |
1293 | item = invService.GetItem(item); | ||
1294 | 1287 | ||
1295 | if (item != null && item.CreatorData != null && item.CreatorData != string.Empty) | 1288 | if (item != null && item.CreatorData != null && item.CreatorData != string.Empty) |
1296 | UserManagementModule.AddUser(item.CreatorIdAsUuid, item.CreatorData); | 1289 | UserManagementModule.AddUser(item.CreatorIdAsUuid, item.CreatorData); |