From fbd44e628ce5c931918870776a35619dd97c2a7e Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Fri, 19 Dec 2008 18:38:45 +0000 Subject: Reset Expire date for tempOnRez objects on rez. Fixes Mantis#2848 --- OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 3fd3444..c2664b9 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -1089,6 +1089,12 @@ if (m_shape != null) { #region Public Methods + public void ResetExpire() + { + Expires = DateTime.Now + new TimeSpan(600000000); + m_log.DebugFormat("[SOP]: Reset Expire to {0}", Expires); + } + public void AddFlag(PrimFlags flag) { // PrimFlags prevflag = Flags; @@ -1098,7 +1104,7 @@ if (m_shape != null) { _flags |= flag; if (flag == PrimFlags.TemporaryOnRez) - Expires = DateTime.Now + new TimeSpan(600000000); + ResetExpire(); } // System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + Flags.ToString()); } @@ -1459,7 +1465,7 @@ if (m_shape != null) { { return FromXml(UUID.Zero, xmlReader); } - + /// /// Restore this part from the serialized xml representation. /// @@ -1471,9 +1477,12 @@ if (m_shape != null) { XmlSerializer serializer = new XmlSerializer(typeof (SceneObjectPart)); SceneObjectPart part = (SceneObjectPart)serializer.Deserialize(xmlReader); part.m_fromUserInventoryItemID = fromUserInventoryItemId; - + + // for tempOnRez objects, we have to fix the Expire date. + if((part.Flags & PrimFlags.TemporaryOnRez) != 0) part.ResetExpire(); + return part; - } + } public UUID GetAvatarOnSitTarget() { -- cgit v1.1