diff options
author | Melanie Thielker | 2008-09-21 21:47:00 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-21 21:47:00 +0000 |
commit | 94aaf67dfaafbcbd4d871f674c465a34c1c1f332 (patch) | |
tree | 33476e5660a95bdf7d29d14beae67a6294af28a7 /OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs | |
parent | * minor: warnings removal (diff) | |
download | opensim-SC-94aaf67dfaafbcbd4d871f674c465a34c1c1f332.zip opensim-SC-94aaf67dfaafbcbd4d871f674c465a34c1c1f332.tar.gz opensim-SC-94aaf67dfaafbcbd4d871f674c465a34c1c1f332.tar.bz2 opensim-SC-94aaf67dfaafbcbd4d871f674c465a34c1c1f332.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs index b0c6314..26e5ec2 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs | |||
@@ -56,6 +56,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
56 | public IConfigSource ConfigSource; | 56 | public IConfigSource ConfigSource; |
57 | public IConfig ScriptConfigSource; | 57 | public IConfig ScriptConfigSource; |
58 | public abstract string ScriptEngineName { get; } | 58 | public abstract string ScriptEngineName { get; } |
59 | private bool m_enabled = true; | ||
60 | private bool m_hookUpToServer = false; | ||
59 | 61 | ||
60 | /// <summary> | 62 | /// <summary> |
61 | /// How many seconds between re-reading config-file. 0 = never. ScriptEngine will try to adjust to new config changes. | 63 | /// 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 | |||
91 | { | 93 | { |
92 | World = Sceneworld; | 94 | World = Sceneworld; |
93 | ConfigSource = config; | 95 | ConfigSource = config; |
96 | m_hookUpToServer = HookUpToServer; | ||
97 | |||
94 | m_log.Info("[" + ScriptEngineName + "]: ScriptEngine initializing"); | 98 | m_log.Info("[" + ScriptEngineName + "]: ScriptEngine initializing"); |
95 | 99 | ||
96 | // Make sure we have config | 100 | // Make sure we have config |
@@ -98,13 +102,16 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
98 | ConfigSource.AddConfig(ScriptEngineName); | 102 | ConfigSource.AddConfig(ScriptEngineName); |
99 | ScriptConfigSource = ConfigSource.Configs[ScriptEngineName]; | 103 | ScriptConfigSource = ConfigSource.Configs[ScriptEngineName]; |
100 | 104 | ||
105 | m_enabled = ScriptConfigSource.GetBoolean("Enabled", true); | ||
106 | if (!m_enabled) | ||
107 | return; | ||
108 | |||
101 | //m_log.Info("[" + ScriptEngineName + "]: InitializeEngine"); | 109 | //m_log.Info("[" + ScriptEngineName + "]: InitializeEngine"); |
102 | 110 | ||
103 | // Create all objects we'll be using | 111 | // Create all objects we'll be using |
104 | m_EventQueueManager = new EventQueueManager(this); | 112 | m_EventQueueManager = new EventQueueManager(this); |
105 | m_EventManager = new EventManager(this, HookUpToServer); | 113 | m_EventManager = new EventManager(this, HookUpToServer); |
106 | // We need to start it | 114 | // We need to start it |
107 | newScriptManager.Start(); | ||
108 | m_ScriptManager = newScriptManager; | 115 | m_ScriptManager = newScriptManager; |
109 | m_AppDomainManager = new AppDomainManager(this); | 116 | m_AppDomainManager = new AppDomainManager(this); |
110 | m_ASYNCLSLCommandManager = new AsyncCommandManager(this); | 117 | m_ASYNCLSLCommandManager = new AsyncCommandManager(this); |
@@ -118,6 +125,17 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
118 | // Or can we assume we are loaded before anything else so we can use proper events? | 125 | // Or can we assume we are loaded before anything else so we can use proper events? |
119 | } | 126 | } |
120 | 127 | ||
128 | public void PostInitialise() | ||
129 | { | ||
130 | if (!m_enabled) | ||
131 | return; | ||
132 | |||
133 | if (m_hookUpToServer) | ||
134 | m_EventManager.HookUpEvents(); | ||
135 | |||
136 | m_ScriptManager.Start(); | ||
137 | } | ||
138 | |||
121 | public void Shutdown() | 139 | public void Shutdown() |
122 | { | 140 | { |
123 | // We are shutting down | 141 | // We are shutting down |
@@ -155,10 +173,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
155 | 173 | ||
156 | public abstract void Initialise(Scene scene, IConfigSource config); | 174 | public abstract void Initialise(Scene scene, IConfigSource config); |
157 | 175 | ||
158 | public void PostInitialise() | ||
159 | { | ||
160 | } | ||
161 | |||
162 | public void Close() | 176 | public void Close() |
163 | { | 177 | { |
164 | } | 178 | } |