From e741dcde6ad081e630d7659be0995e70a66504a0 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Fri, 22 Feb 2008 20:06:44 +0000 Subject: Some misplaced code made scripts never start :) --- .../Common/ScriptEngineBase/MaintenanceThread.cs | 27 +++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Common') diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs index c329246..47fe815 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs @@ -129,7 +129,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase long Last_maxFunctionExecutionTimens = 0; // DateTime.Now.Ticks; long Last_ReReadConfigFilens = DateTime.Now.Ticks; - long Last_MaintenanceRun = 0; int MaintenanceLoopTicks_ScriptLoadUnload_Count = 0; int MaintenanceLoopTicks_Other_Count = 0; @@ -140,8 +139,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase while (true) { System.Threading.Thread.Sleep(MaintenanceLoopms); // Sleep before next pass - //if (PleaseShutdown) - // return; + + // Increase our counters MaintenanceLoopTicks_ScriptLoadUnload_Count++; MaintenanceLoopTicks_Other_Count++; @@ -150,12 +149,12 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase { lastScriptEngine = m_ScriptEngine; // Re-reading config every x seconds - if (m_ScriptEngine.RefreshConfigFilens > 0) + if (MaintenanceLoopTicks_Other_Count >= MaintenanceLoopTicks_Other) { - - if (MaintenanceLoopTicks_Other_Count >= MaintenanceLoopTicks_Other) + MaintenanceLoopTicks_Other_Count = 0; + if (m_ScriptEngine.RefreshConfigFilens > 0) { - MaintenanceLoopTicks_Other_Count = 0; + // Check if its time to re-read config if (DateTime.Now.Ticks - Last_ReReadConfigFilens > m_ScriptEngine.RefreshConfigFilens) @@ -185,13 +184,13 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase } } - if (MaintenanceLoopTicks_ScriptLoadUnload_Count >= MaintenanceLoopTicks_ScriptLoadUnload) - { - MaintenanceLoopTicks_ScriptLoadUnload_Count = 0; - // LOAD / UNLOAD SCRIPTS - if (m_ScriptEngine.m_ScriptManager != null) - m_ScriptEngine.m_ScriptManager.DoScriptLoadUnload(); - } + } + if (MaintenanceLoopTicks_ScriptLoadUnload_Count >= MaintenanceLoopTicks_ScriptLoadUnload) + { + MaintenanceLoopTicks_ScriptLoadUnload_Count = 0; + // LOAD / UNLOAD SCRIPTS + if (m_ScriptEngine.m_ScriptManager != null) + m_ScriptEngine.m_ScriptManager.DoScriptLoadUnload(); } } } -- cgit v1.1