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