aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Interfaces/IScriptModule.cs38
-rw-r--r--OpenSim/Region/Environment/Scenes/EventManager.cs11
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs19
3 files changed, 19 insertions, 49 deletions
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 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using OpenSim.Framework;
30using OpenMetaverse;
31
32namespace OpenSim.Region.Environment.Interfaces
33{
34 public interface IScriptModule : IRegionModule
35 {
36 bool GetScriptRunning(UUID objectID, UUID itemID);
37 }
38}
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
192 public event ScriptTimerEvent OnScriptTimerEvent; 192 public event ScriptTimerEvent OnScriptTimerEvent;
193 193
194 public delegate void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour); 194 public delegate void EstateToolsTimeUpdate(ulong regionHandle, bool FixedTime, bool EstateSun, float LindenHour);
195 public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID);
196
195 public event EstateToolsTimeUpdate OnEstateToolsTimeUpdate; 197 public event EstateToolsTimeUpdate OnEstateToolsTimeUpdate;
196 198
197 public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj); 199 public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj);
@@ -211,6 +213,7 @@ namespace OpenSim.Region.Environment.Scenes
211 213
212 public delegate void ParcelPrimCountTainted(); 214 public delegate void ParcelPrimCountTainted();
213 public event ParcelPrimCountTainted OnParcelPrimCountTainted; 215 public event ParcelPrimCountTainted OnParcelPrimCountTainted;
216 public event GetScriptRunning OnGetScriptRunning;
214 217
215 /// <summary> 218 /// <summary>
216 /// RegisterCapsEvent is called by Scene after the Caps object 219 /// RegisterCapsEvent is called by Scene after the Caps object
@@ -368,9 +371,17 @@ namespace OpenSim.Region.Environment.Scenes
368 private ScriptColliding handlerCollidingStart = null; 371 private ScriptColliding handlerCollidingStart = null;
369 private ScriptColliding handlerColliding = null; 372 private ScriptColliding handlerColliding = null;
370 private ScriptColliding handlerCollidingEnd = null; 373 private ScriptColliding handlerCollidingEnd = null;
374 private GetScriptRunning handlerGetScriptRunning = null;
371 375
372 private SunLindenHour handlerSunGetLindenHour = null; 376 private SunLindenHour handlerSunGetLindenHour = null;
373 377
378 public void TriggerGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)
379 {
380 handlerGetScriptRunning = OnGetScriptRunning;
381 if (handlerGetScriptRunning != null)
382 handlerGetScriptRunning(controllingClient, objectID, itemID);
383 }
384
374 public void TriggerOnScriptChangedEvent(uint localID, uint change) 385 public void TriggerOnScriptChangedEvent(uint localID, uint change)
375 { 386 {
376 handlerScriptChangedEvent = OnScriptChangedEvent; 387 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
445 } 445 }
446 else 446 else
447 { 447 {
448 Console.WriteLine("Non-Prim item ==>");
449 itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions; 448 itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
450 } 449 }
451 450
@@ -896,6 +895,9 @@ namespace OpenSim.Region.Environment.Scenes
896 if (group != null) 895 if (group != null)
897 { 896 {
898 TaskInventoryItem item = group.GetInventoryItem(localID, itemID); 897 TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
898 if (item == null)
899 return;
900
899 if (item.Type == 10) 901 if (item.Type == 10)
900 { 902 {
901 EventManager.TriggerRemoveScript(localID, itemID); 903 EventManager.TriggerRemoveScript(localID, itemID);
@@ -2311,16 +2313,6 @@ System.Console.WriteLine("Item asset {0}, request asset {1}", prevItem.AssetID.T
2311 2313
2312 } 2314 }
2313 2315
2314 public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)
2315 {
2316 IScriptModule scriptModule = RequestModuleInterface<IScriptModule>();
2317 if (scriptModule == null)
2318 return;
2319
2320 controllingClient.SendScriptRunningReply(objectID, itemID,
2321 scriptModule.GetScriptRunning(objectID, itemID));
2322 }
2323
2324 public void SetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID, bool running) 2316 public void SetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID, bool running)
2325 { 2317 {
2326 SceneObjectPart part = GetSceneObjectPart(objectID); 2318 SceneObjectPart part = GetSceneObjectPart(objectID);
@@ -2388,5 +2380,10 @@ System.Console.WriteLine("Item asset {0}, request asset {1}", prevItem.AssetID.T
2388 } 2380 }
2389 m_innerScene.DetachSingleAttachmentToInv(itemID, remoteClient); 2381 m_innerScene.DetachSingleAttachmentToInv(itemID, remoteClient);
2390 } 2382 }
2383
2384 public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)
2385 {
2386 EventManager.TriggerGetScriptRunning(controllingClient, objectID, itemID);
2387 }
2391 } 2388 }
2392} 2389}