diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 35 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 22 |
3 files changed, 27 insertions, 36 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 30fe976..70b11c3 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -357,13 +357,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
357 | get { return m_defaultScriptEngine; } | 357 | get { return m_defaultScriptEngine; } |
358 | } | 358 | } |
359 | 359 | ||
360 | // Reference to all of the agents in the scene (root and child) | ||
361 | protected Dictionary<UUID, ScenePresence> m_scenePresences | ||
362 | { | ||
363 | get { return m_sceneGraph.ScenePresences; } | ||
364 | set { m_sceneGraph.ScenePresences = value; } | ||
365 | } | ||
366 | |||
367 | public EntityManager Entities | 360 | public EntityManager Entities |
368 | { | 361 | { |
369 | get { return m_sceneGraph.Entities; } | 362 | get { return m_sceneGraph.Entities; } |
@@ -1183,14 +1176,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1183 | /// <param name="stats">Stats on the Simulator's performance</param> | 1176 | /// <param name="stats">Stats on the Simulator's performance</param> |
1184 | private void SendSimStatsPackets(SimStats stats) | 1177 | private void SendSimStatsPackets(SimStats stats) |
1185 | { | 1178 | { |
1186 | List<ScenePresence> StatSendAgents = GetScenePresences(); | 1179 | ForEachScenePresence( |
1187 | foreach (ScenePresence agent in StatSendAgents) | 1180 | delegate(ScenePresence agent) |
1188 | { | ||
1189 | if (!agent.IsChildAgent) | ||
1190 | { | 1181 | { |
1191 | agent.ControllingClient.SendSimStats(stats); | 1182 | if (!agent.IsChildAgent) |
1183 | agent.ControllingClient.SendSimStats(stats); | ||
1192 | } | 1184 | } |
1193 | } | 1185 | ); |
1194 | } | 1186 | } |
1195 | 1187 | ||
1196 | /// <summary> | 1188 | /// <summary> |
@@ -3501,10 +3493,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3501 | { | 3493 | { |
3502 | ScenePresence presence; | 3494 | ScenePresence presence; |
3503 | 3495 | ||
3504 | lock (m_scenePresences) | 3496 | lock (m_sceneGraph.ScenePresences) |
3505 | { | 3497 | m_sceneGraph.ScenePresences.TryGetValue(agentID, out presence); |
3506 | m_scenePresences.TryGetValue(agentID, out presence); | ||
3507 | } | ||
3508 | 3498 | ||
3509 | if (presence != null) | 3499 | if (presence != null) |
3510 | { | 3500 | { |
@@ -3714,12 +3704,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3714 | public void RequestTeleportLocation(IClientAPI remoteClient, ulong regionHandle, Vector3 position, | 3704 | public void RequestTeleportLocation(IClientAPI remoteClient, ulong regionHandle, Vector3 position, |
3715 | Vector3 lookAt, uint teleportFlags) | 3705 | Vector3 lookAt, uint teleportFlags) |
3716 | { | 3706 | { |
3717 | ScenePresence sp = null; | 3707 | ScenePresence sp; |
3718 | lock (m_scenePresences) | 3708 | lock (m_sceneGraph.ScenePresences) |
3719 | { | 3709 | m_sceneGraph.ScenePresences.TryGetValue(remoteClient.AgentId, out sp); |
3720 | if (m_scenePresences.ContainsKey(remoteClient.AgentId)) | ||
3721 | sp = m_scenePresences[remoteClient.AgentId]; | ||
3722 | } | ||
3723 | 3710 | ||
3724 | if (sp != null) | 3711 | if (sp != null) |
3725 | { | 3712 | { |
@@ -4168,7 +4155,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4168 | public void ForEachScenePresence(Action<ScenePresence> action) | 4155 | public void ForEachScenePresence(Action<ScenePresence> action) |
4169 | { | 4156 | { |
4170 | // We don't want to try to send messages if there are no avatars. | 4157 | // We don't want to try to send messages if there are no avatars. |
4171 | if (m_scenePresences != null) | 4158 | if (m_sceneGraph != null && m_sceneGraph.ScenePresences != null) |
4172 | { | 4159 | { |
4173 | try | 4160 | try |
4174 | { | 4161 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 79f6366..a078b3d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -3791,15 +3791,15 @@ if (m_shape != null) { | |||
3791 | if (ParentGroup.RootPart == this) | 3791 | if (ParentGroup.RootPart == this) |
3792 | lPos = AbsolutePosition; | 3792 | lPos = AbsolutePosition; |
3793 | } | 3793 | } |
3794 | 3794 | ||
3795 | // Causes this thread to dig into the Client Thread Data. | 3795 | // Causes this thread to dig into the Client Thread Data. |
3796 | // Remember your locking here! | 3796 | // Remember your locking here! |
3797 | remoteClient.SendPrimTerseUpdate(new SendPrimitiveTerseData(m_regionHandle, | 3797 | remoteClient.SendPrimTerseUpdate(new SendPrimitiveTerseData(m_regionHandle, |
3798 | (ushort)(m_parentGroup.GetTimeDilation() * | 3798 | (ushort)(m_parentGroup.GetTimeDilation() * |
3799 | (float)ushort.MaxValue), LocalId, lPos, | 3799 | (float)ushort.MaxValue), LocalId, lPos, |
3800 | RotationOffset, Velocity, | 3800 | RotationOffset, Velocity, Acceleration, |
3801 | RotationalVelocity, state, FromItemID, | 3801 | RotationalVelocity, state, FromItemID, |
3802 | OwnerID, (int)AttachmentPoint, ParentGroup.GetUpdatePriority(remoteClient))); | 3802 | OwnerID, (int)AttachmentPoint, null, ParentGroup.GetUpdatePriority(remoteClient))); |
3803 | } | 3803 | } |
3804 | 3804 | ||
3805 | public void AddScriptLPS(int count) | 3805 | public void AddScriptLPS(int count) |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f05c3d8..bdd80c6 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1160,15 +1160,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
1160 | /// </summary> | 1160 | /// </summary> |
1161 | public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) | 1161 | public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) |
1162 | { | 1162 | { |
1163 | lock (m_agentUpdates) | 1163 | const int AGENT_UPDATE_TIMEOUT_MS = 1000 * 3; |
1164 | |||
1165 | if (System.Threading.Monitor.TryEnter(m_agentUpdates, AGENT_UPDATE_TIMEOUT_MS)) | ||
1164 | { | 1166 | { |
1165 | if (m_updatesAllowed) | 1167 | try |
1166 | { | 1168 | { |
1167 | RealHandleAgentUpdate(remoteClient, agentData); | 1169 | if (m_updatesAllowed) |
1168 | return; | 1170 | { |
1171 | RealHandleAgentUpdate(remoteClient, agentData); | ||
1172 | return; | ||
1173 | } | ||
1174 | |||
1175 | m_agentUpdates.Add(agentData); | ||
1169 | } | 1176 | } |
1170 | 1177 | finally { System.Threading.Monitor.Exit(m_agentUpdates); } | |
1171 | m_agentUpdates.Add(agentData); | ||
1172 | } | 1178 | } |
1173 | } | 1179 | } |
1174 | 1180 | ||
@@ -2471,7 +2477,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2471 | pos.Z -= m_appearance.HipOffset; | 2477 | pos.Z -= m_appearance.HipOffset; |
2472 | 2478 | ||
2473 | remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_regionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, | 2479 | remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_regionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, |
2474 | pos, m_velocity, m_rotation, m_uuid, GetUpdatePriority(remoteClient))); | 2480 | pos, m_velocity, Vector3.Zero, m_rotation, Vector4.Zero, m_uuid, null, GetUpdatePriority(remoteClient))); |
2475 | 2481 | ||
2476 | m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS); | 2482 | m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS); |
2477 | m_scene.StatsReporter.AddAgentUpdates(1); | 2483 | m_scene.StatsReporter.AddAgentUpdates(1); |
@@ -3504,7 +3510,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3504 | 3510 | ||
3505 | public void Close() | 3511 | public void Close() |
3506 | { | 3512 | { |
3507 | |||
3508 | lock (m_attachments) | 3513 | lock (m_attachments) |
3509 | { | 3514 | { |
3510 | // Delete attachments from scene | 3515 | // Delete attachments from scene |
@@ -3535,7 +3540,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3535 | m_sceneViewer.Close(); | 3540 | m_sceneViewer.Close(); |
3536 | 3541 | ||
3537 | RemoveFromPhysicalScene(); | 3542 | RemoveFromPhysicalScene(); |
3538 | GC.Collect(); | ||
3539 | } | 3543 | } |
3540 | 3544 | ||
3541 | public ScenePresence() | 3545 | public ScenePresence() |