diff options
author | Teravus Ovares (Dan Olivares) | 2009-08-19 14:43:18 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-08-19 14:43:18 -0400 |
commit | 289439c8329d992251769aa83e3d7809f651de26 (patch) | |
tree | 8a1e596190f197fa5f70f21a8c968d2c55004cde /OpenSim/Region/CoreModules | |
parent | Add Border (a virtual border management class) (diff) | |
parent | Added MoveItems, which is most useful upon viewer-delete inventory operation.... (diff) | |
download | opensim-SC-289439c8329d992251769aa83e3d7809f651de26.zip opensim-SC-289439c8329d992251769aa83e3d7809f651de26.tar.gz opensim-SC-289439c8329d992251769aa83e3d7809f651de26.tar.bz2 opensim-SC-289439c8329d992251769aa83e3d7809f651de26.tar.xz |
Merge branch 'master' of ssh://MyConnection/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules')
8 files changed, 92 insertions, 37 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 582beee..35c59aa 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -130,7 +130,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
130 | } | 130 | } |
131 | else | 131 | else |
132 | { | 132 | { |
133 | InventoryItemBase baseItem = invService.GetItem(new InventoryItemBase(appearance.Wearables[i].ItemID)); | 133 | InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i].ItemID, userID); |
134 | baseItem = invService.GetItem(baseItem); | ||
134 | 135 | ||
135 | if (baseItem != null) | 136 | if (baseItem != null) |
136 | { | 137 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs index a68db1b..ff12361 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gestures/GesturesModule.cs | |||
@@ -65,7 +65,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
65 | { | 65 | { |
66 | IInventoryService invService = m_scene.InventoryService; | 66 | IInventoryService invService = m_scene.InventoryService; |
67 | 67 | ||
68 | InventoryItemBase item = invService.GetItem(new InventoryItemBase(gestureId)); | 68 | InventoryItemBase item = new InventoryItemBase(gestureId, client.AgentId); |
69 | item = invService.GetItem(item); | ||
69 | if (item != null) | 70 | if (item != null) |
70 | { | 71 | { |
71 | item.Flags = 1; | 72 | item.Flags = 1; |
@@ -80,7 +81,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gestures | |||
80 | { | 81 | { |
81 | IInventoryService invService = m_scene.InventoryService; | 82 | IInventoryService invService = m_scene.InventoryService; |
82 | 83 | ||
83 | InventoryItemBase item = invService.GetItem(new InventoryItemBase(gestureId)); | 84 | InventoryItemBase item = new InventoryItemBase(gestureId, client.AgentId); |
85 | item = invService.GetItem(item); | ||
84 | if (item != null) | 86 | if (item != null) |
85 | { | 87 | { |
86 | item.Flags = 0; | 88 | item.Flags = 0; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 5315c11..5afbf68 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs | |||
@@ -257,8 +257,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
257 | invService.GetFolderForType(client.AgentId, AssetType.TrashFolder); | 257 | invService.GetFolderForType(client.AgentId, AssetType.TrashFolder); |
258 | 258 | ||
259 | UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip | 259 | UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip |
260 | 260 | ||
261 | InventoryItemBase item = invService.GetItem(new InventoryItemBase(inventoryEntityID)); | 261 | InventoryItemBase item = new InventoryItemBase(inventoryEntityID, client.AgentId); |
262 | item = invService.GetItem(item); | ||
262 | InventoryFolderBase folder = null; | 263 | InventoryFolderBase folder = null; |
263 | 264 | ||
264 | if (item != null && trashFolder != null) | 265 | if (item != null && trashFolder != null) |
@@ -266,12 +267,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
266 | item.Folder = trashFolder.ID; | 267 | item.Folder = trashFolder.ID; |
267 | 268 | ||
268 | // Diva comment: can't we just update this item??? | 269 | // Diva comment: can't we just update this item??? |
269 | invService.DeleteItem(item); | 270 | List<UUID> uuids = new List<UUID>(); |
271 | uuids.Add(item.ID); | ||
272 | invService.DeleteItems(item.Owner, uuids); | ||
270 | scene.AddInventoryItem(client, item); | 273 | scene.AddInventoryItem(client, item); |
271 | } | 274 | } |
272 | else | 275 | else |
273 | { | 276 | { |
274 | folder = invService.GetFolder(new InventoryFolderBase(inventoryEntityID)); | 277 | folder = new InventoryFolderBase(inventoryEntityID, client.AgentId); |
278 | folder = invService.GetFolder(folder); | ||
275 | 279 | ||
276 | if (folder != null & trashFolder != null) | 280 | if (folder != null & trashFolder != null) |
277 | { | 281 | { |
@@ -451,10 +455,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer | |||
451 | else | 455 | else |
452 | { | 456 | { |
453 | UUID itemID = new UUID(msg.binaryBucket, 1); | 457 | UUID itemID = new UUID(msg.binaryBucket, 1); |
454 | InventoryItemBase item = new InventoryItemBase(); | 458 | InventoryItemBase item = new InventoryItemBase(itemID, user.ControllingClient.AgentId); |
455 | |||
456 | item.ID = itemID; | ||
457 | item.Owner = user.ControllingClient.AgentId; | ||
458 | 459 | ||
459 | // Fetch from service | 460 | // Fetch from service |
460 | // | 461 | // |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs index ef5ffe1..d4cb616 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs | |||
@@ -181,12 +181,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
181 | /// <returns>true if the item was successfully updated</returns> | 181 | /// <returns>true if the item was successfully updated</returns> |
182 | public abstract bool UpdateItem(InventoryItemBase item); | 182 | public abstract bool UpdateItem(InventoryItemBase item); |
183 | 183 | ||
184 | public abstract bool MoveItems(UUID ownerID, List<InventoryItemBase> items); | ||
185 | |||
184 | /// <summary> | 186 | /// <summary> |
185 | /// Delete an item from the user's inventory | 187 | /// Delete an item from the user's inventory |
186 | /// </summary> | 188 | /// </summary> |
187 | /// <param name="item"></param> | 189 | /// <param name="item"></param> |
188 | /// <returns>true if the item was successfully deleted</returns> | 190 | /// <returns>true if the item was successfully deleted</returns> |
189 | public abstract bool DeleteItem(InventoryItemBase item); | 191 | public abstract bool DeleteItems(UUID ownerID, List<UUID> itemIDs); |
190 | 192 | ||
191 | public abstract InventoryItemBase GetItem(InventoryItemBase item); | 193 | public abstract InventoryItemBase GetItem(InventoryItemBase item); |
192 | 194 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index dd451ef..787c6c8 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -290,7 +290,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
290 | 290 | ||
291 | public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 291 | public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
292 | { | 292 | { |
293 | return new List<InventoryItemBase>(); | 293 | if (IsLocalGridUser(userID)) |
294 | return m_GridService.GetFolderItems(userID, folderID); | ||
295 | else | ||
296 | { | ||
297 | UUID sessionID = GetSessionID(userID); | ||
298 | string uri = GetUserInventoryURI(userID) + "/" + userID; | ||
299 | return m_HGService.GetFolderItems(uri, folderID, sessionID); | ||
300 | } | ||
294 | } | 301 | } |
295 | 302 | ||
296 | public override bool AddFolder(InventoryFolderBase folder) | 303 | public override bool AddFolder(InventoryFolderBase folder) |
@@ -386,18 +393,39 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
386 | } | 393 | } |
387 | } | 394 | } |
388 | 395 | ||
389 | public override bool DeleteItem(InventoryItemBase item) | 396 | public override bool MoveItems(UUID ownerID, List<InventoryItemBase> items) |
390 | { | 397 | { |
391 | if (item == null) | 398 | if (items == null) |
392 | return false; | 399 | return false; |
400 | if (items.Count == 0) | ||
401 | return true; | ||
393 | 402 | ||
394 | if (IsLocalGridUser(item.Owner)) | 403 | if (IsLocalGridUser(ownerID)) |
395 | return m_GridService.DeleteItem(item); | 404 | return m_GridService.MoveItems(ownerID, items); |
396 | else | 405 | else |
397 | { | 406 | { |
398 | UUID sessionID = GetSessionID(item.Owner); | 407 | UUID sessionID = GetSessionID(ownerID); |
399 | string uri = GetUserInventoryURI(item.Owner) + "/" + item.Owner.ToString(); | 408 | string uri = GetUserInventoryURI(ownerID) + "/" + ownerID.ToString(); |
400 | return m_HGService.DeleteItem(uri, item, sessionID); | 409 | return m_HGService.MoveItems(uri, items, sessionID); |
410 | } | ||
411 | } | ||
412 | |||
413 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) | ||
414 | { | ||
415 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID); | ||
416 | |||
417 | if (itemIDs == null) | ||
418 | return false; | ||
419 | if (itemIDs.Count == 0) | ||
420 | return true; | ||
421 | |||
422 | if (IsLocalGridUser(ownerID)) | ||
423 | return m_GridService.DeleteItems(ownerID, itemIDs); | ||
424 | else | ||
425 | { | ||
426 | UUID sessionID = GetSessionID(ownerID); | ||
427 | string uri = GetUserInventoryURI(ownerID) + "/" + ownerID.ToString(); | ||
428 | return m_HGService.DeleteItems(uri, itemIDs, sessionID); | ||
401 | } | 429 | } |
402 | } | 430 | } |
403 | 431 | ||
@@ -483,12 +511,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
483 | string userInventoryServerURI = HGNetworkServersInfo.ServerURI(uinfo.UserProfile.UserInventoryURI); | 511 | string userInventoryServerURI = HGNetworkServersInfo.ServerURI(uinfo.UserProfile.UserInventoryURI); |
484 | string uri = m_LocalGridInventoryURI.TrimEnd('/'); | 512 | string uri = m_LocalGridInventoryURI.TrimEnd('/'); |
485 | 513 | ||
486 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: IsLocalGridUser, comparing {0} to {1}.", userInventoryServerURI, uri); | ||
487 | |||
488 | if ((userInventoryServerURI == uri) || (userInventoryServerURI == "")) | 514 | if ((userInventoryServerURI == uri) || (userInventoryServerURI == "")) |
489 | { | 515 | { |
490 | return true; | 516 | return true; |
491 | } | 517 | } |
518 | m_log.DebugFormat("[HG INVENTORY CONNECTOR]: user {0} is foreign({1} - {2})", userID, userInventoryServerURI, uri); | ||
492 | return false; | 519 | return false; |
493 | } | 520 | } |
494 | 521 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 2fbc5fe..562c5dd 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -289,14 +289,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
289 | return m_InventoryService.UpdateItem(item); | 289 | return m_InventoryService.UpdateItem(item); |
290 | } | 290 | } |
291 | 291 | ||
292 | |||
293 | public override bool MoveItems(UUID ownerID, List<InventoryItemBase> items) | ||
294 | { | ||
295 | return m_InventoryService.MoveItems(ownerID, items); | ||
296 | } | ||
297 | |||
292 | /// <summary> | 298 | /// <summary> |
293 | /// Delete an item from the user's inventory | 299 | /// Delete an item from the user's inventory |
294 | /// </summary> | 300 | /// </summary> |
295 | /// <param name="item"></param> | 301 | /// <param name="item"></param> |
296 | /// <returns>true if the item was successfully deleted</returns> | 302 | /// <returns>true if the item was successfully deleted</returns> |
297 | public override bool DeleteItem(InventoryItemBase item) | 303 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) |
298 | { | 304 | { |
299 | return m_InventoryService.DeleteItem(item); | 305 | return m_InventoryService.DeleteItems(ownerID, itemIDs); |
300 | } | 306 | } |
301 | 307 | ||
302 | public override InventoryItemBase GetItem(InventoryItemBase item) | 308 | public override InventoryItemBase GetItem(InventoryItemBase item) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index bef716b..201442c 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | |||
@@ -212,7 +212,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
212 | 212 | ||
213 | public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | 213 | public override List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) |
214 | { | 214 | { |
215 | return new List<InventoryItemBase>(); | 215 | UUID sessionID = GetSessionID(userID); |
216 | return m_RemoteConnector.GetFolderItems(userID.ToString(), folderID, sessionID); | ||
216 | } | 217 | } |
217 | 218 | ||
218 | public override bool AddFolder(InventoryFolderBase folder) | 219 | public override bool AddFolder(InventoryFolderBase folder) |
@@ -272,13 +273,25 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
272 | return m_RemoteConnector.UpdateItem(item.Owner.ToString(), item, sessionID); | 273 | return m_RemoteConnector.UpdateItem(item.Owner.ToString(), item, sessionID); |
273 | } | 274 | } |
274 | 275 | ||
275 | public override bool DeleteItem(InventoryItemBase item) | 276 | public override bool MoveItems(UUID ownerID, List<InventoryItemBase> items) |
276 | { | 277 | { |
277 | if (item == null) | 278 | if (items == null) |
278 | return false; | 279 | return false; |
279 | 280 | ||
280 | UUID sessionID = GetSessionID(item.Owner); | 281 | UUID sessionID = GetSessionID(ownerID); |
281 | return m_RemoteConnector.DeleteItem(item.Owner.ToString(), item, sessionID); | 282 | return m_RemoteConnector.MoveItems(ownerID.ToString(), items, sessionID); |
283 | } | ||
284 | |||
285 | |||
286 | public override bool DeleteItems(UUID ownerID, List<UUID> itemIDs) | ||
287 | { | ||
288 | if (itemIDs == null) | ||
289 | return false; | ||
290 | if (itemIDs.Count == 0) | ||
291 | return true; | ||
292 | |||
293 | UUID sessionID = GetSessionID(ownerID); | ||
294 | return m_RemoteConnector.DeleteItems(ownerID.ToString(), itemIDs, sessionID); | ||
282 | } | 295 | } |
283 | 296 | ||
284 | public override InventoryItemBase GetItem(InventoryItemBase item) | 297 | public override InventoryItemBase GetItem(InventoryItemBase item) |
@@ -320,14 +333,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
320 | 333 | ||
321 | private UUID GetSessionID(UUID userID) | 334 | private UUID GetSessionID(UUID userID) |
322 | { | 335 | { |
323 | if (m_Scene == null) | 336 | //if (m_Scene == null) |
324 | { | 337 | //{ |
325 | m_log.Debug("[INVENTORY CONNECTOR]: OOPS! scene is null"); | 338 | // m_log.Debug("[INVENTORY CONNECTOR]: OOPS! scene is null"); |
326 | } | 339 | //} |
327 | 340 | ||
328 | if (m_UserProfileService == null) | 341 | if (m_UserProfileService == null) |
329 | { | 342 | { |
330 | m_log.Debug("[INVENTORY CONNECTOR]: OOPS! UserProfileCacheService is null"); | 343 | //m_log.Debug("[INVENTORY CONNECTOR]: OOPS! UserProfileCacheService is null"); |
331 | return UUID.Zero; | 344 | return UUID.Zero; |
332 | } | 345 | } |
333 | 346 | ||
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 9c71b41..f360577 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -966,7 +966,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
966 | if (objectID == UUID.Zero) // User inventory | 966 | if (objectID == UUID.Zero) // User inventory |
967 | { | 967 | { |
968 | IInventoryService invService = m_scene.InventoryService; | 968 | IInventoryService invService = m_scene.InventoryService; |
969 | InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(notecard)); | 969 | InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user); |
970 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
970 | if (assetRequestItem == null) // Library item | 971 | if (assetRequestItem == null) // Library item |
971 | { | 972 | { |
972 | assetRequestItem = scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); | 973 | assetRequestItem = scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); |
@@ -1385,7 +1386,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1385 | if (objectID == UUID.Zero) // User inventory | 1386 | if (objectID == UUID.Zero) // User inventory |
1386 | { | 1387 | { |
1387 | IInventoryService invService = m_scene.InventoryService; | 1388 | IInventoryService invService = m_scene.InventoryService; |
1388 | InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(script)); | 1389 | InventoryItemBase assetRequestItem = new InventoryItemBase(script, user); |
1390 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
1389 | if (assetRequestItem == null) // Library item | 1391 | if (assetRequestItem == null) // Library item |
1390 | { | 1392 | { |
1391 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(script); | 1393 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(script); |
@@ -1479,7 +1481,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
1479 | if (objectID == UUID.Zero) // User inventory | 1481 | if (objectID == UUID.Zero) // User inventory |
1480 | { | 1482 | { |
1481 | IInventoryService invService = m_scene.InventoryService; | 1483 | IInventoryService invService = m_scene.InventoryService; |
1482 | InventoryItemBase assetRequestItem = invService.GetItem(new InventoryItemBase(notecard)); | 1484 | InventoryItemBase assetRequestItem = new InventoryItemBase(notecard, user); |
1485 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
1483 | if (assetRequestItem == null) // Library item | 1486 | if (assetRequestItem == null) // Library item |
1484 | { | 1487 | { |
1485 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); | 1488 | assetRequestItem = m_scene.CommsManager.UserProfileCacheService.LibraryRoot.FindItem(notecard); |