mirror of
https://github.com/opensim/opensim.git
synced 2026-06-13 07:45:35 +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:
@@ -56,6 +56,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||
public IConfigSource ConfigSource;
|
||||
public IConfig ScriptConfigSource;
|
||||
public abstract string ScriptEngineName { get; }
|
||||
private bool m_enabled = true;
|
||||
private bool m_hookUpToServer = false;
|
||||
|
||||
/// <summary>
|
||||
/// How many seconds between re-reading config-file. 0 = never. ScriptEngine will try to adjust to new config changes.
|
||||
@@ -91,6 +93,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||
{
|
||||
World = Sceneworld;
|
||||
ConfigSource = config;
|
||||
m_hookUpToServer = HookUpToServer;
|
||||
|
||||
m_log.Info("[" + ScriptEngineName + "]: ScriptEngine initializing");
|
||||
|
||||
// Make sure we have config
|
||||
@@ -98,13 +102,16 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||
ConfigSource.AddConfig(ScriptEngineName);
|
||||
ScriptConfigSource = ConfigSource.Configs[ScriptEngineName];
|
||||
|
||||
m_enabled = ScriptConfigSource.GetBoolean("Enabled", true);
|
||||
if (!m_enabled)
|
||||
return;
|
||||
|
||||
//m_log.Info("[" + ScriptEngineName + "]: InitializeEngine");
|
||||
|
||||
// Create all objects we'll be using
|
||||
m_EventQueueManager = new EventQueueManager(this);
|
||||
m_EventManager = new EventManager(this, HookUpToServer);
|
||||
// We need to start it
|
||||
newScriptManager.Start();
|
||||
m_ScriptManager = newScriptManager;
|
||||
m_AppDomainManager = new AppDomainManager(this);
|
||||
m_ASYNCLSLCommandManager = new AsyncCommandManager(this);
|
||||
@@ -118,6 +125,17 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||
// Or can we assume we are loaded before anything else so we can use proper events?
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
if (!m_enabled)
|
||||
return;
|
||||
|
||||
if (m_hookUpToServer)
|
||||
m_EventManager.HookUpEvents();
|
||||
|
||||
m_ScriptManager.Start();
|
||||
}
|
||||
|
||||
public void Shutdown()
|
||||
{
|
||||
// We are shutting down
|
||||
@@ -155,10 +173,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||
|
||||
public abstract void Initialise(Scene scene, IConfigSource config);
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user