aboutsummaryrefslogtreecommitdiffstatshomepage
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
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.
-rw-r--r--OpenSim/Region/Application/OpenSim.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs39
2 files changed, 36 insertions, 13 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index cffbb3b..492ee4a 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -239,13 +239,15 @@ namespace OpenSim
239 m_console.Commands.AddCommand("Debug", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug); 239 m_console.Commands.AddCommand("Debug", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug);
240 240
241 m_console.Commands.AddCommand("Debug", false, "debug scene", 241 m_console.Commands.AddCommand("Debug", false, "debug scene",
242 "debug scene active|collisions|physics|scripting|teleport true|false", 242 "debug scene active|collisions|pbackup|physics|scripting|teleport|updates true|false",
243 "Turn on scene debugging.", 243 "Turn on scene debugging options.",
244 "If active is false then main scene update and maintenance loops are suspended.\n" 244 "If active is false then main scene update and maintenance loops are suspended.\n"
245 + "If collisions is false then collisions with other objects are turned off.\n" 245 + "If collisions is false then collisions with other objects are turned off.\n"
246 + "If pbackup is false then periodic scene backup is turned off.\n"
246 + "If physics is false then all physics objects are non-physical.\n" 247 + "If physics is false then all physics objects are non-physical.\n"
247 + "If scripting is false then no scripting operations happen.\n" 248 + "If scripting is false then no scripting operations happen.\n"
248 + "If teleport is true then some extra teleport debug information is logged.", 249 + "If teleport is true then some extra teleport debug information is logged."
250 + "If updates is true then any frame which exceeds double the maximum desired frame time is logged.",
249 Debug); 251 Debug);
250 252
251 m_console.Commands.AddCommand("General", false, "change region", 253 m_console.Commands.AddCommand("General", false, "change region",
@@ -764,7 +766,7 @@ namespace OpenSim
764 else 766 else
765 { 767 {
766 MainConsole.Instance.Output( 768 MainConsole.Instance.Output(
767 "Usage: debug scene active|scripting|collisions|physics|teleport true|false"); 769 "Usage: debug scene active|collisions|pbackup|physics|scripting|teleport|updates true|false");
768 } 770 }
769 771
770 break; 772 break;
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();