aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorlbsa712007-09-20 13:04:51 +0000
committerlbsa712007-09-20 13:04:51 +0000
commit7335e5710bd0c22c9e5bd9fa0b576d0985d2fba9 (patch)
tree866c1cf215fddc3404181c679783f903c925e000 /OpenSim/Region/Environment/Scenes/ScenePresence.cs
parent* moved SceneManager to RegionApplicationBase (diff)
downloadopensim-SC-7335e5710bd0c22c9e5bd9fa0b576d0985d2fba9.zip
opensim-SC-7335e5710bd0c22c9e5bd9fa0b576d0985d2fba9.tar.gz
opensim-SC-7335e5710bd0c22c9e5bd9fa0b576d0985d2fba9.tar.bz2
opensim-SC-7335e5710bd0c22c9e5bd9fa0b576d0985d2fba9.tar.xz
Rev 1971 : The Lbsa71 vintage commit
* Refactored to prepare for some serious restructuring
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs69
1 files changed, 34 insertions, 35 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 811c962..538e46c 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -301,7 +301,7 @@ namespace OpenSim.Region.Environment.Scenes
301 public void Teleport(LLVector3 pos) 301 public void Teleport(LLVector3 pos)
302 { 302 {
303 AbsolutePosition = pos; 303 AbsolutePosition = pos;
304 SendTerseUpdateToALLClients(); 304 SendTerseUpdateToAllClients();
305 } 305 }
306 306
307 /// <summary> 307 /// <summary>
@@ -473,7 +473,7 @@ namespace OpenSim.Region.Environment.Scenes
473 /// check for user movement 'forces' (ie commands to move) 473 /// check for user movement 'forces' (ie commands to move)
474 if (newForce) 474 if (newForce)
475 { 475 {
476 SendTerseUpdateToALLClients(); 476 SendTerseUpdateToAllClients();
477 _updateCount = 0; 477 _updateCount = 0;
478 } 478 }
479 479
@@ -483,7 +483,7 @@ namespace OpenSim.Region.Environment.Scenes
483 _updateCount++; 483 _updateCount++;
484 if (_updateCount > 3) 484 if (_updateCount > 3)
485 { 485 {
486 SendTerseUpdateToALLClients(); 486 SendTerseUpdateToAllClients();
487 _updateCount = 0; 487 _updateCount = 0;
488 } 488 }
489 } 489 }
@@ -491,7 +491,7 @@ namespace OpenSim.Region.Environment.Scenes
491 /// check for physics-related movement 491 /// check for physics-related movement
492 else if (lastPhysPos.GetDistanceTo(AbsolutePosition) > 0.02) 492 else if (lastPhysPos.GetDistanceTo(AbsolutePosition) > 0.02)
493 { 493 {
494 SendTerseUpdateToALLClients(); 494 SendTerseUpdateToAllClients();
495 _updateCount = 0; 495 _updateCount = 0;
496 lastPhysPos = AbsolutePosition; 496 lastPhysPos = AbsolutePosition;
497 } 497 }
@@ -524,27 +524,27 @@ namespace OpenSim.Region.Environment.Scenes
524 /// <summary> 524 /// <summary>
525 /// 525 ///
526 /// </summary> 526 /// </summary>
527 public void SendTerseUpdateToALLClients() 527 public void SendTerseUpdateToAllClients()
528 { 528 {
529 List<ScenePresence> avatars = m_scene.RequestAvatarList(); 529 m_scene.ForEachScenePresence(delegate(ScenePresence presence)
530 for (int i = 0; i < avatars.Count; i++) 530 {
531 { 531 SendTerseUpdateToClient(presence.ControllingClient);
532 SendTerseUpdateToClient(avatars[i].ControllingClient); 532 });
533 }
534 } 533 }
535 534
536 535
537 public void SendCoarseLocations() 536 public void SendCoarseLocations()
538 { 537 {
539 List<LLVector3> CoarseLocations = new List<LLVector3>(); 538 List<LLVector3> CoarseLocations = new List<LLVector3>();
540 List<ScenePresence> avatars = m_scene.RequestAvatarList(); 539 List<ScenePresence> avatars = m_scene.GetAvatars();
541 for (int i = 0; i < avatars.Count; i++) 540 for (int i = 0; i < avatars.Count; i++)
542 { 541 {
543 if (avatars[i] != this && (!avatars[i].childAgent)) 542 if (avatars[i] != this )
544 { 543 {
545 CoarseLocations.Add(avatars[i].AbsolutePosition); 544 CoarseLocations.Add(avatars[i].AbsolutePosition);
546 } 545 }
547 } 546 }
547
548 ControllingClient.SendCoarseLocationUpdate(CoarseLocations); 548 ControllingClient.SendCoarseLocationUpdate(CoarseLocations);
549 } 549 }
550 550
@@ -555,14 +555,13 @@ namespace OpenSim.Region.Environment.Scenes
555 555
556 private void NotifyMyCoarseLocationChange() 556 private void NotifyMyCoarseLocationChange()
557 { 557 {
558 List<ScenePresence> avatars = m_scene.RequestAvatarList(); 558 m_scene.ForEachScenePresence(delegate(ScenePresence presence)
559 for (int i = 0; i < avatars.Count; i++) 559 {
560 { 560 if (presence != this)
561 if (avatars[i] != this) 561 {
562 { 562 presence.CoarseLocationChange(this);
563 avatars[i].CoarseLocationChange(this); 563 }
564 } 564 });
565 }
566 } 565 }
567 566
568 567
@@ -576,10 +575,10 @@ namespace OpenSim.Region.Environment.Scenes
576 LocalId, AbsolutePosition, m_textureEntry.ToBytes()); 575 LocalId, AbsolutePosition, m_textureEntry.ToBytes());
577 } 576 }
578 577
579 public void SendFullUpdateToALLClients() 578 public void SendFullUpdateToAllClients()
580 { 579 {
581 List<ScenePresence> avatars = m_scene.RequestAvatarList(); 580 List<ScenePresence> avatars = m_scene.GetScenePresences();
582 foreach (ScenePresence avatar in m_scene.RequestAvatarList()) 581 foreach (ScenePresence avatar in avatars)
583 { 582 {
584 SendFullUpdateToOtherClient(avatar); 583 SendFullUpdateToOtherClient(avatar);
585 if (avatar.LocalId != LocalId) 584 if (avatar.LocalId != LocalId)
@@ -606,7 +605,7 @@ namespace OpenSim.Region.Environment.Scenes
606 newAvatar = false; 605 newAvatar = false;
607 } 606 }
608 607
609 SendFullUpdateToALLClients(); 608 SendFullUpdateToAllClients();
610 SendArrearanceToAllOtherAgents(); 609 SendArrearanceToAllOtherAgents();
611 } 610 }
612 611
@@ -618,7 +617,7 @@ namespace OpenSim.Region.Environment.Scenes
618 { 617 {
619 ControllingClient.SendWearables(Wearables); 618 ControllingClient.SendWearables(Wearables);
620 619
621 //this.SendFullUpdateToALLClients(); 620 //this.SendFullUpdateToAllClients();
622 //this.SendArrearanceToAllOtherAgents(); 621 //this.SendArrearanceToAllOtherAgents();
623 622
624 m_scene.SendAllSceneObjectsToClient(this); 623 m_scene.SendAllSceneObjectsToClient(this);
@@ -640,11 +639,10 @@ namespace OpenSim.Region.Environment.Scenes
640 /// </summary> 639 /// </summary>
641 public void SendArrearanceToAllOtherAgents() 640 public void SendArrearanceToAllOtherAgents()
642 { 641 {
643 List<ScenePresence> avatars = m_scene.RequestAvatarList(); 642 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
644 foreach (ScenePresence avatar in m_scene.RequestAvatarList()) 643 {
645 { 644 SendAppearanceToOtherAgent(scenePresence);
646 SendAppearanceToOtherAgent(avatar); 645 });
647 }
648 } 646 }
649 647
650 /// <summary> 648 /// <summary>
@@ -666,11 +664,12 @@ namespace OpenSim.Region.Environment.Scenes
666 { 664 {
667 current_anim = animID; 665 current_anim = animID;
668 anim_seq = seq; 666 anim_seq = seq;
669 List<ScenePresence> avatars = m_scene.RequestAvatarList(); 667
670 for (int i = 0; i < avatars.Count; i++) 668 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
671 { 669 {
672 avatars[i].ControllingClient.SendAnimation(animID, seq, ControllingClient.AgentId); 670 scenePresence.ControllingClient.SendAnimation(animID, seq,
673 } 671 ControllingClient.AgentId);
672 });
674 } 673 }
675 674
676 /// <summary> 675 /// <summary>