From ae9e38bf3fdc27144e0f3fa377c60506526e4c13 Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Thu, 16 Oct 2008 21:46:03 +0000 Subject: Fixed (mono-)script handling for SL viewer 1.21: - Added two missing caps (UpdateScriptAgent, UpdateScriptTask) - Added one missing EventQueue event (ScriptRunningReply) - Changed DNE and XEngine to use this new event As we only use the mono engine anyway, the "Mono" checkbox is set by default but doesn't have any function. --- OpenSim/Framework/Communications/Capabilities/Caps.cs | 2 ++ .../Environment/Modules/Framework/EventQueueHelper.cs | 17 +++++++++++++++++ .../Region/ScriptEngine/DotNetEngine/ScriptEngine.cs | 14 ++++++++++++-- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 13 +++++++++++-- 4 files changed, 42 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 0c52e5e..fd43e89 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs @@ -171,6 +171,8 @@ namespace OpenSim.Framework.Communications.Capabilities m_capsHandlers["UpdateScriptAgentInventory"] = m_capsHandlers["UpdateNotecardAgentInventory"]; m_capsHandlers["UpdateScriptTaskInventory"] = new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory); + m_capsHandlers["UpdateScriptAgent"] = m_capsHandlers["UpdateScriptAgentInventory"]; + m_capsHandlers["UpdateScriptTask"] = m_capsHandlers["UpdateScriptTaskInventory"]; // justincc: I've disabled the CAPS service for now to fix problems with selecting textures, and // subsequent inventory breakage, in the edit object pane (such as mantis 1085). This requires diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs index 93ee4f8..1e7eb59 100644 --- a/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs +++ b/OpenSim/Region/Environment/Modules/Framework/EventQueueHelper.cs @@ -146,6 +146,23 @@ namespace OpenSim.Region.Environment return buildEvent("TeleportFinish", body); } + public static LLSD ScriptRunningReplyEvent(UUID objectID, UUID itemID, bool running, bool mono) + { + LLSDMap script = new LLSDMap(); + script.Add("ObjectID", LLSD.FromUUID(objectID)); + script.Add("ItemID", LLSD.FromUUID(itemID)); + script.Add("Running", LLSD.FromBoolean(running)); + script.Add("Mono", LLSD.FromBoolean(mono)); + + LLSDArray scriptArr = new LLSDArray(); + scriptArr.Add(script); + + LLSDMap body = new LLSDMap(); + body.Add("Script", scriptArr); + + return buildEvent("ScriptRunningReply", body); + } + public static LLSD KeepAliveEvent() { return buildEvent("FAKEEVENT", new LLSDMap()); diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs index 1c1d42f..d3269e1 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs @@ -32,6 +32,7 @@ using log4net; using Nini.Config; using OpenSim.Region.Interfaces; using OpenSim.Framework; +using OpenSim.Region.Environment; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; using OpenSim.Region.ScriptEngine.Interfaces; @@ -369,8 +370,17 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine if (id == null) return; - controllingClient.SendScriptRunningReply(objectID, itemID, - id.Running); + IEventQueue eq = World.RequestModuleInterface(); + if (eq == null) + { + controllingClient.SendScriptRunningReply(objectID, itemID, + id.Running); + } + else + { + eq.Enqueue(EventQueueHelper.ScriptRunningReplyEvent(objectID, itemID, id.Running, true), + controllingClient.AgentId); + } } public IScriptApi GetApi(UUID itemID, string name) diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 9b78d53..86dc824 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -972,8 +972,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine IScriptInstance instance = GetInstance(itemID); if (instance == null) return; - controllingClient.SendScriptRunningReply(objectID, itemID, - GetScriptState(itemID)); + IEventQueue eq = World.RequestModuleInterface(); + if (eq == null) + { + controllingClient.SendScriptRunningReply(objectID, itemID, + GetScriptState(itemID)); + } + else + { + eq.Enqueue(EventQueueHelper.ScriptRunningReplyEvent(objectID, itemID, GetScriptState(itemID), true), + controllingClient.AgentId); + } } } } -- cgit v1.1