aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs69
1 files changed, 33 insertions, 36 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 1e9a001..ae19224 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -707,49 +707,46 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
707 /// <param name="agentID"></param> 707 /// <param name="agentID"></param>
708 public void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID) 708 public void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID)
709 { 709 {
710 if (grp != null) 710 if (grp.HasGroupChanged || grp.ContainsScripts())
711 { 711 {
712 if (grp.HasGroupChanged || grp.ContainsScripts()) 712 m_log.DebugFormat(
713 { 713 "[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}",
714 m_log.DebugFormat( 714 grp.UUID, grp.AttachmentPoint);
715 "[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}",
716 grp.UUID, grp.AttachmentPoint);
717 715
718 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp); 716 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp);
719 717
720 InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); 718 InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
721 item = m_scene.InventoryService.GetItem(item); 719 item = m_scene.InventoryService.GetItem(item);
722 720
723 if (item != null) 721 if (item != null)
724 {
725 AssetBase asset = m_scene.CreateAsset(
726 grp.GetPartName(grp.LocalId),
727 grp.GetPartDescription(grp.LocalId),
728 (sbyte)AssetType.Object,
729 Utils.StringToBytes(sceneObjectXml),
730 remoteClient.AgentId);
731 m_scene.AssetService.Store(asset);
732
733 item.AssetID = asset.FullID;
734 item.Description = asset.Description;
735 item.Name = asset.Name;
736 item.AssetType = asset.Type;
737 item.InvType = (int)InventoryType.Object;
738
739 m_scene.InventoryService.UpdateItem(item);
740
741 // this gets called when the agent logs off!
742 if (remoteClient != null)
743 remoteClient.SendInventoryItemCreateUpdate(item, 0);
744 }
745 }
746 else
747 { 722 {
748 m_log.DebugFormat( 723 AssetBase asset = m_scene.CreateAsset(
749 "[ATTACHMENTS MODULE]: Don't need to update asset for unchanged attachment {0}, attachpoint {1}", 724 grp.GetPartName(grp.LocalId),
750 grp.UUID, grp.AttachmentPoint); 725 grp.GetPartDescription(grp.LocalId),
726 (sbyte)AssetType.Object,
727 Utils.StringToBytes(sceneObjectXml),
728 remoteClient.AgentId);
729 m_scene.AssetService.Store(asset);
730
731 item.AssetID = asset.FullID;
732 item.Description = asset.Description;
733 item.Name = asset.Name;
734 item.AssetType = asset.Type;
735 item.InvType = (int)InventoryType.Object;
736
737 m_scene.InventoryService.UpdateItem(item);
738
739 // this gets called when the agent logs off!
740 if (remoteClient != null)
741 remoteClient.SendInventoryItemCreateUpdate(item, 0);
751 } 742 }
752 } 743 }
744 else
745 {
746 m_log.DebugFormat(
747 "[ATTACHMENTS MODULE]: Don't need to update asset for unchanged attachment {0}, attachpoint {1}",
748 grp.UUID, grp.AttachmentPoint);
749 }
753 } 750 }
754 751
755 /// <summary> 752 /// <summary>