diff options
Diffstat (limited to '')
4 files changed, 22 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs index 02d1511..581a9a9 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs | |||
@@ -82,6 +82,7 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
82 | IConfig Config { get; } | 82 | IConfig Config { get; } |
83 | IConfigSource ConfigSource { get; } | 83 | IConfigSource ConfigSource { get; } |
84 | string ScriptEngineName { get; } | 84 | string ScriptEngineName { get; } |
85 | string ScriptEnginePath { get; } | ||
85 | IScriptApi GetApi(UUID itemID, string name); | 86 | IScriptApi GetApi(UUID itemID, string name); |
86 | } | 87 | } |
87 | } | 88 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs index ade1924..130e197 100644 --- a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs | |||
@@ -32,7 +32,7 @@ using System.Reflection; | |||
32 | namespace OpenSim.Region.ScriptEngine.Shared | 32 | namespace OpenSim.Region.ScriptEngine.Shared |
33 | { | 33 | { |
34 | [Serializable] | 34 | [Serializable] |
35 | public class AssemblyResolver | 35 | public class AssemblyResolver : MarshalByRefObject |
36 | { | 36 | { |
37 | public static Assembly OnAssemblyResolve(object sender, | 37 | public static Assembly OnAssemblyResolve(object sender, |
38 | ResolveEventArgs args) | 38 | ResolveEventArgs args) |
@@ -42,9 +42,10 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
42 | 42 | ||
43 | AppDomain myDomain = (AppDomain)sender; | 43 | AppDomain myDomain = (AppDomain)sender; |
44 | string dirName = myDomain.FriendlyName; | 44 | string dirName = myDomain.FriendlyName; |
45 | string ScriptEnginesPath = myDomain.SetupInformation.PrivateBinPath; | ||
45 | 46 | ||
46 | string[] pathList = new string[] {"bin", "ScriptEngines", | 47 | string[] pathList = new string[] {"bin", ScriptEnginesPath, |
47 | Path.Combine("ScriptEngines", dirName)}; | 48 | Path.Combine(ScriptEnginesPath, dirName)}; |
48 | 49 | ||
49 | string assemblyName = args.Name; | 50 | string assemblyName = args.Name; |
50 | if (assemblyName.IndexOf(",") != -1) | 51 | if (assemblyName.IndexOf(",") != -1) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index cd8c67e..49d6abe 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | |||
@@ -72,7 +72,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
72 | private Dictionary<string, enumCompileType> LanguageMapping = new Dictionary<string, enumCompileType>(StringComparer.CurrentCultureIgnoreCase); | 72 | private Dictionary<string, enumCompileType> LanguageMapping = new Dictionary<string, enumCompileType>(StringComparer.CurrentCultureIgnoreCase); |
73 | 73 | ||
74 | private string FilePrefix; | 74 | private string FilePrefix; |
75 | private string ScriptEnginesPath = "ScriptEngines"; | 75 | private string ScriptEnginesPath = null; |
76 | // mapping between LSL and C# line/column numbers | 76 | // mapping between LSL and C# line/column numbers |
77 | private ICodeConverter LSL_Converter; | 77 | private ICodeConverter LSL_Converter; |
78 | 78 | ||
@@ -95,7 +95,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
95 | 95 | ||
96 | public Compiler(IScriptEngine scriptEngine) | 96 | public Compiler(IScriptEngine scriptEngine) |
97 | { | 97 | { |
98 | m_scriptEngine = scriptEngine; | 98 | m_scriptEngine = scriptEngine;; |
99 | ScriptEnginesPath = scriptEngine.ScriptEnginePath; | ||
99 | ReadConfig(); | 100 | ReadConfig(); |
100 | } | 101 | } |
101 | 102 | ||
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index e82d297..c0ec0e8 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -89,6 +89,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
89 | private IXmlRpcRouter m_XmlRpcRouter; | 89 | private IXmlRpcRouter m_XmlRpcRouter; |
90 | private int m_EventLimit; | 90 | private int m_EventLimit; |
91 | private bool m_KillTimedOutScripts; | 91 | private bool m_KillTimedOutScripts; |
92 | private string m_ScriptEnginesPath = null; | ||
92 | 93 | ||
93 | private static List<XEngine> m_ScriptEngines = | 94 | private static List<XEngine> m_ScriptEngines = |
94 | new List<XEngine>(); | 95 | new List<XEngine>(); |
@@ -224,6 +225,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
224 | get { return m_ScriptConfig; } | 225 | get { return m_ScriptConfig; } |
225 | } | 226 | } |
226 | 227 | ||
228 | public string ScriptEnginePath | ||
229 | { | ||
230 | get { return m_ScriptEnginesPath; } | ||
231 | } | ||
232 | |||
227 | public IConfigSource ConfigSource | 233 | public IConfigSource ConfigSource |
228 | { | 234 | { |
229 | get { return m_ConfigSource; } | 235 | get { return m_ConfigSource; } |
@@ -281,6 +287,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
281 | m_EventLimit = m_ScriptConfig.GetInt("EventLimit", 30); | 287 | m_EventLimit = m_ScriptConfig.GetInt("EventLimit", 30); |
282 | m_KillTimedOutScripts = m_ScriptConfig.GetBoolean("KillTimedOutScripts", false); | 288 | m_KillTimedOutScripts = m_ScriptConfig.GetBoolean("KillTimedOutScripts", false); |
283 | m_SaveTime = m_ScriptConfig.GetInt("SaveInterval", 120) * 1000; | 289 | m_SaveTime = m_ScriptConfig.GetInt("SaveInterval", 120) * 1000; |
290 | m_ScriptEnginesPath = m_ScriptConfig.GetString("ScriptEnginesPath", "ScriptEngines"); | ||
284 | 291 | ||
285 | m_Prio = ThreadPriority.BelowNormal; | 292 | m_Prio = ThreadPriority.BelowNormal; |
286 | switch (priority) | 293 | switch (priority) |
@@ -478,7 +485,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
478 | return 0; | 485 | return 0; |
479 | } | 486 | } |
480 | 487 | ||
481 | public Type ReplaceableInterface | 488 | public Type ReplaceableInterface |
482 | { | 489 | { |
483 | get { return null; } | 490 | get { return null; } |
484 | } | 491 | } |
@@ -1040,7 +1047,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1040 | startInfo.IdleTimeout = idleTimeout*1000; // convert to seconds as stated in .ini | 1047 | startInfo.IdleTimeout = idleTimeout*1000; // convert to seconds as stated in .ini |
1041 | startInfo.MaxWorkerThreads = maxThreads; | 1048 | startInfo.MaxWorkerThreads = maxThreads; |
1042 | startInfo.MinWorkerThreads = minThreads; | 1049 | startInfo.MinWorkerThreads = minThreads; |
1043 | startInfo.ThreadPriority = threadPriority; | 1050 | startInfo.ThreadPriority = threadPriority;; |
1044 | startInfo.StackSize = stackSize; | 1051 | startInfo.StackSize = stackSize; |
1045 | startInfo.StartSuspended = true; | 1052 | startInfo.StartSuspended = true; |
1046 | 1053 | ||
@@ -1186,8 +1193,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1186 | if (!(sender is System.AppDomain)) | 1193 | if (!(sender is System.AppDomain)) |
1187 | return null; | 1194 | return null; |
1188 | 1195 | ||
1189 | string[] pathList = new string[] {"bin", "ScriptEngines", | 1196 | string[] pathList = new string[] {"bin", m_ScriptEnginesPath, |
1190 | Path.Combine("ScriptEngines", | 1197 | Path.Combine(m_ScriptEnginesPath, |
1191 | m_Scene.RegionInfo.RegionID.ToString())}; | 1198 | m_Scene.RegionInfo.RegionID.ToString())}; |
1192 | 1199 | ||
1193 | string assemblyName = args.Name; | 1200 | string assemblyName = args.Name; |
@@ -1564,7 +1571,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1564 | string fn = assemE.GetAttribute("Filename"); | 1571 | string fn = assemE.GetAttribute("Filename"); |
1565 | string base64 = assemE.InnerText; | 1572 | string base64 = assemE.InnerText; |
1566 | 1573 | ||
1567 | string path = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); | 1574 | string path = Path.Combine(m_ScriptEnginesPath, World.RegionInfo.RegionID.ToString()); |
1568 | path = Path.Combine(path, fn); | 1575 | path = Path.Combine(path, fn); |
1569 | 1576 | ||
1570 | if (!File.Exists(path)) | 1577 | if (!File.Exists(path)) |
@@ -1604,7 +1611,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1604 | } | 1611 | } |
1605 | } | 1612 | } |
1606 | 1613 | ||
1607 | string statepath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); | 1614 | string statepath = Path.Combine(m_ScriptEnginesPath, World.RegionInfo.RegionID.ToString()); |
1608 | statepath = Path.Combine(statepath, itemID.ToString() + ".state"); | 1615 | statepath = Path.Combine(statepath, itemID.ToString() + ".state"); |
1609 | 1616 | ||
1610 | try | 1617 | try |
@@ -1630,7 +1637,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1630 | { | 1637 | { |
1631 | XmlElement mapE = (XmlElement)mapL[0]; | 1638 | XmlElement mapE = (XmlElement)mapL[0]; |
1632 | 1639 | ||
1633 | string mappath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); | 1640 | string mappath = Path.Combine(m_ScriptEnginesPath, World.RegionInfo.RegionID.ToString()); |
1634 | mappath = Path.Combine(mappath, mapE.GetAttribute("Filename")); | 1641 | mappath = Path.Combine(mappath, mapE.GetAttribute("Filename")); |
1635 | 1642 | ||
1636 | try | 1643 | try |