diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 109 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 74 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 9 |
4 files changed, 124 insertions, 81 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 46777e1..3301536 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -140,7 +140,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
140 | /// <returns></returns> | 140 | /// <returns></returns> |
141 | public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) | 141 | public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) |
142 | { | 142 | { |
143 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 143 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
144 | item = InventoryService.GetItem(item); | ||
144 | 145 | ||
145 | if (item != null) | 146 | if (item != null) |
146 | { | 147 | { |
@@ -178,8 +179,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
178 | else | 179 | else |
179 | { | 180 | { |
180 | m_log.ErrorFormat( | 181 | m_log.ErrorFormat( |
181 | "[AGENT INVENTORY]: Could not resolve user {0} for caps inventory update", | 182 | "[AGENT INVENTORY]: Could not find item {0} for caps inventory update", |
182 | remoteClient.AgentId); | 183 | itemID); |
183 | } | 184 | } |
184 | 185 | ||
185 | return UUID.Zero; | 186 | return UUID.Zero; |
@@ -315,7 +316,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
315 | public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, | 316 | public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, |
316 | UUID itemID, InventoryItemBase itemUpd) | 317 | UUID itemID, InventoryItemBase itemUpd) |
317 | { | 318 | { |
318 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 319 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
320 | item = InventoryService.GetItem(item); | ||
319 | 321 | ||
320 | if (item != null) | 322 | if (item != null) |
321 | { | 323 | { |
@@ -408,7 +410,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
408 | { | 410 | { |
409 | Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); | 411 | Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem"); |
410 | 412 | ||
411 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemId)); | 413 | InventoryItemBase item = new InventoryItemBase(itemId, senderId); |
414 | item = InventoryService.GetItem(item); | ||
412 | 415 | ||
413 | if ((item != null) && (item.Owner == senderId)) | 416 | if ((item != null) && (item.Owner == senderId)) |
414 | { | 417 | { |
@@ -474,7 +477,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
474 | if (!Permissions.BypassPermissions()) | 477 | if (!Permissions.BypassPermissions()) |
475 | { | 478 | { |
476 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 479 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
477 | InventoryService.DeleteItem(new InventoryItemBase(itemId)); | 480 | { |
481 | List<UUID> items = new List<UUID>(); | ||
482 | items.Add(itemId); | ||
483 | InventoryService.DeleteItems(senderId, items); | ||
484 | } | ||
478 | } | 485 | } |
479 | 486 | ||
480 | return itemCopy; | 487 | return itemCopy; |
@@ -558,7 +565,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
558 | 565 | ||
559 | if (item == null) | 566 | if (item == null) |
560 | { | 567 | { |
561 | item = InventoryService.GetItem(new InventoryItemBase(oldItemID)); | 568 | item = new InventoryItemBase(oldItemID, remoteClient.AgentId); |
569 | item = InventoryService.GetItem(item); | ||
562 | 570 | ||
563 | if (item == null) | 571 | if (item == null) |
564 | { | 572 | { |
@@ -630,33 +638,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
630 | /// <param name="itemID"></param> | 638 | /// <param name="itemID"></param> |
631 | /// <param name="length"></param> | 639 | /// <param name="length"></param> |
632 | /// <param name="newName"></param> | 640 | /// <param name="newName"></param> |
633 | public void MoveInventoryItem(IClientAPI remoteClient, UUID folderID, UUID itemID, int length, | 641 | public void MoveInventoryItem(IClientAPI remoteClient, List<InventoryItemBase> items) |
634 | string newName) | ||
635 | { | 642 | { |
636 | m_log.DebugFormat( | 643 | m_log.DebugFormat( |
637 | "[AGENT INVENTORY]: Moving item {0} to {1} for {2}", itemID, folderID, remoteClient.AgentId); | 644 | "[AGENT INVENTORY]: Moving {0} items for user {1}", items.Count, remoteClient.AgentId); |
638 | |||
639 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | ||
640 | |||
641 | if (item != null) | ||
642 | { | ||
643 | if (newName != String.Empty) | ||
644 | { | ||
645 | item.Name = newName; | ||
646 | } | ||
647 | item.Folder = folderID; | ||
648 | |||
649 | // Diva comment: can't we just update? | ||
650 | InventoryService.DeleteItem(item); | ||
651 | |||
652 | AddInventoryItem(remoteClient, item); | ||
653 | } | ||
654 | else | ||
655 | { | ||
656 | m_log.Warn("[AGENT INVENTORY]: Failed to find item " + itemID.ToString()); | ||
657 | 645 | ||
658 | return; | 646 | if (!InventoryService.MoveItems(remoteClient.AgentId, items)) |
659 | } | 647 | m_log.Warn("[AGENT INVENTORY]: Failed to move items for user " + remoteClient.AgentId); |
660 | } | 648 | } |
661 | 649 | ||
662 | /// <summary> | 650 | /// <summary> |
@@ -794,29 +782,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
794 | /// </summary> | 782 | /// </summary> |
795 | /// <param name="remoteClient"></param> | 783 | /// <param name="remoteClient"></param> |
796 | /// <param name="itemID"></param> | 784 | /// <param name="itemID"></param> |
797 | private void RemoveInventoryItem(IClientAPI remoteClient, UUID itemID) | 785 | private void RemoveInventoryItem(IClientAPI remoteClient, List<UUID> itemIDs) |
798 | { | 786 | { |
799 | InventoryService.DeleteItem(new InventoryItemBase(itemID)); | 787 | //m_log.Debug("[SCENE INVENTORY]: user " + remoteClient.AgentId); |
788 | InventoryService.DeleteItems(remoteClient.AgentId, itemIDs); | ||
800 | } | 789 | } |
801 | 790 | ||
802 | /// <summary> | 791 | /// <summary> |
803 | /// Removes an inventory folder. Although there is a packet in the Linden protocol for this, it may be | 792 | /// Removes an inventory folder. This packet is sent when the user |
804 | /// legacy and not currently used (purge folder is used to remove folders from trash instead). | 793 | /// right-clicks a folder that's already in trash and chooses "purge" |
805 | /// </summary> | 794 | /// </summary> |
806 | /// <param name="remoteClient"></param> | 795 | /// <param name="remoteClient"></param> |
807 | /// <param name="folderID"></param> | 796 | /// <param name="folderID"></param> |
808 | private void RemoveInventoryFolder(IClientAPI remoteClient, UUID folderID) | 797 | private void RemoveInventoryFolder(IClientAPI remoteClient, List<UUID> folderIDs) |
809 | { | 798 | { |
810 | // Unclear is this handler is ever called by the Linden client, but it might | 799 | m_log.DebugFormat("[SCENE INVENTORY]: RemoveInventoryFolders count {0}", folderIDs.Count); |
811 | 800 | InventoryService.DeleteFolders(remoteClient.AgentId, folderIDs); | |
812 | InventoryFolderBase folder = new InventoryFolderBase(folderID); | ||
813 | folder.Owner = remoteClient.AgentId; | ||
814 | InventoryFolderBase trash = InventoryService.GetFolderForType(remoteClient.AgentId, AssetType.TrashFolder); | ||
815 | if (trash != null) | ||
816 | { | ||
817 | folder.ParentID = trash.ID; | ||
818 | InventoryService.MoveFolder(folder); | ||
819 | } | ||
820 | } | 801 | } |
821 | 802 | ||
822 | private SceneObjectGroup GetGroupByPrim(uint localID) | 803 | private SceneObjectGroup GetGroupByPrim(uint localID) |
@@ -1224,7 +1205,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1224 | UUID copyID = UUID.Random(); | 1205 | UUID copyID = UUID.Random(); |
1225 | if (itemID != UUID.Zero) | 1206 | if (itemID != UUID.Zero) |
1226 | { | 1207 | { |
1227 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 1208 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
1209 | item = InventoryService.GetItem(item); | ||
1228 | 1210 | ||
1229 | // Try library | 1211 | // Try library |
1230 | if (null == item) | 1212 | if (null == item) |
@@ -1242,7 +1224,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1242 | if (!Permissions.BypassPermissions()) | 1224 | if (!Permissions.BypassPermissions()) |
1243 | { | 1225 | { |
1244 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 1226 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1245 | RemoveInventoryItem(remoteClient, itemID); | 1227 | { |
1228 | List<UUID> uuids = new List<UUID>(); | ||
1229 | uuids.Add(itemID); | ||
1230 | RemoveInventoryItem(remoteClient, uuids); | ||
1231 | } | ||
1246 | } | 1232 | } |
1247 | } | 1233 | } |
1248 | else | 1234 | else |
@@ -1287,7 +1273,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1287 | 1273 | ||
1288 | if (itemID != UUID.Zero) // transferred from an avatar inventory to the prim's inventory | 1274 | if (itemID != UUID.Zero) // transferred from an avatar inventory to the prim's inventory |
1289 | { | 1275 | { |
1290 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 1276 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
1277 | item = InventoryService.GetItem(item); | ||
1291 | 1278 | ||
1292 | // Try library | 1279 | // Try library |
1293 | // XXX clumsy, possibly should be one call | 1280 | // XXX clumsy, possibly should be one call |
@@ -1672,7 +1659,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1672 | 1659 | ||
1673 | if (DeRezAction.SaveToExistingUserInventoryItem == action) | 1660 | if (DeRezAction.SaveToExistingUserInventoryItem == action) |
1674 | { | 1661 | { |
1675 | item = new InventoryItemBase(objectGroup.RootPart.FromUserInventoryItemID); | 1662 | item = new InventoryItemBase(objectGroup.RootPart.FromUserInventoryItemID, userID); |
1676 | item = InventoryService.GetItem(item); | 1663 | item = InventoryService.GetItem(item); |
1677 | 1664 | ||
1678 | //item = userInfo.RootFolder.FindItem( | 1665 | //item = userInfo.RootFolder.FindItem( |
@@ -1834,7 +1821,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1834 | 1821 | ||
1835 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup); | 1822 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup); |
1836 | 1823 | ||
1837 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 1824 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
1825 | item = InventoryService.GetItem(item); | ||
1838 | 1826 | ||
1839 | if (item != null) | 1827 | if (item != null) |
1840 | { | 1828 | { |
@@ -1984,7 +1972,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1984 | BypassRayCast, bRayEndIsIntersection,true,scale, false); | 1972 | BypassRayCast, bRayEndIsIntersection,true,scale, false); |
1985 | 1973 | ||
1986 | // Rez object | 1974 | // Rez object |
1987 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 1975 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
1976 | item = InventoryService.GetItem(item); | ||
1988 | 1977 | ||
1989 | if (item != null) | 1978 | if (item != null) |
1990 | { | 1979 | { |
@@ -2135,7 +2124,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2135 | // copy ones will be lost, so avoid it | 2124 | // copy ones will be lost, so avoid it |
2136 | // | 2125 | // |
2137 | if (!attachment) | 2126 | if (!attachment) |
2138 | InventoryService.DeleteItem(item); | 2127 | { |
2128 | List<UUID> uuids = new List<UUID>(); | ||
2129 | uuids.Add(item.ID); | ||
2130 | InventoryService.DeleteItems(item.Owner, uuids); | ||
2131 | } | ||
2139 | } | 2132 | } |
2140 | } | 2133 | } |
2141 | 2134 | ||
@@ -2309,7 +2302,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2309 | ScenePresence presence; | 2302 | ScenePresence presence; |
2310 | if (TryGetAvatar(remoteClient.AgentId, out presence)) | 2303 | if (TryGetAvatar(remoteClient.AgentId, out presence)) |
2311 | { | 2304 | { |
2312 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID, remoteClient.AgentId)); | 2305 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
2306 | item = InventoryService.GetItem(item); | ||
2313 | 2307 | ||
2314 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); | 2308 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); |
2315 | IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>(); | 2309 | IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>(); |
@@ -2360,7 +2354,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2360 | if (TryGetAvatar(remoteClient.AgentId, out presence)) | 2354 | if (TryGetAvatar(remoteClient.AgentId, out presence)) |
2361 | { | 2355 | { |
2362 | // XXYY!! | 2356 | // XXYY!! |
2363 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 2357 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
2358 | item = InventoryService.GetItem(item); | ||
2364 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); | 2359 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); |
2365 | IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>(); | 2360 | IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>(); |
2366 | if (ava != null) | 2361 | if (ava != null) |
@@ -2393,7 +2388,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2393 | } | 2388 | } |
2394 | part.ParentGroup.DetachToGround(); | 2389 | part.ParentGroup.DetachToGround(); |
2395 | 2390 | ||
2396 | InventoryService.DeleteItem(new InventoryItemBase(inventoryID)); | 2391 | List<UUID> uuids = new List<UUID>(); |
2392 | uuids.Add(inventoryID); | ||
2393 | InventoryService.DeleteItems(remoteClient.AgentId, uuids); | ||
2397 | remoteClient.SendRemoveInventoryItem(inventoryID); | 2394 | remoteClient.SendRemoveInventoryItem(inventoryID); |
2398 | } | 2395 | } |
2399 | SendAttachEvent(part.ParentGroup.LocalId, itemID, UUID.Zero); | 2396 | SendAttachEvent(part.ParentGroup.LocalId, itemID, UUID.Zero); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 2bf4ea8..d3e414f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -25,6 +25,7 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
28 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
29 | using System.Threading; | 30 | using System.Threading; |
30 | using OpenMetaverse; | 31 | using OpenMetaverse; |
@@ -404,7 +405,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
404 | return; | 405 | return; |
405 | } | 406 | } |
406 | 407 | ||
407 | InventoryItemBase item = InventoryService.GetItem(new InventoryItemBase(itemID)); | 408 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
409 | item = InventoryService.GetItem(item); | ||
408 | 410 | ||
409 | if (item != null) | 411 | if (item != null) |
410 | { | 412 | { |
@@ -439,9 +441,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
439 | return; | 441 | return; |
440 | } | 442 | } |
441 | 443 | ||
444 | // We're going to send the reply async, because there may be | ||
445 | // an enormous quantity of packets -- basically the entire inventory! | ||
446 | // We don't want to block the client thread while all that is happening. | ||
447 | SendInventoryDelegate d = SendInventoryAsync; | ||
448 | d.BeginInvoke(remoteClient, folderID, ownerID, fetchFolders, fetchItems, sortOrder, SendInventoryComplete, d); | ||
449 | } | ||
450 | |||
451 | delegate void SendInventoryDelegate(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder); | ||
452 | |||
453 | void SendInventoryAsync(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder) | ||
454 | { | ||
442 | SendInventoryUpdate(remoteClient, new InventoryFolderBase(folderID), fetchFolders, fetchItems); | 455 | SendInventoryUpdate(remoteClient, new InventoryFolderBase(folderID), fetchFolders, fetchItems); |
443 | } | 456 | } |
444 | 457 | ||
458 | void SendInventoryComplete(IAsyncResult iar) | ||
459 | { | ||
460 | } | ||
461 | |||
445 | /// <summary> | 462 | /// <summary> |
446 | /// Handle the caps inventory descendents fetch. | 463 | /// Handle the caps inventory descendents fetch. |
447 | /// | 464 | /// |
@@ -517,27 +534,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
517 | // m_log.DebugFormat( | 534 | // m_log.DebugFormat( |
518 | // "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId); | 535 | // "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId); |
519 | 536 | ||
520 | CachedUserInfo userProfile = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | 537 | InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId); |
521 | 538 | folder = InventoryService.GetFolder(folder); | |
522 | if (null == userProfile) | 539 | if (folder != null) |
523 | { | ||
524 | m_log.ErrorFormat( | ||
525 | "[AGENT INVENTORY]: Could not find user profile for {0} {1}", | ||
526 | remoteClient.Name, remoteClient.AgentId); | ||
527 | return; | ||
528 | } | ||
529 | |||
530 | if (!userProfile.UpdateFolder(name, folderID, type, parentID)) | ||
531 | { | 540 | { |
532 | m_log.ErrorFormat( | 541 | folder.Name = name; |
533 | "[AGENT INVENTORY]: Failed to update folder for user {0} {1}", | 542 | folder.Type = (short)type; |
534 | remoteClient.Name, remoteClient.AgentId); | 543 | folder.ParentID = parentID; |
544 | if (!InventoryService.UpdateFolder(folder)) | ||
545 | { | ||
546 | m_log.ErrorFormat( | ||
547 | "[AGENT INVENTORY]: Failed to update folder for user {0} {1}", | ||
548 | remoteClient.Name, remoteClient.AgentId); | ||
549 | } | ||
535 | } | 550 | } |
536 | } | 551 | } |
537 | 552 | ||
538 | public void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID) | 553 | public void HandleMoveInventoryFolder(IClientAPI remoteClient, UUID folderID, UUID parentID) |
539 | { | 554 | { |
540 | InventoryFolderBase folder = new InventoryFolderBase(folderID); | 555 | InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId); |
541 | folder = InventoryService.GetFolder(folder); | 556 | folder = InventoryService.GetFolder(folder); |
542 | if (folder != null) | 557 | if (folder != null) |
543 | { | 558 | { |
@@ -559,15 +574,34 @@ namespace OpenSim.Region.Framework.Scenes | |||
559 | /// <param name="remoteClient"></param> | 574 | /// <param name="remoteClient"></param> |
560 | /// <param name="folderID"></param> | 575 | /// <param name="folderID"></param> |
561 | 576 | ||
577 | delegate void PurgeFolderDelegate(UUID userID, UUID folder); | ||
578 | |||
562 | public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID) | 579 | public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID) |
563 | { | 580 | { |
564 | InventoryFolderBase folder = new InventoryFolderBase(folderID); | 581 | PurgeFolderDelegate d = PurgeFolderAsync; |
582 | try | ||
583 | { | ||
584 | d.BeginInvoke(remoteClient.AgentId, folderID, PurgeFolderCompleted, d); | ||
585 | } | ||
586 | catch (Exception e) | ||
587 | { | ||
588 | m_log.WarnFormat("[AGENT INVENTORY]: Exception on purge folder for user {0}: {1}", remoteClient.AgentId, e.Message); | ||
589 | } | ||
590 | } | ||
591 | |||
592 | |||
593 | private void PurgeFolderAsync(UUID userID, UUID folderID) | ||
594 | { | ||
595 | InventoryFolderBase folder = new InventoryFolderBase(folderID, userID); | ||
565 | 596 | ||
566 | if (InventoryService.PurgeFolder(folder)) | 597 | if (InventoryService.PurgeFolder(folder)) |
567 | m_log.DebugFormat("[AGENT INVENTORY]: folder {0} purged successfully", folderID); | 598 | m_log.DebugFormat("[AGENT INVENTORY]: folder {0} purged successfully", folderID); |
568 | else | 599 | else |
569 | m_log.WarnFormat("[AGENT INVENTORY]: could not purge folder {0}", folderID); | 600 | m_log.WarnFormat("[AGENT INVENTORY]: could not purge folder {0}", folderID); |
570 | } | 601 | } |
571 | 602 | ||
603 | private void PurgeFolderCompleted(IAsyncResult iar) | ||
604 | { | ||
605 | } | ||
572 | } | 606 | } |
573 | } | 607 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d1f7a4b..6118a70 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2044,9 +2044,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2044 | { | 2044 | { |
2045 | AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); | 2045 | AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); |
2046 | 2046 | ||
2047 | m_log.DebugFormat( | 2047 | m_log.Debug("[Scene] Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName); |
2048 | "[SCENE]: Adding new {0} agent for {1} in {2}", | 2048 | /* |
2049 | ((aCircuit.child == true) ? "child" : "root"), client.Name, RegionInfo.RegionName); | 2049 | string logMsg = string.Format("[SCENE]: Adding new {0} agent for {1} in {2}", |
2050 | ((aCircuit.child == true) ? "child" : "root"), client.Name, | ||
2051 | RegionInfo.RegionName); | ||
2052 | |||
2053 | m_log.Debug(logMsg); | ||
2054 | */ | ||
2050 | 2055 | ||
2051 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); | 2056 | CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); |
2052 | 2057 | ||
@@ -2055,7 +2060,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2055 | // HERE!!! Do the initial attachments right here | 2060 | // HERE!!! Do the initial attachments right here |
2056 | // first agent upon login is a root agent by design. | 2061 | // first agent upon login is a root agent by design. |
2057 | // All other AddNewClient calls find aCircuit.child to be true | 2062 | // All other AddNewClient calls find aCircuit.child to be true |
2058 | if (aCircuit.child == false) | 2063 | if (aCircuit == null || aCircuit.child == false) |
2059 | { | 2064 | { |
2060 | sp.IsChildAgent = false; | 2065 | sp.IsChildAgent = false; |
2061 | sp.RezAttachments(); | 2066 | sp.RezAttachments(); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index ce6f3d6..3ee6007 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | |||
@@ -225,7 +225,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
225 | Assert.That(presence.AbsolutePosition, Is.EqualTo(pos), "Position is not the same one entered"); | 225 | Assert.That(presence.AbsolutePosition, Is.EqualTo(pos), "Position is not the same one entered"); |
226 | } | 226 | } |
227 | 227 | ||
228 | [Test] | 228 | // I'm commenting this test because it does not represent |
229 | // crossings. The Thread.Sleep's in here are not meaningful mocks, | ||
230 | // and they sometimes fail in panda. | ||
231 | // We need to talk in order to develop a test | ||
232 | // that really tests region crossings. There are 3 async components, | ||
233 | // but things are synchronous among them. So there should be | ||
234 | // 3 threads in here. | ||
235 | //[Test] | ||
229 | public void T021_TestCrossToNewRegion() | 236 | public void T021_TestCrossToNewRegion() |
230 | { | 237 | { |
231 | TestHelper.InMethod(); | 238 | TestHelper.InMethod(); |