From f3c8963c86dbc969541ede80ae37eb59d26b7809 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 25 Sep 2008 05:13:44 +0000 Subject: Convergence is almost complete. This brings the diff between the API to < 10k and makes it use a common set of types in both engine. Fixes the issues with running both engines and HTTP requests / listens / timers etc.. Also fixes a couple of minor Scene issues and a CTB by nullref. --- .../Common/ScriptEngineBase/ScriptEngine.cs | 25 +++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs') diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs index c972683..b09a30b 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs @@ -57,7 +57,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase public EventQueueManager m_EventQueueManager; // Executes events, handles script threads public ScriptManager m_ScriptManager; // Load, unload and execute scripts public AppDomainManager m_AppDomainManager; // Handles loading/unloading of scripts into AppDomains - public AsyncCommandManager m_ASYNCLSLCommandManager; // Asyncronous LSL commands (commands that returns with an event) public static MaintenanceThread m_MaintenanceThread; // Thread that does different kinds of maintenance, for example refreshing config and killing scripts that has been running too long public IConfigSource ConfigSource; @@ -121,7 +120,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase // We need to start it m_ScriptManager = newScriptManager; m_AppDomainManager = new AppDomainManager(this); - m_ASYNCLSLCommandManager = new AsyncCommandManager(this); if (m_MaintenanceThread == null) m_MaintenanceThread = new MaintenanceThread(); @@ -172,7 +170,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase if (m_EventManager != null) m_EventManager.ReadConfig(); if (m_ScriptManager != null) m_ScriptManager.ReadConfig(); if (m_AppDomainManager != null) m_AppDomainManager.ReadConfig(); - if (m_ASYNCLSLCommandManager != null) m_ASYNCLSLCommandManager.ReadConfig(); if (m_MaintenanceThread != null) m_MaintenanceThread.ReadConfig(); } @@ -196,15 +193,33 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase public bool PostObjectEvent(uint localID, EventParams p) { - return m_EventQueueManager.AddToObjectQueue(localID, p.EventName, EventQueueManager.llDetectNull, p.Params); + return m_EventQueueManager.AddToObjectQueue(localID, p.EventName, p.DetectParams, p.Params); } public bool PostScriptEvent(UUID itemID, EventParams p) { uint localID = m_ScriptManager.GetLocalID(itemID); - return m_EventQueueManager.AddToScriptQueue(localID, itemID, p.EventName, EventQueueManager.llDetectNull, p.Params); + return m_EventQueueManager.AddToScriptQueue(localID, itemID, p.EventName, p.DetectParams, p.Params); } + public DetectParams GetDetectParams(UUID itemID, int number) + { + uint localID = m_ScriptManager.GetLocalID(itemID); + if (localID == 0) + return null; + + IScript Script = m_ScriptManager.GetScript(localID, itemID); + + if (Script == null) + return null; + + DetectParams[] det = m_ScriptManager.GetDetectParams(Script); + + if (number < 0 || number >= det.Length) + return null; + + return det[number]; + } #endregion } } -- cgit v1.1