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. --- .../Region/Environment/Interfaces/IScriptModule.cs | 38 ---------------------- OpenSim/Region/Environment/Scenes/EventManager.cs | 11 +++++++ .../Region/Environment/Scenes/Scene.Inventory.cs | 19 +++++------ 3 files changed, 19 insertions(+), 49 deletions(-) delete mode 100644 OpenSim/Region/Environment/Interfaces/IScriptModule.cs (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Interfaces/IScriptModule.cs b/OpenSim/Region/Environment/Interfaces/IScriptModule.cs deleted file mode 100644 index efe7944..0000000 --- a/OpenSim/Region/Environment/Interfaces/IScriptModule.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSim Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using OpenSim.Framework; -using OpenMetaverse; - -namespace OpenSim.Region.Environment.Interfaces -{ - public interface IScriptModule : IRegionModule - { - bool GetScriptRunning(UUID objectID, UUID itemID); - } -} diff --git a/OpenSim/Region/Environment/Scenes/EventManager.cs b/OpenSim/Region/Environment/Scenes/EventManager.cs index 42cbdfc..87f3de1 100644 --- a/OpenSim/Region/Environment/Scenes/EventManager.cs +++ b/OpenSim/Region/Environment/Scenes/EventManager.cs @@ -192,6 +192,8 @@ namespace OpenSim.Region.Environment.Scenes public event ScriptTimerEvent OnScriptTimerEvent; public delegate void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour); + public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID); + public event EstateToolsTimeUpdate OnEstateToolsTimeUpdate; public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj); @@ -211,6 +213,7 @@ namespace OpenSim.Region.Environment.Scenes public delegate void ParcelPrimCountTainted(); public event ParcelPrimCountTainted OnParcelPrimCountTainted; + public event GetScriptRunning OnGetScriptRunning; /// /// RegisterCapsEvent is called by Scene after the Caps object @@ -368,9 +371,17 @@ namespace OpenSim.Region.Environment.Scenes private ScriptColliding handlerCollidingStart = null; private ScriptColliding handlerColliding = null; private ScriptColliding handlerCollidingEnd = null; + private GetScriptRunning handlerGetScriptRunning = null; private SunLindenHour handlerSunGetLindenHour = null; + public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) + { + handlerGetScriptRunning = OnGetScriptRunning; + if (handlerGetScriptRunning != null) + handlerGetScriptRunning(controllingClient, objectID, itemID); + } + public void TriggerOnScriptChangedEvent(uint localID, uint change) { handlerScriptChangedEvent = OnScriptChangedEvent; diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 015b140..2a9be81 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -445,7 +445,6 @@ namespace OpenSim.Region.Environment.Scenes } else { - Console.WriteLine("Non-Prim item ==>"); itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions; } @@ -896,6 +895,9 @@ namespace OpenSim.Region.Environment.Scenes if (group != null) { TaskInventoryItem item = group.GetInventoryItem(localID, itemID); + if (item == null) + return; + if (item.Type == 10) { EventManager.TriggerRemoveScript(localID, itemID); @@ -2311,16 +2313,6 @@ System.Console.WriteLine("Item asset {0}, request asset {1}", prevItem.AssetID.T } - public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) - { - IScriptModule scriptModule = RequestModuleInterface(); - if (scriptModule == null) - return; - - controllingClient.SendScriptRunningReply(objectID, itemID, - scriptModule.GetScriptRunning(objectID, itemID)); - } - public void SetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID, bool running) { SceneObjectPart part = GetSceneObjectPart(objectID); @@ -2388,5 +2380,10 @@ System.Console.WriteLine("Item asset {0}, request asset {1}", prevItem.AssetID.T } m_innerScene.DetachSingleAttachmentToInv(itemID, remoteClient); } + + public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) + { + EventManager.TriggerGetScriptRunning(controllingClient, objectID, itemID); + } } } -- cgit v1.1