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 | |
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')
4 files changed, 11 insertions, 26 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index dfc880a..a9aaf12 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -95,8 +95,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
95 | 95 | ||
96 | foreach (AvatarAttachment att in a.GetAttachments()) | 96 | foreach (AvatarAttachment att in a.GetAttachments()) |
97 | { | 97 | { |
98 | InventoryItemBase item = new InventoryItemBase(att.ItemID, account.PrincipalID); | 98 | InventoryItemBase item = Scene.InventoryService.GetItem(account.PrincipalID, att.ItemID); |
99 | item = Scene.InventoryService.GetItem(item); | ||
100 | if (item != null) | 99 | if (item != null) |
101 | a.SetAttachment(att.AttachPoint, att.ItemID, item.AssetID); | 100 | a.SetAttachment(att.AttachPoint, att.ItemID, item.AssetID); |
102 | else | 101 | else |
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); |
diff --git a/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs b/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs index e1e1838..21e00b2 100644 --- a/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs +++ b/OpenSim/Region/CoreModules/Framework/Library/LocalInventoryService.cs | |||
@@ -103,13 +103,8 @@ namespace OpenSim.Region.CoreModules.Framework.Library | |||
103 | { | 103 | { |
104 | InventoryItemBase[] itemColl = new InventoryItemBase[itemIDs.Length]; | 104 | InventoryItemBase[] itemColl = new InventoryItemBase[itemIDs.Length]; |
105 | int i = 0; | 105 | int i = 0; |
106 | InventoryItemBase item = new InventoryItemBase(); | ||
107 | item.Owner = principalID; | ||
108 | foreach (UUID fid in itemIDs) | 106 | foreach (UUID fid in itemIDs) |
109 | { | 107 | itemColl[i++] = GetItem(principalID, fid); |
110 | item.ID = fid; | ||
111 | itemColl[i++] = GetItem(item); | ||
112 | } | ||
113 | 108 | ||
114 | return itemColl; | 109 | return itemColl; |
115 | } | 110 | } |
@@ -239,14 +234,14 @@ namespace OpenSim.Region.CoreModules.Framework.Library | |||
239 | /// </summary> | 234 | /// </summary> |
240 | /// <param name="item"></param> | 235 | /// <param name="item"></param> |
241 | /// <returns></returns> | 236 | /// <returns></returns> |
242 | public InventoryItemBase GetItem(InventoryItemBase item) { return null; } | 237 | public InventoryItemBase GetItem(UUID principalID, UUID itemID) { return null; } |
243 | 238 | ||
244 | /// <summary> | 239 | /// <summary> |
245 | /// Get a folder, given by its UUID | 240 | /// Get a folder, given by its UUID |
246 | /// </summary> | 241 | /// </summary> |
247 | /// <param name="folder"></param> | 242 | /// <param name="folder"></param> |
248 | /// <returns></returns> | 243 | /// <returns></returns> |
249 | public InventoryFolderBase GetFolder(InventoryFolderBase folder) { return null; } | 244 | public InventoryFolderBase GetFolder(UUID principalID, UUID folderID) { return null; } |
250 | 245 | ||
251 | /// <summary> | 246 | /// <summary> |
252 | /// Does the given user have an inventory structure? | 247 | /// Does the given user have an inventory structure? |