diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 9f05cf4fb4..3062788a02 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -239,13 +239,15 @@ namespace OpenSim
m_console.Commands.AddCommand("Debug", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug);
m_console.Commands.AddCommand("Debug", false, "debug scene",
- "debug scene active|collisions|physics|scripting|teleport true|false",
- "Turn on scene debugging.",
+ "debug scene active|collisions|pbackup|physics|scripting|teleport|updates true|false",
+ "Turn on scene debugging options.",
"If active is false then main scene update and maintenance loops are suspended.\n"
+ "If collisions is false then collisions with other objects are turned off.\n"
+ + "If pbackup is false then periodic scene backup is turned off.\n"
+ "If physics is false then all physics objects are non-physical.\n"
+ "If scripting is false then no scripting operations happen.\n"
- + "If teleport is true then some extra teleport debug information is logged.",
+ + "If teleport is true then some extra teleport debug information is logged."
+ + "If updates is true then any frame which exceeds double the maximum desired frame time is logged.",
Debug);
m_console.Commands.AddCommand("General", false, "change region",
@@ -782,7 +784,7 @@ namespace OpenSim
else
{
MainConsole.Instance.Output(
- "Usage: debug scene active|scripting|collisions|physics|teleport true|false");
+ "Usage: debug scene active|collisions|pbackup|physics|scripting|teleport|updates true|false");
}
break;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index d11e9ab783..0b6f36c729 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;
///
@@ -317,7 +334,6 @@ namespace OpenSim.Region.Framework.Scenes
private Timer m_mapGenerationTimer = new Timer();
private bool m_generateMaptiles;
- private bool m_useBackup = true;
#endregion Fields
@@ -570,11 +586,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
{
@@ -743,8 +754,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
@@ -895,6 +906,8 @@ namespace OpenSim.Region.Framework.Scenes
{
PhysicalPrims = true;
CollidablePrims = true;
+ PeriodicBackup = true;
+ UseBackup = true;
BordersLocked = true;
Border northBorder = new Border();
@@ -1147,6 +1160,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;
@@ -1528,7 +1549,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();