diff options
author | Melanie | 2010-09-26 17:56:31 +0100 |
---|---|---|
committer | Melanie | 2010-09-26 17:56:31 +0100 |
commit | 6f689f591a295195cf8db3c37bcd382502d468d7 (patch) | |
tree | 87d7340eb92921c905a505cf89dd4a37d90ac381 /OpenSim | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
download | opensim-SC-6f689f591a295195cf8db3c37bcd382502d468d7.zip opensim-SC-6f689f591a295195cf8db3c37bcd382502d468d7.tar.gz opensim-SC-6f689f591a295195cf8db3c37bcd382502d468d7.tar.bz2 opensim-SC-6f689f591a295195cf8db3c37bcd382502d468d7.tar.xz |
Merge Master
Diffstat (limited to '')
8 files changed, 40 insertions, 20 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs index 7130a3e..3763696 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs | |||
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Physics.Manager | |||
81 | if (_MeshPlugins.ContainsKey(meshEngineName)) | 81 | if (_MeshPlugins.ContainsKey(meshEngineName)) |
82 | { | 82 | { |
83 | m_log.Info("[PHYSICS]: creating meshing engine " + meshEngineName); | 83 | m_log.Info("[PHYSICS]: creating meshing engine " + meshEngineName); |
84 | meshEngine = _MeshPlugins[meshEngineName].GetMesher(); | 84 | meshEngine = _MeshPlugins[meshEngineName].GetMesher(config); |
85 | } | 85 | } |
86 | else | 86 | else |
87 | { | 87 | { |
@@ -234,6 +234,6 @@ namespace OpenSim.Region.Physics.Manager | |||
234 | public interface IMeshingPlugin | 234 | public interface IMeshingPlugin |
235 | { | 235 | { |
236 | string GetName(); | 236 | string GetName(); |
237 | IMesher GetMesher(); | 237 | IMesher GetMesher(IConfigSource config); |
238 | } | 238 | } |
239 | } | 239 | } |
diff --git a/OpenSim/Region/Physics/Manager/ZeroMesher.cs b/OpenSim/Region/Physics/Manager/ZeroMesher.cs index e6e75f9..ba19db6 100644 --- a/OpenSim/Region/Physics/Manager/ZeroMesher.cs +++ b/OpenSim/Region/Physics/Manager/ZeroMesher.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using OpenSim.Framework; | 29 | using OpenSim.Framework; |
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | using Nini.Config; | ||
31 | 32 | ||
32 | /* | 33 | /* |
33 | * This is the zero mesher. | 34 | * This is the zero mesher. |
@@ -53,7 +54,7 @@ namespace OpenSim.Region.Physics.Manager | |||
53 | return "ZeroMesher"; | 54 | return "ZeroMesher"; |
54 | } | 55 | } |
55 | 56 | ||
56 | public IMesher GetMesher() | 57 | public IMesher GetMesher(IConfigSource config) |
57 | { | 58 | { |
58 | return new ZeroMesher(); | 59 | return new ZeroMesher(); |
59 | } | 60 | } |
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index fded95e..62f947c 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -35,6 +35,7 @@ using System.Drawing; | |||
35 | using System.Drawing.Imaging; | 35 | using System.Drawing.Imaging; |
36 | using PrimMesher; | 36 | using PrimMesher; |
37 | using log4net; | 37 | using log4net; |
38 | using Nini.Config; | ||
38 | using System.Reflection; | 39 | using System.Reflection; |
39 | using System.IO; | 40 | using System.IO; |
40 | 41 | ||
@@ -51,9 +52,9 @@ namespace OpenSim.Region.Physics.Meshing | |||
51 | return "Meshmerizer"; | 52 | return "Meshmerizer"; |
52 | } | 53 | } |
53 | 54 | ||
54 | public IMesher GetMesher() | 55 | public IMesher GetMesher(IConfigSource config) |
55 | { | 56 | { |
56 | return new Meshmerizer(); | 57 | return new Meshmerizer(config); |
57 | } | 58 | } |
58 | } | 59 | } |
59 | 60 | ||
@@ -70,14 +71,18 @@ namespace OpenSim.Region.Physics.Meshing | |||
70 | #endif | 71 | #endif |
71 | 72 | ||
72 | private bool cacheSculptMaps = true; | 73 | private bool cacheSculptMaps = true; |
73 | private string decodedScultMapPath = "j2kDecodeCache"; | 74 | private string decodedScultMapPath = null; |
74 | 75 | ||
75 | private float minSizeForComplexMesh = 0.2f; // prims with all dimensions smaller than this will have a bounding box mesh | 76 | private float minSizeForComplexMesh = 0.2f; // prims with all dimensions smaller than this will have a bounding box mesh |
76 | 77 | ||
77 | private Dictionary<ulong, Mesh> m_uniqueMeshes = new Dictionary<ulong, Mesh>(); | 78 | private Dictionary<ulong, Mesh> m_uniqueMeshes = new Dictionary<ulong, Mesh>(); |
78 | 79 | ||
79 | public Meshmerizer() | 80 | public Meshmerizer(IConfigSource config) |
80 | { | 81 | { |
82 | IConfig start_config = config.Configs["Startup"]; | ||
83 | |||
84 | decodedScultMapPath = start_config.GetString("DecodedSculpMapPath","j2kDecodeCache"); | ||
85 | |||
81 | try | 86 | try |
82 | { | 87 | { |
83 | if (!Directory.Exists(decodedScultMapPath)) | 88 | if (!Directory.Exists(decodedScultMapPath)) |
diff --git a/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs b/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs index 69e2d03..ab8f8bf 100644 --- a/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs +++ b/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs | |||
@@ -48,6 +48,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
48 | [SetUp] | 48 | [SetUp] |
49 | public void Initialize() | 49 | public void Initialize() |
50 | { | 50 | { |
51 | IConfigSource TopConfig = new IniConfigSource(); | ||
52 | IConfig config = TopConfig.AddConfig("Startup"); | ||
53 | config.Set("DecodedSculpMapPath","j2kDecodeCache"); | ||
54 | |||
51 | // Loading ODEPlugin | 55 | // Loading ODEPlugin |
52 | cbt = new OdePlugin(); | 56 | cbt = new OdePlugin(); |
53 | // Loading Zero Mesher | 57 | // Loading Zero Mesher |
@@ -55,7 +59,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
55 | // Getting Physics Scene | 59 | // Getting Physics Scene |
56 | ps = cbt.GetScene("test"); | 60 | ps = cbt.GetScene("test"); |
57 | // Initializing Physics Scene. | 61 | // Initializing Physics Scene. |
58 | ps.Initialise(imp.GetMesher(),null); | 62 | ps.Initialise(imp.GetMesher(TopConfig),null); |
59 | float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize]; | 63 | float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize]; |
60 | for (int i = 0; i < ((int)Constants.RegionSize * (int)Constants.RegionSize); i++) | 64 | for (int i = 0; i < ((int)Constants.RegionSize * (int)Constants.RegionSize); i++) |
61 | { | 65 | { |
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 |