aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-01-10 22:38:48 +0000
committerJustin Clark-Casey (justincc)2013-01-10 22:38:48 +0000
commit701ca1e4b8b3d54e1e93baf54aada3867d403075 (patch)
treefb3e2cfac51f3400e93fe581286716aaa7c1e00f /OpenSim/Region/Framework/Scenes
parentOn baked texture save, replace any HG ID with an ordinary asset ID so the HGA... (diff)
downloadopensim-SC_OLD-701ca1e4b8b3d54e1e93baf54aada3867d403075.zip
opensim-SC_OLD-701ca1e4b8b3d54e1e93baf54aada3867d403075.tar.gz
opensim-SC_OLD-701ca1e4b8b3d54e1e93baf54aada3867d403075.tar.bz2
opensim-SC_OLD-701ca1e4b8b3d54e1e93baf54aada3867d403075.tar.xz
Add "debug scene pbackup true|false" console command. This enables or disable periodic scene backup. For debug purposes.
If false, scene is still saved on shutdown.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs39
1 files changed, 30 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 11b63b7..d0a2115 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -77,6 +77,23 @@ namespace OpenSim.Region.Framework.Scenes
77 /// </summary> 77 /// </summary>
78 public bool DebugUpdates { get; private set; } 78 public bool DebugUpdates { get; private set; }
79 79
80 /// <summary>
81 /// If true then the scene is saved to persistent storage periodically, every m_update_backup frames and
82 /// if objects meet required conditions (m_dontPersistBefore and m_dontPersistAfter).
83 /// </summary>
84 /// <remarks>
85 /// Even if false, the scene will still be saved on clean shutdown.
86 /// FIXME: Currently, setting this to false will mean that objects are not periodically returned from parcels.
87 /// This needs to be fixed.
88 /// </remarks>
89 public bool PeriodicBackup { get; private set; }
90
91 /// <summary>
92 /// If false then the scene is never saved to persistence storage even if PeriodicBackup == true and even
93 /// if the scene is being shut down for the final time.
94 /// </summary>
95 public bool UseBackup { get; private set; }
96
80 public SynchronizeSceneHandler SynchronizeScene; 97 public SynchronizeSceneHandler SynchronizeScene;
81 98
82 /// <summary> 99 /// <summary>
@@ -341,7 +358,6 @@ namespace OpenSim.Region.Framework.Scenes
341 358
342 private Timer m_mapGenerationTimer = new Timer(); 359 private Timer m_mapGenerationTimer = new Timer();
343 private bool m_generateMaptiles; 360 private bool m_generateMaptiles;
344 private bool m_useBackup = true;
345 361
346 #endregion Fields 362 #endregion Fields
347 363
@@ -594,11 +610,6 @@ namespace OpenSim.Region.Framework.Scenes
594 get { return m_authenticateHandler; } 610 get { return m_authenticateHandler; }
595 } 611 }
596 612
597 public bool UseBackup
598 {
599 get { return m_useBackup; }
600 }
601
602 // an instance to the physics plugin's Scene object. 613 // an instance to the physics plugin's Scene object.
603 public PhysicsScene PhysicsScene 614 public PhysicsScene PhysicsScene
604 { 615 {
@@ -768,8 +779,8 @@ namespace OpenSim.Region.Framework.Scenes
768 StartDisabled = startupConfig.GetBoolean("StartDisabled", false); 779 StartDisabled = startupConfig.GetBoolean("StartDisabled", false);
769 780
770 m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance", m_defaultDrawDistance); 781 m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance", m_defaultDrawDistance);
771 m_useBackup = startupConfig.GetBoolean("UseSceneBackup", m_useBackup); 782 UseBackup = startupConfig.GetBoolean("UseSceneBackup", UseBackup);
772 if (!m_useBackup) 783 if (!UseBackup)
773 m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName); 784 m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName);
774 785
775 //Animation states 786 //Animation states
@@ -937,6 +948,8 @@ namespace OpenSim.Region.Framework.Scenes
937 { 948 {
938 PhysicalPrims = true; 949 PhysicalPrims = true;
939 CollidablePrims = true; 950 CollidablePrims = true;
951 PeriodicBackup = true;
952 UseBackup = true;
940 953
941 BordersLocked = true; 954 BordersLocked = true;
942 Border northBorder = new Border(); 955 Border northBorder = new Border();
@@ -1189,6 +1202,14 @@ namespace OpenSim.Region.Framework.Scenes
1189 Active = active; 1202 Active = active;
1190 } 1203 }
1191 1204
1205 if (options.ContainsKey("pbackup"))
1206 {
1207 bool active;
1208
1209 if (bool.TryParse(options["pbackup"], out active))
1210 PeriodicBackup = active;
1211 }
1212
1192 if (options.ContainsKey("scripting")) 1213 if (options.ContainsKey("scripting"))
1193 { 1214 {
1194 bool enableScripts = true; 1215 bool enableScripts = true;
@@ -1570,7 +1591,7 @@ namespace OpenSim.Region.Framework.Scenes
1570 eventMS = Util.EnvironmentTickCountSubtract(tmpMS); 1591 eventMS = Util.EnvironmentTickCountSubtract(tmpMS);
1571 } 1592 }
1572 1593
1573 if (Frame % m_update_backup == 0) 1594 if (PeriodicBackup && Frame % m_update_backup == 0)
1574 { 1595 {
1575 tmpMS = Util.EnvironmentTickCount(); 1596 tmpMS = Util.EnvironmentTickCount();
1576 UpdateStorageBackup(); 1597 UpdateStorageBackup();