aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs59
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs22
2 files changed, 72 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 6d8d481..32a2deb 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -2771,6 +2771,65 @@ namespace OpenSim.Region.Environment.Scenes
2771 m_eventManager.TriggerOnScriptChangedEvent(localID, change); 2771 m_eventManager.TriggerOnScriptChangedEvent(localID, change);
2772 } 2772 }
2773 2773
2774 public bool pipeEventsForScript(uint localID)
2775 {
2776 SceneObjectPart part = GetSceneObjectPart(localID);
2777 if (part != null)
2778 {
2779 LLVector3 pos = part.GetWorldPosition();
2780 ILandObject parcel = LandChannel.getLandObject(pos.X, pos.Y);
2781 if (parcel != null)
2782 {
2783 if ((parcel.landData.landFlags & (uint)Parcel.ParcelFlags.AllowOtherScripts) != 0)
2784 {
2785 return true;
2786 }
2787 else if ((parcel.landData.landFlags & (uint)Parcel.ParcelFlags.AllowGroupScripts) != 0)
2788 {
2789 if (part.OwnerID == parcel.landData.ownerID || (parcel.landData.isGroupOwned && part.GroupID == parcel.landData.groupID) || PermissionsMngr.GenericEstatePermission(part.OwnerID))
2790 {
2791 return true;
2792 }
2793 else
2794 {
2795 return false;
2796 }
2797 }
2798 else
2799 {
2800 if (part.OwnerID == parcel.landData.ownerID)
2801 {
2802 return true;
2803 }
2804 else
2805 {
2806 return false;
2807 }
2808 }
2809 }
2810 else
2811 {
2812
2813 if (pos.X > 0f && pos.X < Constants.RegionSize && pos.Y > 0f && pos.Y < Constants.RegionSize)
2814 {
2815 // The only time parcel != null when an object is inside a region is when
2816 // there is nothing behind the landchannel. IE, no land plugin loaded.
2817 return true;
2818 }
2819 else
2820 {
2821 // The object is outside of this region. Stop piping events to it.
2822 return false;
2823 }
2824 }
2825
2826 }
2827 else
2828 {
2829 return false;
2830 }
2831 }
2832
2774 #endregion 2833 #endregion
2775 2834
2776 #region InnerScene wrapper methods 2835 #region InnerScene wrapper methods
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs
index d77f698..30b3e8f 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs
@@ -272,15 +272,19 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
272 // + ", QIS.functionName: " + 272 // + ", QIS.functionName: " +
273 // QIS.functionName); 273 // QIS.functionName);
274#endif 274#endif
275 LastExecutionStarted = DateTime.Now.Ticks; 275 // Only pipe event if land supports it.
276 KillCurrentScript = false; 276 if (m_ScriptEngine.World.pipeEventsForScript(QIS.localID))
277 InExecution = true; 277 {
278 m_ScriptEngine.m_ScriptManager.ExecuteEvent(QIS.localID, 278 LastExecutionStarted = DateTime.Now.Ticks;
279 QIS.itemID, 279 KillCurrentScript = false;
280 QIS.functionName, 280 InExecution = true;
281 QIS.llDetectParams, 281 m_ScriptEngine.m_ScriptManager.ExecuteEvent(QIS.localID,
282 QIS.param); 282 QIS.itemID,
283 InExecution = false; 283 QIS.functionName,
284 QIS.llDetectParams,
285 QIS.param);
286 InExecution = false;
287 }
284 } 288 }
285 catch (Exception e) 289 catch (Exception e)
286 { 290 {