diff options
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 35 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | 6 |
2 files changed, 20 insertions, 21 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 9d7b44b..5d72af8 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -301,10 +301,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
301 | 301 | ||
302 | // If we're an NPC then skip all the item checks and manipulations since we don't have an | 302 | // If we're an NPC then skip all the item checks and manipulations since we don't have an |
303 | // inventory right now. | 303 | // inventory right now. |
304 | if (sp.PresenceType == PresenceType.Npc) | 304 | RezSingleAttachmentFromInventoryInternal(sp, sp.PresenceType == PresenceType.Npc ? UUID.Zero : attach.ItemID, attach.AssetID, p | (uint)0x80, null); |
305 | RezSingleAttachmentFromInventoryInternal(sp, UUID.Zero, attach.AssetID, p, null, true); | ||
306 | else | ||
307 | RezSingleAttachmentFromInventory(sp, attach.ItemID, p | (uint)0x80, d); | ||
308 | } | 305 | } |
309 | catch (Exception e) | 306 | catch (Exception e) |
310 | { | 307 | { |
@@ -519,26 +516,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
519 | "[ATTACHMENTS MODULE]: RezSingleAttachmentFromInventory to point {0} from item {1} for {2} in {3}", | 516 | "[ATTACHMENTS MODULE]: RezSingleAttachmentFromInventory to point {0} from item {1} for {2} in {3}", |
520 | (AttachmentPoint)AttachmentPt, itemID, sp.Name, m_scene.Name); | 517 | (AttachmentPoint)AttachmentPt, itemID, sp.Name, m_scene.Name); |
521 | 518 | ||
522 | bool append = (AttachmentPt & 0x80) != 0; | 519 | // We check the attachments in the avatar appearance here rather than the objects attached to the |
523 | AttachmentPt &= 0x7f; | 520 | // ScenePresence itself so that we can ignore calls by viewer 2/3 to attach objects on startup. We are |
524 | 521 | // already doing this in ScenePresence.MakeRootAgent(). Simulator-side attaching needs to be done | |
525 | // Viewer 2/3 sometimes asks to re-wear items that are already worn (and show up in it's inventory as such). | 522 | // because pre-outfit folder viewers (most version 1 viewers) require it. |
526 | // This often happens during login - not sure the exact reason. | ||
527 | // For now, we will ignore the request. Unfortunately, this means that we need to dig through all the | ||
528 | // ScenePresence attachments. We can't use the data in AvatarAppearance because that's present at login | ||
529 | // before anything has actually been attached. | ||
530 | bool alreadyOn = false; | 523 | bool alreadyOn = false; |
531 | List<SceneObjectGroup> existingAttachments = sp.GetAttachments(); | 524 | List<AvatarAttachment> existingAttachments = sp.Appearance.GetAttachments(); |
532 | foreach (SceneObjectGroup so in existingAttachments) | 525 | foreach (AvatarAttachment existingAttachment in existingAttachments) |
533 | { | 526 | { |
534 | if (so.FromItemID == itemID) | 527 | if (existingAttachment.ItemID == itemID) |
535 | { | 528 | { |
536 | alreadyOn = true; | 529 | alreadyOn = true; |
537 | break; | 530 | break; |
538 | } | 531 | } |
539 | } | 532 | } |
540 | 533 | ||
541 | // if (sp.Appearance.GetAttachmentForItem(itemID) != null) | ||
542 | if (alreadyOn) | 534 | if (alreadyOn) |
543 | { | 535 | { |
544 | if (DebugLevel > 0) | 536 | if (DebugLevel > 0) |
@@ -549,7 +541,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
549 | return null; | 541 | return null; |
550 | } | 542 | } |
551 | 543 | ||
552 | return RezSingleAttachmentFromInventoryInternal(sp, itemID, UUID.Zero, AttachmentPt, doc, append); | 544 | return RezSingleAttachmentFromInventoryInternal(sp, itemID, UUID.Zero, AttachmentPt, doc); |
553 | } | 545 | } |
554 | 546 | ||
555 | public void RezMultipleAttachmentsFromInventory(IScenePresence sp, List<KeyValuePair<UUID, uint>> rezlist) | 547 | public void RezMultipleAttachmentsFromInventory(IScenePresence sp, List<KeyValuePair<UUID, uint>> rezlist) |
@@ -558,7 +550,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
558 | return; | 550 | return; |
559 | 551 | ||
560 | if (DebugLevel > 0) | 552 | if (DebugLevel > 0) |
561 | m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing multiple attachments from inventory for {0}", sp.Name); | 553 | m_log.DebugFormat( |
554 | "[ATTACHMENTS MODULE]: Rezzing {0} attachments from inventory for {1} in {2}", | ||
555 | rezlist.Count, sp.Name, m_scene.Name); | ||
562 | 556 | ||
563 | foreach (KeyValuePair<UUID, uint> rez in rezlist) | 557 | foreach (KeyValuePair<UUID, uint> rez in rezlist) |
564 | { | 558 | { |
@@ -957,11 +951,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
957 | } | 951 | } |
958 | 952 | ||
959 | protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal( | 953 | protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal( |
960 | IScenePresence sp, UUID itemID, UUID assetID, uint attachmentPt, XmlDocument doc, bool append) | 954 | IScenePresence sp, UUID itemID, UUID assetID, uint attachmentPt, XmlDocument doc) |
961 | { | 955 | { |
962 | if (m_invAccessModule == null) | 956 | if (m_invAccessModule == null) |
963 | return null; | 957 | return null; |
964 | 958 | ||
959 | bool append = (attachmentPt & 0x80) != 0; | ||
960 | attachmentPt &= 0x7f; | ||
961 | |||
965 | SceneObjectGroup objatt; | 962 | SceneObjectGroup objatt; |
966 | 963 | ||
967 | if (itemID != UUID.Zero) | 964 | if (itemID != UUID.Zero) |
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index cfe5538..1a38619 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | |||
@@ -130,7 +130,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
130 | config.AddConfig("Modules"); | 130 | config.AddConfig("Modules"); |
131 | config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); | 131 | config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule"); |
132 | 132 | ||
133 | modules.Add(new AttachmentsModule()); | 133 | AttachmentsModule attMod = new AttachmentsModule(); |
134 | attMod.DebugLevel = 1; | ||
135 | modules.Add(attMod); | ||
134 | modules.Add(new BasicInventoryAccessModule()); | 136 | modules.Add(new BasicInventoryAccessModule()); |
135 | } | 137 | } |
136 | 138 | ||
@@ -728,7 +730,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
728 | public void TestRezAttachmentsOnAvatarEntrance() | 730 | public void TestRezAttachmentsOnAvatarEntrance() |
729 | { | 731 | { |
730 | TestHelpers.InMethod(); | 732 | TestHelpers.InMethod(); |
731 | // log4net.Config.XmlConfigurator.Configure(); | 733 | // TestHelpers.EnableLogging(); |
732 | 734 | ||
733 | Scene scene = CreateTestScene(); | 735 | Scene scene = CreateTestScene(); |
734 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1); | 736 | UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1); |