Pluggable API module (XEngine style) support for DNE

0.6.0-stable
Melanie Thielker 2008-09-26 16:19:50 +00:00
parent d8c470343e
commit 6e9d7484d0
1 changed files with 14 additions and 7 deletions

View File

@ -52,6 +52,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
public string Source;
public int StartParam;
public AppDomain AppDomain;
public Dictionary<string, IScriptApi> Apis;
}
public class ScriptManager
@ -168,15 +169,21 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
// Add it to our script memstruct
m_scriptEngine.m_ScriptManager.SetScript(localID, itemID, id);
LSL_Api LSL = new LSL_Api();
OSSL_Api OSSL = new OSSL_Api();
id.Apis = new Dictionary<string, IScriptApi>();
LSL.Initialize(m_scriptEngine, m_host, localID, itemID);
OSSL.Initialize(m_scriptEngine, m_host, localID, itemID);
ApiManager am = new ApiManager();
// Start the script - giving it the APIs
CompiledScript.InitApi("LSL", LSL);
CompiledScript.InitApi("OSSL", OSSL);
foreach (string api in am.GetApis())
{
id.Apis[api] = am.CreateApi(api);
id.Apis[api].Initialize(m_scriptEngine, m_host,
localID, itemID);
}
foreach (KeyValuePair<string,IScriptApi> kv in id.Apis)
{
CompiledScript.InitApi(kv.Key, kv.Value);
}
// Fire the first start-event
int eventFlags =