diff options
author | Dan Lake | 2012-01-19 03:06:35 -0800 |
---|---|---|
committer | Dan Lake | 2012-01-19 03:06:35 -0800 |
commit | e41f23dead25356eb3e4bd37a5ef84c73e07336f (patch) | |
tree | f8d88cb4307ea6ac6713c8a6bf6c919fffbb8ae8 /OpenSim | |
parent | Cleaned up Color and Text parameters in SOP and made LocalFlags public for mo... (diff) | |
download | opensim-SC_OLD-e41f23dead25356eb3e4bd37a5ef84c73e07336f.zip opensim-SC_OLD-e41f23dead25356eb3e4bd37a5ef84c73e07336f.tar.gz opensim-SC_OLD-e41f23dead25356eb3e4bd37a5ef84c73e07336f.tar.bz2 opensim-SC_OLD-e41f23dead25356eb3e4bd37a5ef84c73e07336f.tar.xz |
Trigger event when prims are scheduled for an update. This gives modules early access to changed parameters.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 24 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 4 |
2 files changed, 28 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index fd35c62..3d96f40 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -398,6 +398,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
398 | public event SceneObjectPartCopyDelegate OnSceneObjectPartCopy; | 398 | public event SceneObjectPartCopyDelegate OnSceneObjectPartCopy; |
399 | public delegate void SceneObjectPartCopyDelegate(SceneObjectPart copy, SceneObjectPart original, bool userExposed); | 399 | public delegate void SceneObjectPartCopyDelegate(SceneObjectPart copy, SceneObjectPart original, bool userExposed); |
400 | 400 | ||
401 | public delegate void SceneObjectPartUpdated(SceneObjectPart sop); | ||
402 | public event SceneObjectPartUpdated OnSceneObjectPartUpdated; | ||
403 | |||
401 | public delegate void RegionUp(GridRegion region); | 404 | public delegate void RegionUp(GridRegion region); |
402 | public event RegionUp OnRegionUp; | 405 | public event RegionUp OnRegionUp; |
403 | 406 | ||
@@ -2203,6 +2206,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
2203 | } | 2206 | } |
2204 | } | 2207 | } |
2205 | 2208 | ||
2209 | public void TriggerSceneObjectPartUpdated(SceneObjectPart sop) | ||
2210 | { | ||
2211 | SceneObjectPartUpdated handler = OnSceneObjectPartUpdated; | ||
2212 | if (handler != null) | ||
2213 | { | ||
2214 | foreach (SceneObjectPartUpdated d in handler.GetInvocationList()) | ||
2215 | { | ||
2216 | try | ||
2217 | { | ||
2218 | d(sop); | ||
2219 | } | ||
2220 | catch (Exception e) | ||
2221 | { | ||
2222 | m_log.ErrorFormat( | ||
2223 | "[EVENT MANAGER]: Delegate for TriggerSceneObjectPartUpdated failed - continuing. {0} {1}", | ||
2224 | e.Message, e.StackTrace); | ||
2225 | } | ||
2226 | } | ||
2227 | } | ||
2228 | } | ||
2229 | |||
2206 | public void TriggerOnParcelPropertiesUpdateRequest(LandUpdateArgs args, | 2230 | public void TriggerOnParcelPropertiesUpdateRequest(LandUpdateArgs args, |
2207 | int local_id, IClientAPI remote_client) | 2231 | int local_id, IClientAPI remote_client) |
2208 | { | 2232 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a70c8fa..8e59abf 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2733,6 +2733,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2733 | if (ParentGroup == null) | 2733 | if (ParentGroup == null) |
2734 | return; | 2734 | return; |
2735 | 2735 | ||
2736 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); | ||
2737 | |||
2736 | ParentGroup.QueueForUpdateCheck(); | 2738 | ParentGroup.QueueForUpdateCheck(); |
2737 | 2739 | ||
2738 | int timeNow = Util.UnixTimeSinceEpoch(); | 2740 | int timeNow = Util.UnixTimeSinceEpoch(); |
@@ -2765,6 +2767,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2765 | if (ParentGroup == null) | 2767 | if (ParentGroup == null) |
2766 | return; | 2768 | return; |
2767 | 2769 | ||
2770 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this); | ||
2771 | |||
2768 | // This was pulled from SceneViewer. Attachments always receive full updates. | 2772 | // This was pulled from SceneViewer. Attachments always receive full updates. |
2769 | // I could not verify if this is a requirement but this maintains existing behavior | 2773 | // I could not verify if this is a requirement but this maintains existing behavior |
2770 | if (ParentGroup.IsAttachment) | 2774 | if (ParentGroup.IsAttachment) |