aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2008-09-26 16:19:50 +0000
committerMelanie Thielker2008-09-26 16:19:50 +0000
commit6e9d7484d059f8ad8b11a11d51d987de1ea2fe73 (patch)
tree04bc0da8967640216122a470d3ce08fbbdbadcad
parentCompiler Connection! One world, one compiler! (diff)
downloadopensim-SC_OLD-6e9d7484d059f8ad8b11a11d51d987de1ea2fe73.zip
opensim-SC_OLD-6e9d7484d059f8ad8b11a11d51d987de1ea2fe73.tar.gz
opensim-SC_OLD-6e9d7484d059f8ad8b11a11d51d987de1ea2fe73.tar.bz2
opensim-SC_OLD-6e9d7484d059f8ad8b11a11d51d987de1ea2fe73.tar.xz
Pluggable API module (XEngine style) support for DNE
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs21
1 files changed, 14 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index 6d8096f..fca4617 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -52,6 +52,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
52 public string Source; 52 public string Source;
53 public int StartParam; 53 public int StartParam;
54 public AppDomain AppDomain; 54 public AppDomain AppDomain;
55 public Dictionary<string, IScriptApi> Apis;
55 } 56 }
56 57
57 public class ScriptManager 58 public class ScriptManager
@@ -168,15 +169,21 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
168 // Add it to our script memstruct 169 // Add it to our script memstruct
169 m_scriptEngine.m_ScriptManager.SetScript(localID, itemID, id); 170 m_scriptEngine.m_ScriptManager.SetScript(localID, itemID, id);
170 171
171 LSL_Api LSL = new LSL_Api(); 172 id.Apis = new Dictionary<string, IScriptApi>();
172 OSSL_Api OSSL = new OSSL_Api();
173 173
174 LSL.Initialize(m_scriptEngine, m_host, localID, itemID); 174 ApiManager am = new ApiManager();
175 OSSL.Initialize(m_scriptEngine, m_host, localID, itemID);
176 175
177 // Start the script - giving it the APIs 176 foreach (string api in am.GetApis())
178 CompiledScript.InitApi("LSL", LSL); 177 {
179 CompiledScript.InitApi("OSSL", OSSL); 178 id.Apis[api] = am.CreateApi(api);
179 id.Apis[api].Initialize(m_scriptEngine, m_host,
180 localID, itemID);
181 }
182
183 foreach (KeyValuePair<string,IScriptApi> kv in id.Apis)
184 {
185 CompiledScript.InitApi(kv.Key, kv.Value);
186 }
180 187
181 // Fire the first start-event 188 // Fire the first start-event
182 int eventFlags = 189 int eventFlags =