Pluggable API module (XEngine style) support for DNE
parent
d8c470343e
commit
6e9d7484d0
|
@ -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 =
|
||||||
|
|
Loading…
Reference in New Issue