diff options
author | John Hurliman | 2009-10-18 20:24:20 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-18 20:24:20 -0700 |
commit | 233e16b99cc80190d41143ecdfe01308eb39932a (patch) | |
tree | 340a75427ec8fc9082a0f543021dbfebacdb3033 /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | * Process the avatar terse update priority queue as soon as an update for our... (diff) | |
download | opensim-SC_OLD-233e16b99cc80190d41143ecdfe01308eb39932a.zip opensim-SC_OLD-233e16b99cc80190d41143ecdfe01308eb39932a.tar.gz opensim-SC_OLD-233e16b99cc80190d41143ecdfe01308eb39932a.tar.bz2 opensim-SC_OLD-233e16b99cc80190d41143ecdfe01308eb39932a.tar.xz |
* Rewrote the methods that build ObjectUpdate and ImprovedTerseObjectUpdate packets to fill in the data more accurately and avoid allocating memory that is immediately thrown away
* Changed the Send*Data structs in IClientAPI to use public readonly members instead of private members and getters
* Made Parallel.ProcessorCount public
* Started switching over packet building methods in LLClientView to use Util.StringToBytes[256/1024]() instead of Utils.StringToBytes()
* More cleanup of the ScenePresences vs. ClientManager nightmare
* ScenePresence.HandleAgentUpdate() will now time out and drop incoming AgentUpdate packets after three seconds. This fixes a deadlock on m_AgentUpdates that was blocking up the LLUDP server
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 22 |
1 files changed, 13 insertions, 9 deletions
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() |