aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-03-13 00:22:38 +0000
committerJustin Clarke Casey2008-03-13 00:22:38 +0000
commita4304fb9e6ec94b9a2aa70db85a68b9b102d4c33 (patch)
tree0b98401a00ff68bebdf2f7de385386e6a5060fff /OpenSim/Region/Environment/Scenes/ScenePresence.cs
parent* Updated LibSL _packets_.cs to latest revision. AKA New Packets. (diff)
downloadopensim-SC_OLD-a4304fb9e6ec94b9a2aa70db85a68b9b102d4c33.zip
opensim-SC_OLD-a4304fb9e6ec94b9a2aa70db85a68b9b102d4c33.tar.gz
opensim-SC_OLD-a4304fb9e6ec94b9a2aa70db85a68b9b102d4c33.tar.bz2
opensim-SC_OLD-a4304fb9e6ec94b9a2aa70db85a68b9b102d4c33.tar.xz
* Fix Mantis 761 (linking and delinking prims rapidly caused prims to 'disappear')
* Root cause was that if two updates occurred in the same second of time, the second one was never sent * Linking/delinking appears to be okay now
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs30
1 files changed, 20 insertions, 10 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index fc13ebb..2f35fe3 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -418,6 +418,10 @@ namespace OpenSim.Region.Environment.Scenes
418 418
419 #endregion 419 #endregion
420 420
421 /// <summary>
422 /// Add the part to the queue of parts for which we need to send an update to the client
423 /// </summary>
424 /// <param name="part"></param>
421 public void QueuePartForUpdate(SceneObjectPart part) 425 public void QueuePartForUpdate(SceneObjectPart part)
422 { 426 {
423 //if (InterestList.Contains(part.ParentGroup)) 427 //if (InterestList.Contains(part.ParentGroup))
@@ -434,6 +438,11 @@ namespace OpenSim.Region.Environment.Scenes
434 return m_scene.PermissionsMngr.GenerateClientFlags(m_uuid, ObjectID); 438 return m_scene.PermissionsMngr.GenerateClientFlags(m_uuid, ObjectID);
435 } 439 }
436 440
441 /// <summary>
442 /// Send updates to the client about prims which have been placed on the update queue. We don't
443 /// necessarily send updates for all the parts on the queue, e.g. if an updates with a more recent
444 /// timestamp has already been sent.
445 /// </summary>
437 public void SendPrimUpdates() 446 public void SendPrimUpdates()
438 { 447 {
439 // if (m_scene.QuadTree.GetNodeID(this.AbsolutePosition.X, this.AbsolutePosition.Y) != m_currentQuadNode) 448 // if (m_scene.QuadTree.GetNodeID(this.AbsolutePosition.X, this.AbsolutePosition.Y) != m_currentQuadNode)
@@ -446,13 +455,12 @@ namespace OpenSim.Region.Environment.Scenes
446 if (!m_gotAllObjectsInScene) 455 if (!m_gotAllObjectsInScene)
447 { 456 {
448 if (!m_isChildAgent || m_scene.m_seeIntoRegionFromNeighbor) 457 if (!m_isChildAgent || m_scene.m_seeIntoRegionFromNeighbor)
449 { 458 {
450
451 m_scene.SendAllSceneObjectsToClient(this); 459 m_scene.SendAllSceneObjectsToClient(this);
452 m_gotAllObjectsInScene = true; 460 m_gotAllObjectsInScene = true;
453
454 } 461 }
455 } 462 }
463
456 if (m_partsUpdateQueue.Count > 0) 464 if (m_partsUpdateQueue.Count > 0)
457 { 465 {
458 bool runUpdate = true; 466 bool runUpdate = true;
@@ -465,16 +473,18 @@ namespace OpenSim.Region.Environment.Scenes
465 ScenePartUpdate update = m_updateTimes[part.UUID]; 473 ScenePartUpdate update = m_updateTimes[part.UUID];
466 474
467 // Two updates can occur with the same timestamp (especially 475 // Two updates can occur with the same timestamp (especially
468 // since our timestamp resolution is to the nearest second). The first 476 // since our timestamp resolution is to the nearest second). Therefore, we still need
469 // could have been sent in the last update - we still need to send the 477 // to send an update even if the last full update time is identical to the part's
470 // second here. 478 // update timestamp.
471 479 //
472 if (update.LastFullUpdateTime < part.TimeStampFull) 480 // If we don't do this, various events (such as linking and delinking in the same
481 // second), will stop working properly!
482 if (update.LastFullUpdateTime <= part.TimeStampFull)
473 { 483 {
474 //need to do a full update 484 //need to do a full update
475 part.SendFullUpdate(ControllingClient, GenerateClientFlags(part.UUID)); 485 part.SendFullUpdate(ControllingClient, GenerateClientFlags(part.UUID));
476 486
477 // We'll update to the part's timestamp rather than the current to 487 // We'll update to the part's timestamp rather than the current time to
478 // avoid the race condition whereby the next tick occurs while we are 488 // avoid the race condition whereby the next tick occurs while we are
479 // doing this update. If this happened, then subsequent updates which occurred 489 // doing this update. If this happened, then subsequent updates which occurred
480 // on the same tick or the next tick of the last update would be ignored. 490 // on the same tick or the next tick of the last update would be ignored.