From d44b50ee462978b4899c0b142f6ecbfb553f06b6 Mon Sep 17 00:00:00 2001
From: John Hurliman
Date: Thu, 15 Oct 2009 15:25:02 -0700
Subject: * Removed some of the redundant broadcast functions in Scene and
SceneGraph so it is clear who/what the broadcast is going to each time *
Removed two redundant parameters from SceneObjectPart * Changed some code in
terse update sending that was meant to work with references to work with
value types (since Vector3 and Quaternion are structs) * Committing a preview
of a new method for sending object updates efficiently (all commented out for
now)
---
OpenSim/Region/Framework/Scenes/Scene.cs | 31 +++++++++----------------------
1 file changed, 9 insertions(+), 22 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index d3d397d..d13d4fb 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1194,15 +1194,6 @@ namespace OpenSim.Region.Framework.Scenes
}
///
- /// Perform delegate action on all clients subscribing to updates from this region.
- ///
- ///
- public void Broadcast(Action whatToDo)
- {
- ForEachScenePresence(delegate(ScenePresence presence) { whatToDo(presence.ControllingClient); });
- }
-
- ///
/// Backup the scene. This acts as the main method of the backup thread.
///
///
@@ -3048,17 +3039,13 @@ namespace OpenSim.Region.Framework.Scenes
}
m_eventManager.TriggerOnRemovePresence(agentID);
- Broadcast(delegate(IClientAPI client)
- {
- try
- {
- client.SendKillObject(avatar.RegionHandle, avatar.LocalId);
- }
- catch (NullReferenceException)
- {
- //We can safely ignore null reference exceptions. It means the avatar are dead and cleaned up anyway.
- }
- });
+ ForEachClient(
+ delegate(IClientAPI client)
+ {
+ //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway
+ try { client.SendKillObject(avatar.RegionHandle, avatar.LocalId); }
+ catch (NullReferenceException) { }
+ });
ForEachScenePresence(
delegate(ScenePresence presence) { presence.CoarseLocationChange(); });
@@ -3143,7 +3130,7 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
}
- Broadcast(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); });
+ ForEachClient(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); });
}
#endregion
@@ -4211,7 +4198,7 @@ namespace OpenSim.Region.Framework.Scenes
public void ForEachClient(Action action)
{
- m_sceneGraph.ForEachClient(action);
+ ClientManager.ForEach(action);
}
public void ForEachSOG(Action action)
--
cgit v1.1