From 21b69ac5158f8902a2abb1d240d2b8fe15f7f22b Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Sat, 15 Nov 2008 17:52:00 +0000 Subject: Mantis #2621: Thanks idb, for a patch that will persist regularily changed objects better. Objects will be persisted now MinimumTimeBeforePersistenceConsidered seconds after the last change, but latest MaximumTimeBeforePersistenceConsidered after the first change (both are configurable in OpenSim.ini.example and are set to 60 and 600 as default). --- OpenSim/Region/Environment/Scenes/Scene.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index f606018..eb9d509 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -62,6 +62,9 @@ namespace OpenSim.Region.Environment.Scenes public SynchronizeSceneHandler SynchronizeScene = null; public int splitID = 0; + private const long DEFAULT_MIN_TIME_FOR_PERSISTENCE = 60L; + private const long DEFAULT_MAX_TIME_FOR_PERSISTENCE = 600L; + #region Fields protected Timer m_restartWaitTimer = new Timer(); @@ -171,6 +174,11 @@ namespace OpenSim.Region.Environment.Scenes private object m_deleting_scene_object = new object(); + // the minimum time that must elapse before a changed object will be considered for persisted + public long m_dontPersistBefore = DEFAULT_MIN_TIME_FOR_PERSISTENCE * 10000000L; + // the maximum time that must elapse before a changed object will be considered for persisted + public long m_persistAfter = DEFAULT_MAX_TIME_FOR_PERSISTENCE * 10000000L; + #endregion #region Properties @@ -335,6 +343,12 @@ namespace OpenSim.Region.Environment.Scenes m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", 65536.0f); m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", 10.0f); m_clampPrimSize = startupConfig.GetBoolean("ClampPrimSize", false); + m_dontPersistBefore = + startupConfig.GetInt("MinimumTimeBeforePersistenceConsidered", DEFAULT_MIN_TIME_FOR_PERSISTENCE); + m_dontPersistBefore *= 10000000; + m_persistAfter = + startupConfig.GetInt("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE); + m_persistAfter *= 10000000; m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "DotNetEngine"); } @@ -348,6 +362,11 @@ namespace OpenSim.Region.Environment.Scenes #region Startup / Close Methods + public bool ShuttingDown + { + get { return shuttingdown; } + } + protected virtual void RegisterDefaultSceneEvents() { m_eventManager.OnPermissionError += SendPermissionAlert; -- cgit v1.1