From b4680f653dbc1c6f712898af79c4ea22bca3f678 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 17 Dec 2008 16:11:03 +0000 Subject: * Implement 'Save Object Back to My Inventory'. On the Linden client this is in the Tools menu available when editing an object * This facility allows you to save changes to an object that you've rezzed into a region back into their original inventory item without having to take a copy of the rezzed object. --- .../Region/Environment/Scenes/SceneObjectPart.cs | 49 +++++++++++++++++++--- 1 file changed, 43 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.cs') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 10a37ee..3547cd4 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -116,30 +116,55 @@ namespace OpenSim.Region.Environment.Scenes // for SL compatibility it should be persisted though (set sound / displaytext / particlesystem, kill script) [XmlIgnore] public UUID Sound; + [XmlIgnore] public byte SoundFlags; + [XmlIgnore] public double SoundGain; + [XmlIgnore] public double SoundRadius; + [XmlIgnore] public uint TimeStampFull = 0; + [XmlIgnore] public uint TimeStampLastActivity = 0; // Will be used for AutoReturn + [XmlIgnore] public uint TimeStampTerse = 0; + [XmlIgnore] public UUID FromAssetID = UUID.Zero; + + /// + /// The UUID of the user inventory item from which this object was rezzed if this is a root part. + /// If UUID.Zero then either this is not a root part or there is no connection with a user inventory item. + /// + private UUID m_fromUserInventoryItemID = UUID.Zero; + + [XmlIgnore] + public UUID FromUserInventoryItemID + { + get { return m_fromUserInventoryItemID; } + } + [XmlIgnore] public bool IsAttachment = false; + [XmlIgnore] public scriptEvents AggregateScriptEvents = 0; + [XmlIgnore] public UUID AttachedAvatar = UUID.Zero; + [XmlIgnore] public Vector3 AttachedPos = Vector3.Zero; + [XmlIgnore] public uint AttachmentPoint = (byte)0; + [XmlIgnore] public PhysicsVector RotationAxis = new PhysicsVector(1f,1f,1f); @@ -1428,15 +1453,27 @@ if (m_shape != null) { /// /// Restore this part from the serialized xml representation. /// + /// /// public static SceneObjectPart FromXml(XmlReader xmlReader) { - // It's not necessary to persist this - - XmlSerializer serializer = new XmlSerializer(typeof (SceneObjectPart)); - SceneObjectPart newobject = (SceneObjectPart) serializer.Deserialize(xmlReader); - return newobject; + return FromXml(UUID.Zero, xmlReader); } + + /// + /// Restore this part from the serialized xml representation. + /// + /// The inventory id from which this part came, if applicable + /// + /// + public static SceneObjectPart FromXml(UUID fromUserInventoryItemId, XmlReader xmlReader) + { + XmlSerializer serializer = new XmlSerializer(typeof (SceneObjectPart)); + SceneObjectPart part = (SceneObjectPart)serializer.Deserialize(xmlReader); + part.m_fromUserInventoryItemID = fromUserInventoryItemId; + + return part; + } public UUID GetAvatarOnSitTarget() { @@ -1603,7 +1640,7 @@ if (m_shape != null) { public void GetProperties(IClientAPI client) { client.SendObjectPropertiesReply( - UUID.Zero, (ulong)_creationDate, _creatorID, UUID.Zero, UUID.Zero, + m_fromUserInventoryItemID, (ulong)_creationDate, _creatorID, UUID.Zero, UUID.Zero, _groupID, (short)InventorySerial, _lastOwnerID, UUID, _ownerID, ParentGroup.RootPart.TouchName, new byte[0], ParentGroup.RootPart.SitName, Name, Description, ParentGroup.RootPart._ownerMask, ParentGroup.RootPart._nextOwnerMask, ParentGroup.RootPart._groupMask, ParentGroup.RootPart._everyoneMask, -- cgit v1.1