From 069e2d6443b6bae3be970131b9dd327b41bc9f59 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 10 Jan 2013 22:38:48 +0000
Subject: 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.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 39 ++++++++++++++++++++++++--------
1 file changed, 30 insertions(+), 9 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index cca295c..5c3521c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -77,6 +77,23 @@ namespace OpenSim.Region.Framework.Scenes
///
public bool DebugUpdates { get; private set; }
+ ///
+ /// If true then the scene is saved to persistent storage periodically, every m_update_backup frames and
+ /// if objects meet required conditions (m_dontPersistBefore and m_dontPersistAfter).
+ ///
+ ///
+ /// Even if false, the scene will still be saved on clean shutdown.
+ /// FIXME: Currently, setting this to false will mean that objects are not periodically returned from parcels.
+ /// This needs to be fixed.
+ ///
+ public bool PeriodicBackup { get; private set; }
+
+ ///
+ /// If false then the scene is never saved to persistence storage even if PeriodicBackup == true and even
+ /// if the scene is being shut down for the final time.
+ ///
+ public bool UseBackup { get; private set; }
+
public SynchronizeSceneHandler SynchronizeScene;
///
@@ -341,7 +358,6 @@ namespace OpenSim.Region.Framework.Scenes
private Timer m_mapGenerationTimer = new Timer();
private bool m_generateMaptiles;
- private bool m_useBackup = true;
#endregion Fields
@@ -594,11 +610,6 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_authenticateHandler; }
}
- public bool UseBackup
- {
- get { return m_useBackup; }
- }
-
// an instance to the physics plugin's Scene object.
public PhysicsScene PhysicsScene
{
@@ -768,8 +779,8 @@ namespace OpenSim.Region.Framework.Scenes
StartDisabled = startupConfig.GetBoolean("StartDisabled", false);
m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance", m_defaultDrawDistance);
- m_useBackup = startupConfig.GetBoolean("UseSceneBackup", m_useBackup);
- if (!m_useBackup)
+ UseBackup = startupConfig.GetBoolean("UseSceneBackup", UseBackup);
+ if (!UseBackup)
m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName);
//Animation states
@@ -937,6 +948,8 @@ namespace OpenSim.Region.Framework.Scenes
{
PhysicalPrims = true;
CollidablePrims = true;
+ PeriodicBackup = true;
+ UseBackup = true;
BordersLocked = true;
Border northBorder = new Border();
@@ -1189,6 +1202,14 @@ namespace OpenSim.Region.Framework.Scenes
Active = active;
}
+ if (options.ContainsKey("pbackup"))
+ {
+ bool active;
+
+ if (bool.TryParse(options["pbackup"], out active))
+ PeriodicBackup = active;
+ }
+
if (options.ContainsKey("scripting"))
{
bool enableScripts = true;
@@ -1570,7 +1591,7 @@ namespace OpenSim.Region.Framework.Scenes
eventMS = Util.EnvironmentTickCountSubtract(tmpMS);
}
- if (Frame % m_update_backup == 0)
+ if (PeriodicBackup && Frame % m_update_backup == 0)
{
tmpMS = Util.EnvironmentTickCount();
UpdateStorageBackup();
--
cgit v1.1