Merge Master
parent
0080f28f1d
commit
6f689f591a
|
@ -81,7 +81,7 @@ namespace OpenSim.Region.Physics.Manager
|
||||||
if (_MeshPlugins.ContainsKey(meshEngineName))
|
if (_MeshPlugins.ContainsKey(meshEngineName))
|
||||||
{
|
{
|
||||||
m_log.Info("[PHYSICS]: creating meshing engine " + meshEngineName);
|
m_log.Info("[PHYSICS]: creating meshing engine " + meshEngineName);
|
||||||
meshEngine = _MeshPlugins[meshEngineName].GetMesher();
|
meshEngine = _MeshPlugins[meshEngineName].GetMesher(config);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -234,6 +234,6 @@ namespace OpenSim.Region.Physics.Manager
|
||||||
public interface IMeshingPlugin
|
public interface IMeshingPlugin
|
||||||
{
|
{
|
||||||
string GetName();
|
string GetName();
|
||||||
IMesher GetMesher();
|
IMesher GetMesher(IConfigSource config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
using System;
|
using System;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
using Nini.Config;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is the zero mesher.
|
* This is the zero mesher.
|
||||||
|
@ -53,7 +54,7 @@ namespace OpenSim.Region.Physics.Manager
|
||||||
return "ZeroMesher";
|
return "ZeroMesher";
|
||||||
}
|
}
|
||||||
|
|
||||||
public IMesher GetMesher()
|
public IMesher GetMesher(IConfigSource config)
|
||||||
{
|
{
|
||||||
return new ZeroMesher();
|
return new ZeroMesher();
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ using System.Drawing;
|
||||||
using System.Drawing.Imaging;
|
using System.Drawing.Imaging;
|
||||||
using PrimMesher;
|
using PrimMesher;
|
||||||
using log4net;
|
using log4net;
|
||||||
|
using Nini.Config;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
|
@ -51,9 +52,9 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
return "Meshmerizer";
|
return "Meshmerizer";
|
||||||
}
|
}
|
||||||
|
|
||||||
public IMesher GetMesher()
|
public IMesher GetMesher(IConfigSource config)
|
||||||
{
|
{
|
||||||
return new Meshmerizer();
|
return new Meshmerizer(config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,14 +71,18 @@ namespace OpenSim.Region.Physics.Meshing
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private bool cacheSculptMaps = true;
|
private bool cacheSculptMaps = true;
|
||||||
private string decodedScultMapPath = "j2kDecodeCache";
|
private string decodedScultMapPath = null;
|
||||||
|
|
||||||
private float minSizeForComplexMesh = 0.2f; // prims with all dimensions smaller than this will have a bounding box mesh
|
private float minSizeForComplexMesh = 0.2f; // prims with all dimensions smaller than this will have a bounding box mesh
|
||||||
|
|
||||||
private Dictionary<ulong, Mesh> m_uniqueMeshes = new Dictionary<ulong, Mesh>();
|
private Dictionary<ulong, Mesh> m_uniqueMeshes = new Dictionary<ulong, Mesh>();
|
||||||
|
|
||||||
public Meshmerizer()
|
public Meshmerizer(IConfigSource config)
|
||||||
{
|
{
|
||||||
|
IConfig start_config = config.Configs["Startup"];
|
||||||
|
|
||||||
|
decodedScultMapPath = start_config.GetString("DecodedSculpMapPath","j2kDecodeCache");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(decodedScultMapPath))
|
if (!Directory.Exists(decodedScultMapPath))
|
||||||
|
|
|
@ -48,6 +48,10 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
|
IConfigSource TopConfig = new IniConfigSource();
|
||||||
|
IConfig config = TopConfig.AddConfig("Startup");
|
||||||
|
config.Set("DecodedSculpMapPath","j2kDecodeCache");
|
||||||
|
|
||||||
// Loading ODEPlugin
|
// Loading ODEPlugin
|
||||||
cbt = new OdePlugin();
|
cbt = new OdePlugin();
|
||||||
// Loading Zero Mesher
|
// Loading Zero Mesher
|
||||||
|
@ -55,7 +59,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
// Getting Physics Scene
|
// Getting Physics Scene
|
||||||
ps = cbt.GetScene("test");
|
ps = cbt.GetScene("test");
|
||||||
// Initializing Physics Scene.
|
// Initializing Physics Scene.
|
||||||
ps.Initialise(imp.GetMesher(),null);
|
ps.Initialise(imp.GetMesher(TopConfig),null);
|
||||||
float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize];
|
float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize];
|
||||||
for (int i = 0; i < ((int)Constants.RegionSize * (int)Constants.RegionSize); i++)
|
for (int i = 0; i < ((int)Constants.RegionSize * (int)Constants.RegionSize); i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -82,6 +82,7 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
|
||||||
IConfig Config { get; }
|
IConfig Config { get; }
|
||||||
IConfigSource ConfigSource { get; }
|
IConfigSource ConfigSource { get; }
|
||||||
string ScriptEngineName { get; }
|
string ScriptEngineName { get; }
|
||||||
|
string ScriptEnginePath { get; }
|
||||||
IScriptApi GetApi(UUID itemID, string name);
|
IScriptApi GetApi(UUID itemID, string name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ using System.Reflection;
|
||||||
namespace OpenSim.Region.ScriptEngine.Shared
|
namespace OpenSim.Region.ScriptEngine.Shared
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class AssemblyResolver
|
public class AssemblyResolver : MarshalByRefObject
|
||||||
{
|
{
|
||||||
public static Assembly OnAssemblyResolve(object sender,
|
public static Assembly OnAssemblyResolve(object sender,
|
||||||
ResolveEventArgs args)
|
ResolveEventArgs args)
|
||||||
|
@ -42,9 +42,10 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||||
|
|
||||||
AppDomain myDomain = (AppDomain)sender;
|
AppDomain myDomain = (AppDomain)sender;
|
||||||
string dirName = myDomain.FriendlyName;
|
string dirName = myDomain.FriendlyName;
|
||||||
|
string ScriptEnginesPath = myDomain.SetupInformation.PrivateBinPath;
|
||||||
|
|
||||||
string[] pathList = new string[] {"bin", "ScriptEngines",
|
string[] pathList = new string[] {"bin", ScriptEnginesPath,
|
||||||
Path.Combine("ScriptEngines", dirName)};
|
Path.Combine(ScriptEnginesPath, dirName)};
|
||||||
|
|
||||||
string assemblyName = args.Name;
|
string assemblyName = args.Name;
|
||||||
if (assemblyName.IndexOf(",") != -1)
|
if (assemblyName.IndexOf(",") != -1)
|
||||||
|
|
|
@ -72,7 +72,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||||
private Dictionary<string, enumCompileType> LanguageMapping = new Dictionary<string, enumCompileType>(StringComparer.CurrentCultureIgnoreCase);
|
private Dictionary<string, enumCompileType> LanguageMapping = new Dictionary<string, enumCompileType>(StringComparer.CurrentCultureIgnoreCase);
|
||||||
|
|
||||||
private string FilePrefix;
|
private string FilePrefix;
|
||||||
private string ScriptEnginesPath = "ScriptEngines";
|
private string ScriptEnginesPath = null;
|
||||||
// mapping between LSL and C# line/column numbers
|
// mapping between LSL and C# line/column numbers
|
||||||
private ICodeConverter LSL_Converter;
|
private ICodeConverter LSL_Converter;
|
||||||
|
|
||||||
|
@ -95,7 +95,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||||
|
|
||||||
public Compiler(IScriptEngine scriptEngine)
|
public Compiler(IScriptEngine scriptEngine)
|
||||||
{
|
{
|
||||||
m_scriptEngine = scriptEngine;
|
m_scriptEngine = scriptEngine;;
|
||||||
|
ScriptEnginesPath = scriptEngine.ScriptEnginePath;
|
||||||
ReadConfig();
|
ReadConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
private IXmlRpcRouter m_XmlRpcRouter;
|
private IXmlRpcRouter m_XmlRpcRouter;
|
||||||
private int m_EventLimit;
|
private int m_EventLimit;
|
||||||
private bool m_KillTimedOutScripts;
|
private bool m_KillTimedOutScripts;
|
||||||
|
private string m_ScriptEnginesPath = null;
|
||||||
|
|
||||||
private static List<XEngine> m_ScriptEngines =
|
private static List<XEngine> m_ScriptEngines =
|
||||||
new List<XEngine>();
|
new List<XEngine>();
|
||||||
|
@ -224,6 +225,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
get { return m_ScriptConfig; }
|
get { return m_ScriptConfig; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string ScriptEnginePath
|
||||||
|
{
|
||||||
|
get { return m_ScriptEnginesPath; }
|
||||||
|
}
|
||||||
|
|
||||||
public IConfigSource ConfigSource
|
public IConfigSource ConfigSource
|
||||||
{
|
{
|
||||||
get { return m_ConfigSource; }
|
get { return m_ConfigSource; }
|
||||||
|
@ -281,6 +287,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
m_EventLimit = m_ScriptConfig.GetInt("EventLimit", 30);
|
m_EventLimit = m_ScriptConfig.GetInt("EventLimit", 30);
|
||||||
m_KillTimedOutScripts = m_ScriptConfig.GetBoolean("KillTimedOutScripts", false);
|
m_KillTimedOutScripts = m_ScriptConfig.GetBoolean("KillTimedOutScripts", false);
|
||||||
m_SaveTime = m_ScriptConfig.GetInt("SaveInterval", 120) * 1000;
|
m_SaveTime = m_ScriptConfig.GetInt("SaveInterval", 120) * 1000;
|
||||||
|
m_ScriptEnginesPath = m_ScriptConfig.GetString("ScriptEnginesPath", "ScriptEngines");
|
||||||
|
|
||||||
m_Prio = ThreadPriority.BelowNormal;
|
m_Prio = ThreadPriority.BelowNormal;
|
||||||
switch (priority)
|
switch (priority)
|
||||||
|
@ -478,7 +485,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Type ReplaceableInterface
|
public Type ReplaceableInterface
|
||||||
{
|
{
|
||||||
get { return null; }
|
get { return null; }
|
||||||
}
|
}
|
||||||
|
@ -1040,7 +1047,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
startInfo.IdleTimeout = idleTimeout*1000; // convert to seconds as stated in .ini
|
startInfo.IdleTimeout = idleTimeout*1000; // convert to seconds as stated in .ini
|
||||||
startInfo.MaxWorkerThreads = maxThreads;
|
startInfo.MaxWorkerThreads = maxThreads;
|
||||||
startInfo.MinWorkerThreads = minThreads;
|
startInfo.MinWorkerThreads = minThreads;
|
||||||
startInfo.ThreadPriority = threadPriority;
|
startInfo.ThreadPriority = threadPriority;;
|
||||||
startInfo.StackSize = stackSize;
|
startInfo.StackSize = stackSize;
|
||||||
startInfo.StartSuspended = true;
|
startInfo.StartSuspended = true;
|
||||||
|
|
||||||
|
@ -1186,8 +1193,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
if (!(sender is System.AppDomain))
|
if (!(sender is System.AppDomain))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
string[] pathList = new string[] {"bin", "ScriptEngines",
|
string[] pathList = new string[] {"bin", m_ScriptEnginesPath,
|
||||||
Path.Combine("ScriptEngines",
|
Path.Combine(m_ScriptEnginesPath,
|
||||||
m_Scene.RegionInfo.RegionID.ToString())};
|
m_Scene.RegionInfo.RegionID.ToString())};
|
||||||
|
|
||||||
string assemblyName = args.Name;
|
string assemblyName = args.Name;
|
||||||
|
@ -1564,7 +1571,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
string fn = assemE.GetAttribute("Filename");
|
string fn = assemE.GetAttribute("Filename");
|
||||||
string base64 = assemE.InnerText;
|
string base64 = assemE.InnerText;
|
||||||
|
|
||||||
string path = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString());
|
string path = Path.Combine(m_ScriptEnginesPath, World.RegionInfo.RegionID.ToString());
|
||||||
path = Path.Combine(path, fn);
|
path = Path.Combine(path, fn);
|
||||||
|
|
||||||
if (!File.Exists(path))
|
if (!File.Exists(path))
|
||||||
|
@ -1604,7 +1611,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
string statepath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString());
|
string statepath = Path.Combine(m_ScriptEnginesPath, World.RegionInfo.RegionID.ToString());
|
||||||
statepath = Path.Combine(statepath, itemID.ToString() + ".state");
|
statepath = Path.Combine(statepath, itemID.ToString() + ".state");
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -1630,7 +1637,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
{
|
{
|
||||||
XmlElement mapE = (XmlElement)mapL[0];
|
XmlElement mapE = (XmlElement)mapL[0];
|
||||||
|
|
||||||
string mappath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString());
|
string mappath = Path.Combine(m_ScriptEnginesPath, World.RegionInfo.RegionID.ToString());
|
||||||
mappath = Path.Combine(mappath, mapE.GetAttribute("Filename"));
|
mappath = Path.Combine(mappath, mapE.GetAttribute("Filename"));
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
|
@ -546,6 +546,10 @@
|
||||||
;; prims
|
;; prims
|
||||||
; DisableUndergroundMovement = true
|
; DisableUndergroundMovement = true
|
||||||
|
|
||||||
|
;; Path to script engine assemblies
|
||||||
|
;; Default is ./bin/ScriptEngines
|
||||||
|
; ScriptEnginesPath = "ScriptEngines"
|
||||||
|
|
||||||
[MRM]
|
[MRM]
|
||||||
;; Enables the Mini Region Modules Script Engine.
|
;; Enables the Mini Region Modules Script Engine.
|
||||||
;; default is false
|
;; default is false
|
||||||
|
|
|
@ -135,6 +135,10 @@
|
||||||
|
|
||||||
meshing = Meshmerizer
|
meshing = Meshmerizer
|
||||||
;meshing = ZeroMesher
|
;meshing = ZeroMesher
|
||||||
|
|
||||||
|
;; Path to decoded sculpty maps
|
||||||
|
;; Defaults to "j2kDecodeCache
|
||||||
|
;DecodedSculpMapPath = "j2kDecodeCache"
|
||||||
|
|
||||||
; Choose one of the physics engines below
|
; Choose one of the physics engines below
|
||||||
; OpenDynamicsEngine is by some distance the most developed physics engine
|
; OpenDynamicsEngine is by some distance the most developed physics engine
|
||||||
|
@ -1000,6 +1004,8 @@
|
||||||
; prims
|
; prims
|
||||||
; DisableUndergroundMovement = true
|
; DisableUndergroundMovement = true
|
||||||
|
|
||||||
|
;; Path to script assemblies
|
||||||
|
; ScriptEnginesPath = "ScriptEngines"
|
||||||
|
|
||||||
[OpenGridProtocol]
|
[OpenGridProtocol]
|
||||||
;These are the settings for the Open Grid Protocol.. the Agent Domain, Region Domain, you know..
|
;These are the settings for the Open Grid Protocol.. the Agent Domain, Region Domain, you know..
|
||||||
|
|
Loading…
Reference in New Issue