diff options
Diffstat (limited to '')
5 files changed, 77 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index fd62535..e04317b 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -111,6 +111,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
111 | 111 | ||
112 | public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; | 112 | public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; |
113 | 113 | ||
114 | public delegate void SceneShuttingDownDelegate(Scene scene); | ||
115 | |||
116 | public event SceneShuttingDownDelegate OnSceneShuttingDown; | ||
117 | |||
114 | /// <summary> | 118 | /// <summary> |
115 | /// Fired when an object is touched/grabbed. | 119 | /// Fired when an object is touched/grabbed. |
116 | /// </summary> | 120 | /// </summary> |
@@ -2193,5 +2197,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
2193 | } | 2197 | } |
2194 | } | 2198 | } |
2195 | } | 2199 | } |
2200 | |||
2201 | public void TriggerSceneShuttingDown(Scene s) | ||
2202 | { | ||
2203 | SceneShuttingDownDelegate handler = OnSceneShuttingDown; | ||
2204 | if (handler != null) | ||
2205 | { | ||
2206 | foreach (SceneShuttingDownDelegate d in handler.GetInvocationList()) | ||
2207 | { | ||
2208 | try | ||
2209 | { | ||
2210 | d(s); | ||
2211 | } | ||
2212 | catch (Exception e) | ||
2213 | { | ||
2214 | m_log.ErrorFormat( | ||
2215 | "[EVENT MANAGER]: Delegate for TriggerSceneShuttingDown failed - continuing. {0} {1}", | ||
2216 | e.Message, e.StackTrace); | ||
2217 | } | ||
2218 | } | ||
2219 | } | ||
2220 | } | ||
2196 | } | 2221 | } |
2197 | } | 2222 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index b9690fe..4aae13c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -204,6 +204,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
204 | 204 | ||
205 | private Timer m_mapGenerationTimer = new Timer(); | 205 | private Timer m_mapGenerationTimer = new Timer(); |
206 | private bool m_generateMaptiles; | 206 | private bool m_generateMaptiles; |
207 | private bool m_useBackup = true; | ||
207 | 208 | ||
208 | // private Dictionary<UUID, string[]> m_UserNamesCache = new Dictionary<UUID, string[]>(); | 209 | // private Dictionary<UUID, string[]> m_UserNamesCache = new Dictionary<UUID, string[]>(); |
209 | 210 | ||
@@ -459,6 +460,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
459 | get { return m_sceneGraph; } | 460 | get { return m_sceneGraph; } |
460 | } | 461 | } |
461 | 462 | ||
463 | public bool UseBackup | ||
464 | { | ||
465 | get { return m_useBackup; } | ||
466 | } | ||
467 | |||
462 | // an instance to the physics plugin's Scene object. | 468 | // an instance to the physics plugin's Scene object. |
463 | public PhysicsScene PhysicsScene | 469 | public PhysicsScene PhysicsScene |
464 | { | 470 | { |
@@ -647,6 +653,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
647 | IConfig startupConfig = m_config.Configs["Startup"]; | 653 | IConfig startupConfig = m_config.Configs["Startup"]; |
648 | 654 | ||
649 | m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance); | 655 | m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance); |
656 | m_useBackup = startupConfig.GetBoolean("UseSceneBackup", m_useBackup); | ||
657 | if (!m_useBackup) | ||
658 | m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName); | ||
650 | 659 | ||
651 | //Animation states | 660 | //Animation states |
652 | m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); | 661 | m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); |
@@ -1064,6 +1073,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1064 | shuttingdown = true; | 1073 | shuttingdown = true; |
1065 | 1074 | ||
1066 | m_log.Debug("[SCENE]: Persisting changed objects"); | 1075 | m_log.Debug("[SCENE]: Persisting changed objects"); |
1076 | EventManager.TriggerSceneShuttingDown(this); | ||
1077 | |||
1067 | EntityBase[] entities = GetEntities(); | 1078 | EntityBase[] entities = GetEntities(); |
1068 | foreach (EntityBase entity in entities) | 1079 | foreach (EntityBase entity in entities) |
1069 | { | 1080 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 19a9506..9b9374b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1335,7 +1335,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1335 | } | 1335 | } |
1336 | } | 1336 | } |
1337 | 1337 | ||
1338 | if (HasGroupChanged) | 1338 | if (m_scene.UseBackup && HasGroupChanged) |
1339 | { | 1339 | { |
1340 | // don't backup while it's selected or you're asking for changes mid stream. | 1340 | // don't backup while it's selected or you're asking for changes mid stream. |
1341 | if (isTimeToPersist() || forcedBackup) | 1341 | if (isTimeToPersist() || forcedBackup) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8a8a699..331abb2 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -144,11 +144,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
144 | 144 | ||
145 | public Vector3 StatusSandboxPos; | 145 | public Vector3 StatusSandboxPos; |
146 | 146 | ||
147 | // TODO: This needs to be persisted in next XML version update! | 147 | [XmlIgnore] |
148 | 148 | public int[] PayPrice = {-2,-2,-2,-2,-2}; | |
149 | public readonly int[] PayPrice = {-2,-2,-2,-2,-2}; | 149 | |
150 | 150 | [XmlIgnore] | |
151 | |||
152 | public PhysicsActor PhysActor | 151 | public PhysicsActor PhysActor |
153 | { | 152 | { |
154 | get { return m_physActor; } | 153 | get { return m_physActor; } |
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index bb8a83a..872816c 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -341,6 +341,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
341 | m_SOPXmlProcessors.Add("MediaUrl", ProcessMediaUrl); | 341 | m_SOPXmlProcessors.Add("MediaUrl", ProcessMediaUrl); |
342 | m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation); | 342 | m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation); |
343 | m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem); | 343 | m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem); |
344 | m_SOPXmlProcessors.Add("PayPrice0", ProcessPayPrice0); | ||
345 | m_SOPXmlProcessors.Add("PayPrice1", ProcessPayPrice1); | ||
346 | m_SOPXmlProcessors.Add("PayPrice2", ProcessPayPrice2); | ||
347 | m_SOPXmlProcessors.Add("PayPrice3", ProcessPayPrice3); | ||
348 | m_SOPXmlProcessors.Add("PayPrice4", ProcessPayPrice4); | ||
344 | #endregion | 349 | #endregion |
345 | 350 | ||
346 | #region TaskInventoryXmlProcessors initialization | 351 | #region TaskInventoryXmlProcessors initialization |
@@ -698,6 +703,32 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
698 | { | 703 | { |
699 | obj.ParticleSystem = Convert.FromBase64String(reader.ReadElementContentAsString("ParticleSystem", String.Empty)); | 704 | obj.ParticleSystem = Convert.FromBase64String(reader.ReadElementContentAsString("ParticleSystem", String.Empty)); |
700 | } | 705 | } |
706 | |||
707 | private static void ProcessPayPrice0(SceneObjectPart obj, XmlTextReader reader) | ||
708 | { | ||
709 | obj.PayPrice[0] = (int)reader.ReadElementContentAsInt("PayPrice0", String.Empty); | ||
710 | } | ||
711 | |||
712 | private static void ProcessPayPrice1(SceneObjectPart obj, XmlTextReader reader) | ||
713 | { | ||
714 | obj.PayPrice[1] = (int)reader.ReadElementContentAsInt("PayPrice1", String.Empty); | ||
715 | } | ||
716 | |||
717 | private static void ProcessPayPrice2(SceneObjectPart obj, XmlTextReader reader) | ||
718 | { | ||
719 | obj.PayPrice[2] = (int)reader.ReadElementContentAsInt("PayPrice2", String.Empty); | ||
720 | } | ||
721 | |||
722 | private static void ProcessPayPrice3(SceneObjectPart obj, XmlTextReader reader) | ||
723 | { | ||
724 | obj.PayPrice[3] = (int)reader.ReadElementContentAsInt("PayPrice3", String.Empty); | ||
725 | } | ||
726 | |||
727 | private static void ProcessPayPrice4(SceneObjectPart obj, XmlTextReader reader) | ||
728 | { | ||
729 | obj.PayPrice[4] = (int)reader.ReadElementContentAsInt("PayPrice4", String.Empty); | ||
730 | } | ||
731 | |||
701 | #endregion | 732 | #endregion |
702 | 733 | ||
703 | #region TaskInventoryXmlProcessors | 734 | #region TaskInventoryXmlProcessors |
@@ -1069,7 +1100,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1069 | shp.Media = PrimitiveBaseShape.MediaList.FromXml(value); | 1100 | shp.Media = PrimitiveBaseShape.MediaList.FromXml(value); |
1070 | } | 1101 | } |
1071 | 1102 | ||
1072 | |||
1073 | #endregion | 1103 | #endregion |
1074 | 1104 | ||
1075 | ////////// Write ///////// | 1105 | ////////// Write ///////// |
@@ -1175,6 +1205,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1175 | writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString()); | 1205 | writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString()); |
1176 | WriteBytes(writer, "TextureAnimation", sop.TextureAnimation); | 1206 | WriteBytes(writer, "TextureAnimation", sop.TextureAnimation); |
1177 | WriteBytes(writer, "ParticleSystem", sop.ParticleSystem); | 1207 | WriteBytes(writer, "ParticleSystem", sop.ParticleSystem); |
1208 | writer.WriteElementString("PayPrice0", sop.PayPrice[0].ToString()); | ||
1209 | writer.WriteElementString("PayPrice1", sop.PayPrice[1].ToString()); | ||
1210 | writer.WriteElementString("PayPrice2", sop.PayPrice[2].ToString()); | ||
1211 | writer.WriteElementString("PayPrice3", sop.PayPrice[3].ToString()); | ||
1212 | writer.WriteElementString("PayPrice4", sop.PayPrice[4].ToString()); | ||
1178 | 1213 | ||
1179 | writer.WriteEndElement(); | 1214 | writer.WriteEndElement(); |
1180 | } | 1215 | } |