From f11107821e259d544dc42648f4cdba2b123cd71e Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 25 Sep 2008 17:26:32 +0000 Subject: Add an extension to allow registering multiple interfaces of a type with Scene. Make the script engines check that the engine name in the //Engine:language comment is a valid engine and treat it as a normal comment if it's not. //DotNetEngine: needs to be written as //ScriptEngine.DotNetEngine: now, since that is it's real internal name. //XEngine: still works --- .../ScriptEngine/Shared/Instance/ScriptInstance.cs | 126 +++++++++++---------- 1 file changed, 65 insertions(+), 61 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Instance') diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 28a3b11..6e6d169 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -567,86 +567,90 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance } else { - SceneObjectPart part = m_Engine.World.GetSceneObjectPart( - m_LocalID); - // m_Engine.Log.DebugFormat("[Script] Delivered event {2} in state {3} to {0}.{1}", - // m_PrimName, m_ScriptName, data.EventName, m_State); - - try + if (m_Engine.World.PipeEventsForScript(m_LocalID) || + data.EventName == "control") // Don't freeze avies! { - m_CurrentEvent = data.EventName; - m_EventStart = DateTime.Now; - m_InEvent = true; + SceneObjectPart part = m_Engine.World.GetSceneObjectPart( + m_LocalID); + // m_Engine.Log.DebugFormat("[Script] Delivered event {2} in state {3} to {0}.{1}", + // m_PrimName, m_ScriptName, data.EventName, m_State); - m_Script.ExecuteEvent(State, data.EventName, data.Params); + try + { + m_CurrentEvent = data.EventName; + m_EventStart = DateTime.Now; + m_InEvent = true; - m_InEvent = false; - m_CurrentEvent = String.Empty; + m_Script.ExecuteEvent(State, data.EventName, data.Params); - if (m_SaveState) - { - // This will be the very first event we deliver - // (state_entry) in defualt state - // + m_InEvent = false; + m_CurrentEvent = String.Empty; - SaveState(m_Assembly); + if (m_SaveState) + { + // This will be the very first event we deliver + // (state_entry) in defualt state + // - m_SaveState = false; - } - } - catch (Exception e) - { - m_InEvent = false; - m_CurrentEvent = String.Empty; + SaveState(m_Assembly); - if (!(e is TargetInvocationException) || (!(e.InnerException is EventAbortException) && (!(e.InnerException is SelfDeleteException)))) + m_SaveState = false; + } + } + catch (Exception e) { - if (e is System.Threading.ThreadAbortException) + m_InEvent = false; + m_CurrentEvent = String.Empty; + + if (!(e is TargetInvocationException) || (!(e.InnerException is EventAbortException) && (!(e.InnerException is SelfDeleteException)))) { - lock (m_EventQueue) + if (e is System.Threading.ThreadAbortException) { - if ((m_EventQueue.Count > 0) && m_RunEvents && (!m_ShuttingDown)) + lock (m_EventQueue) { - m_CurrentResult=m_Engine.QueueEventHandler(this); + if ((m_EventQueue.Count > 0) && m_RunEvents && (!m_ShuttingDown)) + { + m_CurrentResult=m_Engine.QueueEventHandler(this); + } + else + { + m_CurrentResult = null; + } } - else - { - m_CurrentResult = null; - } - } - m_DetectParams = null; + m_DetectParams = null; - return 0; - } + return 0; + } - try - { - // DISPLAY ERROR INWORLD - string text = "Runtime error:\n" + e.InnerException.ToString(); - if (text.Length > 1000) - text = text.Substring(0, 1000); - m_Engine.World.SimChat(Utils.StringToBytes(text), - ChatTypeEnum.DebugChannel, 2147483647, - part.AbsolutePosition, - part.Name, part.UUID, false); + try + { + // DISPLAY ERROR INWORLD + string text = "Runtime error:\n" + e.InnerException.ToString(); + if (text.Length > 1000) + text = text.Substring(0, 1000); + m_Engine.World.SimChat(Utils.StringToBytes(text), + ChatTypeEnum.DebugChannel, 2147483647, + part.AbsolutePosition, + part.Name, part.UUID, false); + } + catch (Exception e2) // LEGIT: User Scripting + { + m_Engine.Log.Error("[Script]: "+ + "Error displaying error in-world: " + + e2.ToString()); + m_Engine.Log.Error("[Script]: " + + "Errormessage: Error compiling script:\r\n" + + e.ToString()); + } } - catch (Exception e2) // LEGIT: User Scripting + else if ((e is TargetInvocationException) && (e.InnerException is SelfDeleteException)) { - m_Engine.Log.Error("[Script]: "+ - "Error displaying error in-world: " + - e2.ToString()); - m_Engine.Log.Error("[Script]: " + - "Errormessage: Error compiling script:\r\n" + - e.ToString()); + m_InSelfDelete = true; + if (part != null && part.ParentGroup != null) + m_Engine.World.DeleteSceneObject(part.ParentGroup); } } - else if ((e is TargetInvocationException) && (e.InnerException is SelfDeleteException)) - { - m_InSelfDelete = true; - if (part != null && part.ParentGroup != null) - m_Engine.World.DeleteSceneObject(part.ParentGroup); - } } } -- cgit v1.1