diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 17 |
2 files changed, 14 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs index a3f848c..f247a0b 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs | |||
@@ -58,9 +58,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests | |||
58 | // Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory); | 58 | // Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory); |
59 | m_xEngine = new XEngine(); | 59 | m_xEngine = new XEngine(); |
60 | 60 | ||
61 | // Necessary to stop serialization complaining | ||
62 | WorldCommModule wcModule = new WorldCommModule(); | ||
63 | |||
64 | IniConfigSource configSource = new IniConfigSource(); | 61 | IniConfigSource configSource = new IniConfigSource(); |
65 | 62 | ||
66 | IConfig startupConfig = configSource.AddConfig("Startup"); | 63 | IConfig startupConfig = configSource.AddConfig("Startup"); |
@@ -68,13 +65,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine.Tests | |||
68 | 65 | ||
69 | IConfig xEngineConfig = configSource.AddConfig("XEngine"); | 66 | IConfig xEngineConfig = configSource.AddConfig("XEngine"); |
70 | xEngineConfig.Set("Enabled", "true"); | 67 | xEngineConfig.Set("Enabled", "true"); |
68 | xEngineConfig.Set("StartDelay", "0"); | ||
71 | 69 | ||
72 | // These tests will not run with AppDomainLoading = true, at least on mono. For unknown reasons, the call | 70 | // These tests will not run with AppDomainLoading = true, at least on mono. For unknown reasons, the call |
73 | // to AssemblyResolver.OnAssemblyResolve fails. | 71 | // to AssemblyResolver.OnAssemblyResolve fails. |
74 | xEngineConfig.Set("AppDomainLoading", "false"); | 72 | xEngineConfig.Set("AppDomainLoading", "false"); |
75 | 73 | ||
76 | m_scene = new SceneHelpers().SetupScene("My Test", UUID.Random(), 1000, 1000, configSource); | 74 | m_scene = new SceneHelpers().SetupScene("My Test", UUID.Random(), 1000, 1000, configSource); |
77 | SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule); | 75 | SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine); |
78 | m_scene.StartScripts(); | 76 | m_scene.StartScripts(); |
79 | } | 77 | } |
80 | 78 | ||
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index cc783aa..d763063 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -78,7 +78,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
78 | private IConfigSource m_ConfigSource = null; | 78 | private IConfigSource m_ConfigSource = null; |
79 | private ICompiler m_Compiler; | 79 | private ICompiler m_Compiler; |
80 | private int m_MinThreads; | 80 | private int m_MinThreads; |
81 | private int m_MaxThreads ; | 81 | private int m_MaxThreads; |
82 | |||
83 | /// <summary> | ||
84 | /// Amount of time to delay before starting. | ||
85 | /// </summary> | ||
86 | private int m_StartDelay; | ||
87 | |||
82 | private int m_IdleTimeout; | 88 | private int m_IdleTimeout; |
83 | private int m_StackSize; | 89 | private int m_StackSize; |
84 | private int m_SleepTime; | 90 | private int m_SleepTime; |
@@ -299,6 +305,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
299 | m_MaxThreads = m_ScriptConfig.GetInt("MaxThreads", 100); | 305 | m_MaxThreads = m_ScriptConfig.GetInt("MaxThreads", 100); |
300 | m_IdleTimeout = m_ScriptConfig.GetInt("IdleTimeout", 60); | 306 | m_IdleTimeout = m_ScriptConfig.GetInt("IdleTimeout", 60); |
301 | string priority = m_ScriptConfig.GetString("Priority", "BelowNormal"); | 307 | string priority = m_ScriptConfig.GetString("Priority", "BelowNormal"); |
308 | m_StartDelay = m_ScriptConfig.GetInt("StartDelay", 15000); | ||
302 | m_MaxScriptQueue = m_ScriptConfig.GetInt("MaxScriptEventQueue",300); | 309 | m_MaxScriptQueue = m_ScriptConfig.GetInt("MaxScriptEventQueue",300); |
303 | m_StackSize = m_ScriptConfig.GetInt("ThreadStackSize", 262144); | 310 | m_StackSize = m_ScriptConfig.GetInt("ThreadStackSize", 262144); |
304 | m_SleepTime = m_ScriptConfig.GetInt("MaintenanceInterval", 10) * 1000; | 311 | m_SleepTime = m_ScriptConfig.GetInt("MaintenanceInterval", 10) * 1000; |
@@ -957,7 +964,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
957 | { | 964 | { |
958 | // This delay exists to stop mono problems where script compilation and startup would stop the sim | 965 | // This delay exists to stop mono problems where script compilation and startup would stop the sim |
959 | // working properly for the session. | 966 | // working properly for the session. |
960 | System.Threading.Thread.Sleep(15000); | 967 | System.Threading.Thread.Sleep(m_StartDelay); |
961 | } | 968 | } |
962 | 969 | ||
963 | object[] o; | 970 | object[] o; |
@@ -1768,12 +1775,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1768 | 1775 | ||
1769 | public string GetXMLState(UUID itemID) | 1776 | public string GetXMLState(UUID itemID) |
1770 | { | 1777 | { |
1771 | // m_log.DebugFormat("[XEngine]: Getting XML state for {0}", itemID); | 1778 | // m_log.DebugFormat("[XEngine]: Getting XML state for script instance {0}", itemID); |
1772 | 1779 | ||
1773 | IScriptInstance instance = GetInstance(itemID); | 1780 | IScriptInstance instance = GetInstance(itemID); |
1774 | if (instance == null) | 1781 | if (instance == null) |
1775 | { | 1782 | { |
1776 | // m_log.DebugFormat("[XEngine]: Found no script for {0}, returning empty string", itemID); | 1783 | // m_log.DebugFormat("[XEngine]: Found no script instance for {0}, returning empty string", itemID); |
1777 | return ""; | 1784 | return ""; |
1778 | } | 1785 | } |
1779 | 1786 | ||
@@ -1848,7 +1855,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1848 | tfs.Read(tdata, 0, tdata.Length); | 1855 | tfs.Read(tdata, 0, tdata.Length); |
1849 | } | 1856 | } |
1850 | 1857 | ||
1851 | assem = new System.Text.ASCIIEncoding().GetString(tdata); | 1858 | assem = Encoding.ASCII.GetString(tdata); |
1852 | } | 1859 | } |
1853 | catch (Exception e) | 1860 | catch (Exception e) |
1854 | { | 1861 | { |