aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs25
-rw-r--r--OpenSim/Region/Framework/Interfaces/IScriptModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs25
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs37
7 files changed, 98 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs
index d8229de..3fafc47 100644
--- a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs
@@ -52,31 +52,44 @@ namespace OpenSim.Region.Framework.Interfaces
52 /// <summary> 52 /// <summary>
53 /// Archive the region to the given path 53 /// Archive the region to the given path
54 /// </summary> 54 /// </summary>
55 /// 55 /// <remarks>
56 /// This method occurs asynchronously. If you want notification of when it has completed then subscribe to 56 /// This method occurs asynchronously. If you want notification of when it has completed then subscribe to
57 /// the EventManager.OnOarFileSaved event. 57 /// the EventManager.OnOarFileSaved event.
58 /// 58 /// </remarks>
59 /// <param name="savePath"></param> 59 /// <param name="savePath"></param>
60 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param> 60 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
61 /// <param name="options">Options for the save</param>
61 void ArchiveRegion(string savePath, Guid requestId, Dictionary<string, object> options); 62 void ArchiveRegion(string savePath, Guid requestId, Dictionary<string, object> options);
62 63
63 /// <summary> 64 /// <summary>
64 /// Archive the region to a stream. 65 /// Archive the region to a stream.
65 /// </summary> 66 /// </summary>
66 /// 67 /// <remarks>
67 /// This method occurs asynchronously. If you want notification of when it has completed then subscribe to 68 /// This method occurs asynchronously. If you want notification of when it has completed then subscribe to
68 /// the EventManager.OnOarFileSaved event. 69 /// the EventManager.OnOarFileSaved event.
69 /// 70 /// </remarks>
70 /// <param name="saveStream"></param> 71 /// <param name="saveStream"></param>
71 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param> 72 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
72 void ArchiveRegion(Stream saveStream, Guid requestId); 73 void ArchiveRegion(Stream saveStream, Guid requestId);
73 74
74 /// <summary> 75 /// <summary>
76 /// Archive the region to a stream.
77 /// </summary>
78 /// <remarks>
79 /// This method occurs asynchronously. If you want notification of when it has completed then subscribe to
80 /// the EventManager.OnOarFileSaved event.
81 /// </remarks>
82 /// <param name="saveStream"></param>
83 /// <param name="requestId">If supplied, this request Id is later returned in the saved event</param>
84 /// <param name="options">Options for the save</param>
85 void ArchiveRegion(Stream saveStream, Guid requestId, Dictionary<string, object> options);
86
87 /// <summary>
75 /// Dearchive the given region archive. This replaces the existing scene. 88 /// Dearchive the given region archive. This replaces the existing scene.
76 /// </summary> 89 /// </summary>
77 /// 90 /// <remarks>
78 /// If you want notification of when it has completed then subscribe to the EventManager.OnOarFileLoaded event. 91 /// If you want notification of when it has completed then subscribe to the EventManager.OnOarFileLoaded event.
79 /// 92 /// </remarks>
80 /// <param name="loadPath"></param> 93 /// <param name="loadPath"></param>
81 void DearchiveRegion(string loadPath); 94 void DearchiveRegion(string loadPath);
82 95
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
index fecdd1b..d9752e6 100644
--- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs
@@ -50,5 +50,7 @@ namespace OpenSim.Region.Framework.Interfaces
50 void ResumeScript(UUID itemID); 50 void ResumeScript(UUID itemID);
51 51
52 ArrayList GetScriptErrors(UUID itemID); 52 ArrayList GetScriptErrors(UUID itemID);
53
54 void SaveAllState();
53 } 55 }
54} 56}
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 }