diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 29 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 15 |
2 files changed, 29 insertions, 15 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 3b8d727..0a9a29e 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -350,6 +350,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
350 | /// </param> | 350 | /// </param> |
351 | public event SceneObjectPreSaveDelegate OnSceneObjectPreSave; | 351 | public event SceneObjectPreSaveDelegate OnSceneObjectPreSave; |
352 | public delegate void SceneObjectPreSaveDelegate(SceneObjectGroup persistingSo, SceneObjectGroup originalSo); | 352 | public delegate void SceneObjectPreSaveDelegate(SceneObjectGroup persistingSo, SceneObjectGroup originalSo); |
353 | |||
354 | /// <summary> | ||
355 | /// Called when a scene object part is cloned within the region. | ||
356 | /// </summary> | ||
357 | public event SceneObjectPartCopyDelegate OnSceneObjectPartCopy; | ||
358 | public delegate void SceneObjectPartCopyDelegate(SceneObjectPart copy, SceneObjectPart original); | ||
353 | 359 | ||
354 | public delegate void RegionUp(GridRegion region); | 360 | public delegate void RegionUp(GridRegion region); |
355 | public event RegionUp OnRegionUp; | 361 | public event RegionUp OnRegionUp; |
@@ -2073,6 +2079,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
2073 | } | 2079 | } |
2074 | } | 2080 | } |
2075 | } | 2081 | } |
2076 | } | 2082 | } |
2083 | |||
2084 | public void TriggerOnSceneObjectPartCopy(SceneObjectPart copy, SceneObjectPart original) | ||
2085 | { | ||
2086 | SceneObjectPartCopyDelegate handler = OnSceneObjectPartCopy; | ||
2087 | if (handler != null) | ||
2088 | { | ||
2089 | foreach (SceneObjectPartCopyDelegate d in handler.GetInvocationList()) | ||
2090 | { | ||
2091 | try | ||
2092 | { | ||
2093 | d(copy, original); | ||
2094 | } | ||
2095 | catch (Exception e) | ||
2096 | { | ||
2097 | m_log.ErrorFormat( | ||
2098 | "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing. {0} {1}", | ||
2099 | e.Message, e.StackTrace); | ||
2100 | } | ||
2101 | } | ||
2102 | } | ||
2103 | } | ||
2077 | } | 2104 | } |
2078 | } \ No newline at end of file | 2105 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 085da19..71ca605 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1617,20 +1617,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1617 | dupe.DoPhysicsPropertyUpdate(UsePhysics, true); | 1617 | dupe.DoPhysicsPropertyUpdate(UsePhysics, true); |
1618 | } | 1618 | } |
1619 | 1619 | ||
1620 | if (Shape.Media != null) | 1620 | ParentGroup.Scene.EventManager.TriggerOnSceneObjectPartCopy(dupe, this); |
1621 | { | ||
1622 | List<MediaEntry> dupeMedia = new List<MediaEntry>(); | ||
1623 | |||
1624 | foreach (MediaEntry me in Shape.Media) | ||
1625 | { | ||
1626 | if (me != null) | ||
1627 | dupeMedia.Add(MediaEntry.FromOSD(me.GetOSD())); | ||
1628 | else | ||
1629 | dupeMedia.Add(null); | ||
1630 | } | ||
1631 | |||
1632 | dupe.Shape.Media = dupeMedia; | ||
1633 | } | ||
1634 | 1621 | ||
1635 | // m_log.DebugFormat("[SCENE OBJECT PART]: Clone of {0} {1} finished", Name, UUID); | 1622 | // m_log.DebugFormat("[SCENE OBJECT PART]: Clone of {0} {1} finished", Name, UUID); |
1636 | 1623 | ||