aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs21
1 files changed, 16 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 20ec72e..c9c24fe 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -328,17 +328,28 @@ namespace OpenSim.Region.Environment.Scenes
328 if (m_updateTimes.ContainsKey(part.UUID)) 328 if (m_updateTimes.ContainsKey(part.UUID))
329 { 329 {
330 ScenePartUpdate update = m_updateTimes[part.UUID]; 330 ScenePartUpdate update = m_updateTimes[part.UUID];
331 if (update.LastFullUpdateTime < part.TimeStampFull) 331
332 // Two updates can occur with the same timestamp (especially
333 // since our timestamp resolution is to the nearest second). The first
334 // could have been sent in the last update - we still need to send the
335 // second here.
336 if (update.LastFullUpdateTime <= part.TimeStampFull)
332 { 337 {
333 //need to do a full update 338 //need to do a full update
334 part.SendFullUpdate(ControllingClient); 339 part.SendFullUpdate(ControllingClient);
335 update.LastFullUpdateTime = (uint) Util.UnixTimeSinceEpoch(); 340
341 // We'll update to the part's timestamp rather than the current to
342 // avoid the race condition whereby the next tick occurs while we are
343 // doing this update. If this happened, then subsequent updates which occurred
344 // on the same tick or the next tick of the last update would be ignored.
345 update.LastFullUpdateTime = part.TimeStampFull;
346
336 updateCount++; 347 updateCount++;
337 } 348 }
338 else if (update.LastTerseUpdateTime < part.TimeStampTerse) 349 else if (update.LastTerseUpdateTime <= part.TimeStampTerse)
339 { 350 {
340 part.SendTerseUpdate(ControllingClient); 351 part.SendTerseUpdate(ControllingClient);
341 update.LastTerseUpdateTime = (uint) Util.UnixTimeSinceEpoch(); 352 update.LastTerseUpdateTime = part.TimeStampTerse;
342 updateCount++; 353 updateCount++;
343 } 354 }
344 } 355 }
@@ -348,7 +359,7 @@ namespace OpenSim.Region.Environment.Scenes
348 part.SendFullUpdate(ControllingClient); 359 part.SendFullUpdate(ControllingClient);
349 ScenePartUpdate update = new ScenePartUpdate(); 360 ScenePartUpdate update = new ScenePartUpdate();
350 update.FullID = part.UUID; 361 update.FullID = part.UUID;
351 update.LastFullUpdateTime = (uint) Util.UnixTimeSinceEpoch(); 362 update.LastFullUpdateTime = part.TimeStampFull;
352 m_updateTimes.Add(part.UUID, update); 363 m_updateTimes.Add(part.UUID, update);
353 updateCount++; 364 updateCount++;
354 } 365 }