aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-28 03:21:53 -0700
committerJohn Hurliman2009-10-28 03:21:53 -0700
commitcdbeb8b83b671df1ffb6bf7890c64a27e4a85730 (patch)
tree41a471f57c5bc9e39dfbfacd169a7d3dda1122b1 /OpenSim/Region/Framework/Scenes/ScenePresence.cs
parentMarking ImprovedTerseObjectUpdate packets for avatars as unthrottled to test (diff)
downloadopensim-SC_OLD-cdbeb8b83b671df1ffb6bf7890c64a27e4a85730.zip
opensim-SC_OLD-cdbeb8b83b671df1ffb6bf7890c64a27e4a85730.tar.gz
opensim-SC_OLD-cdbeb8b83b671df1ffb6bf7890c64a27e4a85730.tar.bz2
opensim-SC_OLD-cdbeb8b83b671df1ffb6bf7890c64a27e4a85730.tar.xz
Track timestamps when terse updates were last sent for a prim or avatar to avoid floating away forever until a key is pressed (deviates from SL behavior in a hopefully good way)
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 87fac0c..92f00c4 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -96,6 +96,7 @@ namespace OpenSim.Region.Framework.Scenes
96 private Vector3 m_lastPosition; 96 private Vector3 m_lastPosition;
97 private Quaternion m_lastRotation; 97 private Quaternion m_lastRotation;
98 private Vector3 m_lastVelocity; 98 private Vector3 m_lastVelocity;
99 private int m_lastTerseSent;
99 100
100 private bool m_updateflag; 101 private bool m_updateflag;
101 private byte m_movementflag; 102 private byte m_movementflag;
@@ -2363,6 +2364,7 @@ namespace OpenSim.Region.Framework.Scenes
2363 { 2364 {
2364 const float VELOCITY_TOLERANCE = 0.01f; 2365 const float VELOCITY_TOLERANCE = 0.01f;
2365 const float POSITION_TOLERANCE = 10.0f; 2366 const float POSITION_TOLERANCE = 10.0f;
2367 const int TIME_MS_TOLERANCE = 3000;
2366 2368
2367 SendPrimUpdates(); 2369 SendPrimUpdates();
2368 2370
@@ -2377,7 +2379,8 @@ namespace OpenSim.Region.Framework.Scenes
2377 // Throw away duplicate or insignificant updates 2379 // Throw away duplicate or insignificant updates
2378 if (m_bodyRot != m_lastRotation || 2380 if (m_bodyRot != m_lastRotation ||
2379 (m_velocity - m_lastVelocity).Length() > VELOCITY_TOLERANCE || 2381 (m_velocity - m_lastVelocity).Length() > VELOCITY_TOLERANCE ||
2380 (m_pos - m_lastPosition).Length() > POSITION_TOLERANCE) 2382 (m_pos - m_lastPosition).Length() > POSITION_TOLERANCE ||
2383 Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
2381 { 2384 {
2382 SendTerseUpdateToAllClients(); 2385 SendTerseUpdateToAllClients();
2383 2386
@@ -2385,6 +2388,7 @@ namespace OpenSim.Region.Framework.Scenes
2385 m_lastPosition = m_pos; 2388 m_lastPosition = m_pos;
2386 m_lastRotation = m_bodyRot; 2389 m_lastRotation = m_bodyRot;
2387 m_lastVelocity = m_velocity; 2390 m_lastVelocity = m_velocity;
2391 m_lastTerseSent = Environment.TickCount;
2388 } 2392 }
2389 2393
2390 // followed suggestion from mic bowman. reversed the two lines below. 2394 // followed suggestion from mic bowman. reversed the two lines below.