diff options
author | BlueWall | 2010-09-25 16:22:18 -0400 |
---|---|---|
committer | Melanie | 2010-09-26 02:30:46 +0100 |
commit | 4f25b73b572e458a3e98614fc5694286e5e3fb92 (patch) | |
tree | 848a886d6cf75ae09b549ea3400073e60de83c73 /OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |
parent | Prevent spoofing the agent name on text IM (diff) | |
download | opensim-SC_OLD-4f25b73b572e458a3e98614fc5694286e5e3fb92.zip opensim-SC_OLD-4f25b73b572e458a3e98614fc5694286e5e3fb92.tar.gz opensim-SC_OLD-4f25b73b572e458a3e98614fc5694286e5e3fb92.tar.bz2 opensim-SC_OLD-4f25b73b572e458a3e98614fc5694286e5e3fb92.tar.xz |
Add configurable path to script engine assemblies
Adding ability to place script engine assemblies outside
the codebase directories.
Uses new [XEngine] option: ScriptEnginesPath = "path_to_assemblies"
Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine/XEngine.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 427d4e5..8629674 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -88,6 +88,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
88 | private IXmlRpcRouter m_XmlRpcRouter; | 88 | private IXmlRpcRouter m_XmlRpcRouter; |
89 | private int m_EventLimit; | 89 | private int m_EventLimit; |
90 | private bool m_KillTimedOutScripts; | 90 | private bool m_KillTimedOutScripts; |
91 | private string m_ScriptEnginesPath = null; | ||
91 | 92 | ||
92 | private static List<XEngine> m_ScriptEngines = | 93 | private static List<XEngine> m_ScriptEngines = |
93 | new List<XEngine>(); | 94 | new List<XEngine>(); |
@@ -156,6 +157,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
156 | get { return m_ScriptConfig; } | 157 | get { return m_ScriptConfig; } |
157 | } | 158 | } |
158 | 159 | ||
160 | public string ScriptEnginePath | ||
161 | { | ||
162 | get { return m_ScriptEnginesPath; } | ||
163 | } | ||
164 | |||
159 | public IConfigSource ConfigSource | 165 | public IConfigSource ConfigSource |
160 | { | 166 | { |
161 | get { return m_ConfigSource; } | 167 | get { return m_ConfigSource; } |
@@ -213,6 +219,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
213 | m_EventLimit = m_ScriptConfig.GetInt("EventLimit", 30); | 219 | m_EventLimit = m_ScriptConfig.GetInt("EventLimit", 30); |
214 | m_KillTimedOutScripts = m_ScriptConfig.GetBoolean("KillTimedOutScripts", false); | 220 | m_KillTimedOutScripts = m_ScriptConfig.GetBoolean("KillTimedOutScripts", false); |
215 | m_SaveTime = m_ScriptConfig.GetInt("SaveInterval", 120) * 1000; | 221 | m_SaveTime = m_ScriptConfig.GetInt("SaveInterval", 120) * 1000; |
222 | m_ScriptEnginesPath = m_ScriptConfig.GetString("ScriptEnginesPath", "ScriptEngines"); | ||
216 | 223 | ||
217 | m_Prio = ThreadPriority.BelowNormal; | 224 | m_Prio = ThreadPriority.BelowNormal; |
218 | switch (priority) | 225 | switch (priority) |
@@ -410,7 +417,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
410 | return 0; | 417 | return 0; |
411 | } | 418 | } |
412 | 419 | ||
413 | public Type ReplaceableInterface | 420 | public Type ReplaceableInterface |
414 | { | 421 | { |
415 | get { return null; } | 422 | get { return null; } |
416 | } | 423 | } |
@@ -719,9 +726,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
719 | try | 726 | try |
720 | { | 727 | { |
721 | AppDomainSetup appSetup = new AppDomainSetup(); | 728 | AppDomainSetup appSetup = new AppDomainSetup(); |
722 | // appSetup.ApplicationBase = Path.Combine( | 729 | appSetup.PrivateBinPath = Path.Combine( |
723 | // "ScriptEngines", | 730 | m_ScriptEnginesPath, |
724 | // m_Scene.RegionInfo.RegionID.ToString()); | 731 | m_Scene.RegionInfo.RegionID.ToString()); |
725 | 732 | ||
726 | Evidence baseEvidence = AppDomain.CurrentDomain.Evidence; | 733 | Evidence baseEvidence = AppDomain.CurrentDomain.Evidence; |
727 | Evidence evidence = new Evidence(baseEvidence); | 734 | Evidence evidence = new Evidence(baseEvidence); |
@@ -965,7 +972,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
965 | startInfo.IdleTimeout = idleTimeout*1000; // convert to seconds as stated in .ini | 972 | startInfo.IdleTimeout = idleTimeout*1000; // convert to seconds as stated in .ini |
966 | startInfo.MaxWorkerThreads = maxThreads; | 973 | startInfo.MaxWorkerThreads = maxThreads; |
967 | startInfo.MinWorkerThreads = minThreads; | 974 | startInfo.MinWorkerThreads = minThreads; |
968 | startInfo.ThreadPriority = threadPriority; | 975 | startInfo.ThreadPriority = threadPriority;; |
969 | startInfo.StackSize = stackSize; | 976 | startInfo.StackSize = stackSize; |
970 | startInfo.StartSuspended = true; | 977 | startInfo.StartSuspended = true; |
971 | 978 | ||
@@ -1110,8 +1117,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1110 | if (!(sender is System.AppDomain)) | 1117 | if (!(sender is System.AppDomain)) |
1111 | return null; | 1118 | return null; |
1112 | 1119 | ||
1113 | string[] pathList = new string[] {"bin", "ScriptEngines", | 1120 | string[] pathList = new string[] {"bin", m_ScriptEnginesPath, |
1114 | Path.Combine("ScriptEngines", | 1121 | Path.Combine(m_ScriptEnginesPath, |
1115 | m_Scene.RegionInfo.RegionID.ToString())}; | 1122 | m_Scene.RegionInfo.RegionID.ToString())}; |
1116 | 1123 | ||
1117 | string assemblyName = args.Name; | 1124 | string assemblyName = args.Name; |
@@ -1485,7 +1492,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1485 | string fn = assemE.GetAttribute("Filename"); | 1492 | string fn = assemE.GetAttribute("Filename"); |
1486 | string base64 = assemE.InnerText; | 1493 | string base64 = assemE.InnerText; |
1487 | 1494 | ||
1488 | string path = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); | 1495 | string path = Path.Combine(m_ScriptEnginesPath, World.RegionInfo.RegionID.ToString()); |
1489 | path = Path.Combine(path, fn); | 1496 | path = Path.Combine(path, fn); |
1490 | 1497 | ||
1491 | if (!File.Exists(path)) | 1498 | if (!File.Exists(path)) |
@@ -1525,7 +1532,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1525 | } | 1532 | } |
1526 | } | 1533 | } |
1527 | 1534 | ||
1528 | string statepath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); | 1535 | string statepath = Path.Combine(m_ScriptEnginesPath, World.RegionInfo.RegionID.ToString()); |
1529 | statepath = Path.Combine(statepath, itemID.ToString() + ".state"); | 1536 | statepath = Path.Combine(statepath, itemID.ToString() + ".state"); |
1530 | 1537 | ||
1531 | try | 1538 | try |
@@ -1551,7 +1558,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1551 | { | 1558 | { |
1552 | XmlElement mapE = (XmlElement)mapL[0]; | 1559 | XmlElement mapE = (XmlElement)mapL[0]; |
1553 | 1560 | ||
1554 | string mappath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); | 1561 | string mappath = Path.Combine(m_ScriptEnginesPath, World.RegionInfo.RegionID.ToString()); |
1555 | mappath = Path.Combine(mappath, mapE.GetAttribute("Filename")); | 1562 | mappath = Path.Combine(mappath, mapE.GetAttribute("Filename")); |
1556 | 1563 | ||
1557 | try | 1564 | try |