From b3c6920328778c162902d0278848f02e54413978 Mon Sep 17 00:00:00 2001
From: MW
Date: Mon, 13 Aug 2007 20:11:35 +0000
Subject: added Sample  OnObjectGrab event to SceneEventManager for script
 engines to subscribe to.

---
 OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs |  5 +++++
 OpenSim/Region/Environment/Scenes/Scene.cs                |  2 ++
 OpenSim/Region/Environment/Scenes/SceneEvents.cs          | 10 ++++++++++
 3 files changed, 17 insertions(+)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index 4ea5f20..72dc9c0 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -740,5 +740,10 @@ namespace OpenSim.Region.Environment.Scenes
         {
 
         }
+
+        public void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
+        {
+            this.EventManager.TriggerObjectGrab(localID, offsetPos, remoteClient);
+        }
     }
 }
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 08722a0..8ee5856 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -612,6 +612,8 @@ namespace OpenSim.Region.Environment.Scenes
             //client.OnCreateNewInventoryFolder += commsManager.UserProfiles.HandleCreateInventoryFolder;
             client.OnFetchInventoryDescendents += commsManager.UserProfiles.HandleFecthInventoryDescendents;
             client.OnRequestTaskInventory += RequestTaskInventory;
+
+            client.OnGrabObject += ProcessObjectGrab;
         }
 
         protected ScenePresence CreateAndAddScenePresence(IClientAPI client)
diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
index 1df95cf..cb5a967 100644
--- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
@@ -1,4 +1,5 @@
 using libsecondlife;
+using OpenSim.Framework.Interfaces;
 
 namespace OpenSim.Region.Environment.Scenes
 {
@@ -31,6 +32,9 @@ namespace OpenSim.Region.Environment.Scenes
         public delegate void OnShutdownDelegate();
         public event OnShutdownDelegate OnShutdown;
 
+        public delegate void ObjectGrabDelegate(uint localID, LLVector3 offsetPos, IClientAPI remoteClient);
+        public event ObjectGrabDelegate OnObjectGrab;
+
         public void TriggerOnScriptConsole(string[] args)
         {
             if (OnScriptConsole != null)
@@ -87,5 +91,11 @@ namespace OpenSim.Region.Environment.Scenes
             if (OnShutdown != null)
                 OnShutdown();
         }
+
+        public void TriggerObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
+        {
+            if (OnObjectGrab != null)
+                OnObjectGrab(localID, offsetPos, remoteClient);
+        }
     }
 }
-- 
cgit v1.1