diff options
author | John Hurliman | 2009-10-15 15:25:02 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-15 15:25:02 -0700 |
commit | d44b50ee462978b4899c0b142f6ecbfb553f06b6 (patch) | |
tree | 650046925796d20c18ed2e2028f951286d93662d /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-d44b50ee462978b4899c0b142f6ecbfb553f06b6.zip opensim-SC-d44b50ee462978b4899c0b142f6ecbfb553f06b6.tar.gz opensim-SC-d44b50ee462978b4899c0b142f6ecbfb553f06b6.tar.bz2 opensim-SC-d44b50ee462978b4899c0b142f6ecbfb553f06b6.tar.xz |
* 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)
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 31 |
1 files changed, 9 insertions, 22 deletions
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 | |||
1194 | } | 1194 | } |
1195 | 1195 | ||
1196 | /// <summary> | 1196 | /// <summary> |
1197 | /// Perform delegate action on all clients subscribing to updates from this region. | ||
1198 | /// </summary> | ||
1199 | /// <returns></returns> | ||
1200 | public void Broadcast(Action<IClientAPI> whatToDo) | ||
1201 | { | ||
1202 | ForEachScenePresence(delegate(ScenePresence presence) { whatToDo(presence.ControllingClient); }); | ||
1203 | } | ||
1204 | |||
1205 | /// <summary> | ||
1206 | /// Backup the scene. This acts as the main method of the backup thread. | 1197 | /// Backup the scene. This acts as the main method of the backup thread. |
1207 | /// </summary> | 1198 | /// </summary> |
1208 | /// <returns></returns> | 1199 | /// <returns></returns> |
@@ -3048,17 +3039,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3048 | } | 3039 | } |
3049 | 3040 | ||
3050 | m_eventManager.TriggerOnRemovePresence(agentID); | 3041 | m_eventManager.TriggerOnRemovePresence(agentID); |
3051 | Broadcast(delegate(IClientAPI client) | 3042 | ForEachClient( |
3052 | { | 3043 | delegate(IClientAPI client) |
3053 | try | 3044 | { |
3054 | { | 3045 | //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway |
3055 | client.SendKillObject(avatar.RegionHandle, avatar.LocalId); | 3046 | try { client.SendKillObject(avatar.RegionHandle, avatar.LocalId); } |
3056 | } | 3047 | catch (NullReferenceException) { } |
3057 | catch (NullReferenceException) | 3048 | }); |
3058 | { | ||
3059 | //We can safely ignore null reference exceptions. It means the avatar are dead and cleaned up anyway. | ||
3060 | } | ||
3061 | }); | ||
3062 | 3049 | ||
3063 | ForEachScenePresence( | 3050 | ForEachScenePresence( |
3064 | delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); | 3051 | delegate(ScenePresence presence) { presence.CoarseLocationChange(); }); |
@@ -3143,7 +3130,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3143 | return; | 3130 | return; |
3144 | } | 3131 | } |
3145 | } | 3132 | } |
3146 | Broadcast(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); }); | 3133 | ForEachClient(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); }); |
3147 | } | 3134 | } |
3148 | 3135 | ||
3149 | #endregion | 3136 | #endregion |
@@ -4211,7 +4198,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4211 | 4198 | ||
4212 | public void ForEachClient(Action<IClientAPI> action) | 4199 | public void ForEachClient(Action<IClientAPI> action) |
4213 | { | 4200 | { |
4214 | m_sceneGraph.ForEachClient(action); | 4201 | ClientManager.ForEach(action); |
4215 | } | 4202 | } |
4216 | 4203 | ||
4217 | public void ForEachSOG(Action<SceneObjectGroup> action) | 4204 | public void ForEachSOG(Action<SceneObjectGroup> action) |