aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorDan Lake2012-05-08 16:05:34 -0700
committerDan Lake2012-05-08 16:05:34 -0700
commit20952c75c526180a0286fb9634b94ac1354a2770 (patch)
treeb8724d1e7187220e9ab0d3365afb6fe26aa6e50a /OpenSim/Region/Framework
parentAdd automated TestllBreakLink() (diff)
downloadopensim-SC_OLD-20952c75c526180a0286fb9634b94ac1354a2770.zip
opensim-SC_OLD-20952c75c526180a0286fb9634b94ac1354a2770.tar.gz
opensim-SC_OLD-20952c75c526180a0286fb9634b94ac1354a2770.tar.bz2
opensim-SC_OLD-20952c75c526180a0286fb9634b94ac1354a2770.tar.xz
Trigger event when scene presences are updated
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs24
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs10
2 files changed, 34 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index b3debb0..ace8313 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -480,6 +480,9 @@ namespace OpenSim.Region.Framework.Scenes
480 public delegate void SceneObjectPartUpdated(SceneObjectPart sop); 480 public delegate void SceneObjectPartUpdated(SceneObjectPart sop);
481 public event SceneObjectPartUpdated OnSceneObjectPartUpdated; 481 public event SceneObjectPartUpdated OnSceneObjectPartUpdated;
482 482
483 public delegate void ScenePresenceUpdated(ScenePresence sp);
484 public event ScenePresenceUpdated OnScenePresenceUpdated;
485
483 public delegate void RegionUp(GridRegion region); 486 public delegate void RegionUp(GridRegion region);
484 public event RegionUp OnRegionUp; 487 public event RegionUp OnRegionUp;
485 488
@@ -2343,6 +2346,27 @@ namespace OpenSim.Region.Framework.Scenes
2343 } 2346 }
2344 } 2347 }
2345 2348
2349 public void TriggerScenePresenceUpdated(ScenePresence sp)
2350 {
2351 ScenePresenceUpdated handler = OnScenePresenceUpdated;
2352 if (handler != null)
2353 {
2354 foreach (ScenePresenceUpdated d in handler.GetInvocationList())
2355 {
2356 try
2357 {
2358 d(sp);
2359 }
2360 catch (Exception e)
2361 {
2362 m_log.ErrorFormat(
2363 "[EVENT MANAGER]: Delegate for TriggerScenePresenceUpdated failed - continuing. {0} {1}",
2364 e.Message, e.StackTrace);
2365 }
2366 }
2367 }
2368 }
2369
2346 public void TriggerOnParcelPropertiesUpdateRequest(LandUpdateArgs args, 2370 public void TriggerOnParcelPropertiesUpdateRequest(LandUpdateArgs args,
2347 int local_id, IClientAPI remote_client) 2371 int local_id, IClientAPI remote_client)
2348 { 2372 {
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 7e49a5e..c552447 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -76,6 +76,11 @@ namespace OpenSim.Region.Framework.Scenes
76// { 76// {
77// m_log.Debug("[SCENE PRESENCE] Destructor called"); 77// m_log.Debug("[SCENE PRESENCE] Destructor called");
78// } 78// }
79 private void TriggerScenePresenceUpdated()
80 {
81 if (m_scene != null)
82 m_scene.EventManager.TriggerScenePresenceUpdated(this);
83 }
79 84
80 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 85 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
81 86
@@ -489,6 +494,7 @@ namespace OpenSim.Region.Framework.Scenes
489 //m_log.DebugFormat( 494 //m_log.DebugFormat(
490 // "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}", 495 // "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}",
491 // Scene.RegionInfo.RegionName, Name, m_pos); 496 // Scene.RegionInfo.RegionName, Name, m_pos);
497 TriggerScenePresenceUpdated();
492 } 498 }
493 } 499 }
494 500
@@ -508,6 +514,7 @@ namespace OpenSim.Region.Framework.Scenes
508 return; 514 return;
509 515
510 m_pos = value; 516 m_pos = value;
517 TriggerScenePresenceUpdated();
511 } 518 }
512 } 519 }
513 520
@@ -1523,6 +1530,7 @@ namespace OpenSim.Region.Framework.Scenes
1523 } 1530 }
1524 1531
1525 m_scene.EventManager.TriggerOnClientMovement(this); 1532 m_scene.EventManager.TriggerOnClientMovement(this);
1533 TriggerScenePresenceUpdated();
1526 } 1534 }
1527 1535
1528 /// <summary> 1536 /// <summary>
@@ -2419,6 +2427,7 @@ namespace OpenSim.Region.Framework.Scenes
2419 2427
2420 m_scene.ForEachClient(SendTerseUpdateToClient); 2428 m_scene.ForEachClient(SendTerseUpdateToClient);
2421 } 2429 }
2430 TriggerScenePresenceUpdated();
2422 } 2431 }
2423 2432
2424 public void SendCoarseLocations(List<Vector3> coarseLocations, List<UUID> avatarUUIDs) 2433 public void SendCoarseLocations(List<Vector3> coarseLocations, List<UUID> avatarUUIDs)
@@ -3195,6 +3204,7 @@ namespace OpenSim.Region.Framework.Scenes
3195 Velocity = force; 3204 Velocity = force;
3196 3205
3197 m_forceToApply = null; 3206 m_forceToApply = null;
3207 TriggerScenePresenceUpdated();
3198 } 3208 }
3199 } 3209 }
3200 3210