diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 39 |
1 files changed, 30 insertions, 9 deletions
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 | |||
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(); |