mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 22:26:09 +08:00
Change the scirpt engine loading mechanism. Script engines are now
ordinary region modules and are able to coexist in one instance. See http://opensimulator.org/wiki/ScriptEngines for details. There were changes to OpenSim.ini.example, please note DefaultScriptEngine. Also see the User docs and FAQ on the Wiki. Default is DotNetEngine.
This commit is contained in:
@@ -67,6 +67,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
private int m_SleepTime;
|
||||
private int m_SaveTime;
|
||||
private ThreadPriority m_Prio;
|
||||
private bool m_Enabled = true;
|
||||
|
||||
// disable warning: need to keep a reference to XEngine.EventManager
|
||||
// alive to avoid it being garbage collected
|
||||
@@ -151,6 +152,19 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
//
|
||||
public void Initialise(Scene scene, IConfigSource configSource)
|
||||
{
|
||||
m_ScriptConfig = configSource.Configs["XEngine"];
|
||||
|
||||
if (m_ScriptConfig == null)
|
||||
{
|
||||
// m_log.ErrorFormat("[XEngine] No script configuration found. Scripts disabled");
|
||||
return;
|
||||
}
|
||||
|
||||
m_Enabled = m_ScriptConfig.GetBoolean("Enabled", true);
|
||||
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
AppDomain.CurrentDomain.AssemblyResolve +=
|
||||
OnAssemblyResolve;
|
||||
|
||||
@@ -158,14 +172,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
scene.RegionInfo.RegionName);
|
||||
m_Scene = scene;
|
||||
|
||||
m_ScriptConfig = configSource.Configs["XEngine"];
|
||||
|
||||
if (m_ScriptConfig == null)
|
||||
{
|
||||
m_log.ErrorFormat("[XEngine] No script configuration found. Scripts disabled");
|
||||
return;
|
||||
}
|
||||
|
||||
m_MinThreads = m_ScriptConfig.GetInt("MinThreads", 2);
|
||||
m_MaxThreads = m_ScriptConfig.GetInt("MaxThreads", 100);
|
||||
m_IdleTimeout = m_ScriptConfig.GetInt("IdleTimeout", 60);
|
||||
@@ -220,6 +226,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
m_EventManager = new EventManager(this);
|
||||
|
||||
m_Compiler = new Compiler(this);
|
||||
@@ -330,8 +339,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez)
|
||||
public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine)
|
||||
{
|
||||
if (engine != "XEngine")
|
||||
return;
|
||||
|
||||
Object[] parms = new Object[]{localID, itemID, script, startParam, postOnRez};
|
||||
|
||||
lock (m_CompileQueue)
|
||||
|
||||
Reference in New Issue
Block a user