Trigger event when prims are scheduled for an update. This gives modules early access to changed parameters.

iar_mods
Dan Lake 2012-01-19 03:06:35 -08:00
parent 5ced49aaa8
commit e41f23dead
2 changed files with 28 additions and 0 deletions

View File

@ -398,6 +398,9 @@ namespace OpenSim.Region.Framework.Scenes
public event SceneObjectPartCopyDelegate OnSceneObjectPartCopy; public event SceneObjectPartCopyDelegate OnSceneObjectPartCopy;
public delegate void SceneObjectPartCopyDelegate(SceneObjectPart copy, SceneObjectPart original, bool userExposed); public delegate void SceneObjectPartCopyDelegate(SceneObjectPart copy, SceneObjectPart original, bool userExposed);
public delegate void SceneObjectPartUpdated(SceneObjectPart sop);
public event SceneObjectPartUpdated OnSceneObjectPartUpdated;
public delegate void RegionUp(GridRegion region); public delegate void RegionUp(GridRegion region);
public event RegionUp OnRegionUp; public event RegionUp OnRegionUp;
@ -2203,6 +2206,27 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void TriggerSceneObjectPartUpdated(SceneObjectPart sop)
{
SceneObjectPartUpdated handler = OnSceneObjectPartUpdated;
if (handler != null)
{
foreach (SceneObjectPartUpdated d in handler.GetInvocationList())
{
try
{
d(sop);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[EVENT MANAGER]: Delegate for TriggerSceneObjectPartUpdated failed - continuing. {0} {1}",
e.Message, e.StackTrace);
}
}
}
}
public void TriggerOnParcelPropertiesUpdateRequest(LandUpdateArgs args, public void TriggerOnParcelPropertiesUpdateRequest(LandUpdateArgs args,
int local_id, IClientAPI remote_client) int local_id, IClientAPI remote_client)
{ {

View File

@ -2733,6 +2733,8 @@ namespace OpenSim.Region.Framework.Scenes
if (ParentGroup == null) if (ParentGroup == null)
return; return;
ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this);
ParentGroup.QueueForUpdateCheck(); ParentGroup.QueueForUpdateCheck();
int timeNow = Util.UnixTimeSinceEpoch(); int timeNow = Util.UnixTimeSinceEpoch();
@ -2765,6 +2767,8 @@ namespace OpenSim.Region.Framework.Scenes
if (ParentGroup == null) if (ParentGroup == null)
return; return;
ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this);
// This was pulled from SceneViewer. Attachments always receive full updates. // This was pulled from SceneViewer. Attachments always receive full updates.
// I could not verify if this is a requirement but this maintains existing behavior // I could not verify if this is a requirement but this maintains existing behavior
if (ParentGroup.IsAttachment) if (ParentGroup.IsAttachment)