aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorlbsa712007-09-21 06:00:34 +0000
committerlbsa712007-09-21 06:00:34 +0000
commit34043cd35143a25fb48412026b3a6ccb2c030255 (patch)
tree974eea2cab153dc6e3c8616292afa1a152aad38c /OpenSim/Region/Environment
parent* Yeah, I placed Close() in the wrong file. So sue me. (diff)
downloadopensim-SC_OLD-34043cd35143a25fb48412026b3a6ccb2c030255.zip
opensim-SC_OLD-34043cd35143a25fb48412026b3a6ccb2c030255.tar.gz
opensim-SC_OLD-34043cd35143a25fb48412026b3a6ccb2c030255.tar.bz2
opensim-SC_OLD-34043cd35143a25fb48412026b3a6ccb2c030255.tar.xz
* Slowly but surely working my way towards Regionality...
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs17
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs61
3 files changed, 44 insertions, 44 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index 91b9634..43a9d86 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -504,12 +504,12 @@ namespace OpenSim.Region.Environment.Scenes
504 } 504 }
505 } 505 }
506 506
507 public void StartAnimation(IClientAPI client, LLUUID animID, int seq) 507 public void StartAnimation(LLUUID animID, int seq, LLUUID agentId)
508 { 508 {
509 ForEachScenePresence(delegate(ScenePresence presence) 509 Broadcast(delegate(IClientAPI client)
510 { 510 {
511 presence.ControllingClient.SendAnimation(animID, seq, client.AgentId); 511 client.SendAnimation(animID, seq, agentId);
512 }); 512 });
513 } 513 }
514 514
515 public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) 515 public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index ab52ebf..adf501e 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -367,6 +367,10 @@ namespace OpenSim.Region.Environment.Scenes
367 updateLock.ReleaseMutex(); 367 updateLock.ReleaseMutex();
368 } 368 }
369 369
370 /// <summary>
371 /// Perform delegate action on all clients subscribing to updates from this region.
372 /// </summary>
373 /// <returns></returns>
370 internal void Broadcast(Action<IClientAPI> whatToDo) 374 internal void Broadcast(Action<IClientAPI> whatToDo)
371 { 375 {
372 m_region.Broadcast(whatToDo); 376 m_region.Broadcast(whatToDo);
@@ -775,7 +779,6 @@ namespace OpenSim.Region.Environment.Scenes
775 client.SendKillObject(avatar.RegionHandle, avatar.LocalId); 779 client.SendKillObject(avatar.RegionHandle, avatar.LocalId);
776 }); 780 });
777 781
778
779 ForEachScenePresence( 782 ForEachScenePresence(
780 delegate(ScenePresence presence) 783 delegate(ScenePresence presence)
781 { 784 {
@@ -898,12 +901,20 @@ namespace OpenSim.Region.Environment.Scenes
898 901
899 public void SendKillObject(uint localID) 902 public void SendKillObject(uint localID)
900 { 903 {
901 ForEachScenePresence(delegate(ScenePresence presence) 904 Broadcast(delegate(IClientAPI client)
902 { 905 {
903 presence.ControllingClient.SendKillObject(m_regionHandle, localID); 906 client.SendKillObject(m_regionHandle, localID);
904 }); 907 });
905 } 908 }
906 909
910 public void NotifyMyCoarseLocationChange()
911 {
912 ForEachScenePresence(delegate(ScenePresence presence)
913 {
914 presence.CoarseLocationChange();
915 });
916 }
917
907 public void SendAllSceneObjectsToClient(ScenePresence presence) 918 public void SendAllSceneObjectsToClient(ScenePresence presence)
908 { 919 {
909 foreach (EntityBase ent in Entities.Values) 920 foreach (EntityBase ent in Entities.Values)
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index d70752d..fa37b9f 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -60,8 +60,8 @@ namespace OpenSim.Region.Environment.Scenes
60 public bool IsRestrictedToRegion = false; 60 public bool IsRestrictedToRegion = false;
61 61
62 private bool m_newForce = false; 62 private bool m_newForce = false;
63 private bool newAvatar = false; 63 private bool m_newAvatar = false;
64 private bool newCoarseLocations = true; 64 private bool m_newCoarseLocations = true;
65 65
66 protected RegionInfo m_regionInfo; 66 protected RegionInfo m_regionInfo;
67 protected ulong crossingFromRegion = 0; 67 protected ulong crossingFromRegion = 0;
@@ -279,7 +279,7 @@ namespace OpenSim.Region.Environment.Scenes
279 279
280 //temporary until we move some code into the body classes 280 //temporary until we move some code into the body classes
281 281
282 if (newAvatar) 282 if (m_newAvatar)
283 { 283 {
284 //do we need to use newAvatar? not sure so have added this to kill the compile warning 284 //do we need to use newAvatar? not sure so have added this to kill the compile warning
285 } 285 }
@@ -338,7 +338,7 @@ namespace OpenSim.Region.Environment.Scenes
338 338
339 public void MakeAvatarPhysical(LLVector3 pos, bool isFlying) 339 public void MakeAvatarPhysical(LLVector3 pos, bool isFlying)
340 { 340 {
341 newAvatar = true; 341 m_newAvatar = true;
342 m_isChildAgent = false; 342 m_isChildAgent = false;
343 343
344 AbsolutePosition = pos; 344 AbsolutePosition = pos;
@@ -402,7 +402,7 @@ namespace OpenSim.Region.Environment.Scenes
402 visualParams[i] = visualParam[i].ParamValue; 402 visualParams[i] = visualParam[i].ParamValue;
403 } 403 }
404 404
405 SendArrearanceToAllOtherAgents(); 405 SendAppearanceToAllOtherAgents();
406 } 406 }
407 407
408 /// <summary> 408 /// <summary>
@@ -541,10 +541,10 @@ namespace OpenSim.Region.Environment.Scenes
541 { 541 {
542 SendPrimUpdates(); 542 SendPrimUpdates();
543 543
544 if (newCoarseLocations) 544 if (m_newCoarseLocations)
545 { 545 {
546 SendCoarseLocations(); 546 SendCoarseLocations();
547 newCoarseLocations = false; 547 m_newCoarseLocations = false;
548 } 548 }
549 549
550 if (m_isChildAgent == false) 550 if (m_isChildAgent == false)
@@ -605,13 +605,9 @@ namespace OpenSim.Region.Environment.Scenes
605 /// </summary> 605 /// </summary>
606 public void SendTerseUpdateToAllClients() 606 public void SendTerseUpdateToAllClients()
607 { 607 {
608 m_scene.ForEachScenePresence(delegate(ScenePresence presence) 608 m_scene.Broadcast( SendTerseUpdateToClient );
609 {
610 SendTerseUpdateToClient(presence.m_controllingClient);
611 });
612 } 609 }
613 610
614
615 public void SendCoarseLocations() 611 public void SendCoarseLocations()
616 { 612 {
617 List<LLVector3> CoarseLocations = new List<LLVector3>(); 613 List<LLVector3> CoarseLocations = new List<LLVector3>();
@@ -629,19 +625,10 @@ namespace OpenSim.Region.Environment.Scenes
629 625
630 public void CoarseLocationChange() 626 public void CoarseLocationChange()
631 { 627 {
632 newCoarseLocations = true; 628 m_newCoarseLocations = true;
633 } 629 }
634 630
635 private void NotifyMyCoarseLocationChange() 631
636 {
637 m_scene.ForEachScenePresence(delegate(ScenePresence presence)
638 {
639 if (presence != this)
640 {
641 presence.CoarseLocationChange();
642 }
643 });
644 }
645 632
646 633
647 /// <summary> 634 /// <summary>
@@ -681,11 +668,11 @@ namespace OpenSim.Region.Environment.Scenes
681 if (!m_isChildAgent) 668 if (!m_isChildAgent)
682 { 669 {
683 m_scene.InformClientOfNeighbours(m_controllingClient); 670 m_scene.InformClientOfNeighbours(m_controllingClient);
684 newAvatar = false; 671 m_newAvatar = false;
685 } 672 }
686 673
687 SendFullUpdateToAllClients(); 674 SendFullUpdateToAllClients();
688 SendArrearanceToAllOtherAgents(); 675 SendAppearanceToAllOtherAgents();
689 } 676 }
690 677
691 /// <summary> 678 /// <summary>
@@ -697,7 +684,7 @@ namespace OpenSim.Region.Environment.Scenes
697 m_controllingClient.SendWearables(Wearables); 684 m_controllingClient.SendWearables(Wearables);
698 685
699 //this.SendFullUpdateToAllClients(); 686 //this.SendFullUpdateToAllClients();
700 //this.SendArrearanceToAllOtherAgents(); 687 //this.SendAppearanceToAllOtherAgents();
701 688
702 m_scene.SendAllSceneObjectsToClient(this); 689 m_scene.SendAllSceneObjectsToClient(this);
703 m_controllingClient.SendViewerTime(m_scene.TimePhase); 690 m_controllingClient.SendViewerTime(m_scene.TimePhase);
@@ -716,11 +703,14 @@ namespace OpenSim.Region.Environment.Scenes
716 /// <summary> 703 /// <summary>
717 /// 704 ///
718 /// </summary> 705 /// </summary>
719 public void SendArrearanceToAllOtherAgents() 706 public void SendAppearanceToAllOtherAgents()
720 { 707 {
721 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) 708 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
722 { 709 {
723 SendAppearanceToOtherAgent(scenePresence); 710 if (scenePresence != this)
711 {
712 SendAppearanceToOtherAgent(scenePresence);
713 }
724 }); 714 });
725 } 715 }
726 716
@@ -743,12 +733,12 @@ namespace OpenSim.Region.Environment.Scenes
743 { 733 {
744 CurrentAnimation = animID; 734 CurrentAnimation = animID;
745 AnimationSeq = seq; 735 AnimationSeq = seq;
736 LLUUID sourceAgentId = m_controllingClient.AgentId;
746 737
747 m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) 738 m_scene.Broadcast(delegate(IClientAPI client)
748 { 739 {
749 scenePresence.m_controllingClient.SendAnimation(animID, seq, 740 client.SendAnimation(animID, seq, sourceAgentId);
750 m_controllingClient.AgentId); 741 });
751 });
752 } 742 }
753 743
754 /// <summary> 744 /// <summary>
@@ -771,7 +761,7 @@ namespace OpenSim.Region.Environment.Scenes
771 if (OnSignificantClientMovement != null) 761 if (OnSignificantClientMovement != null)
772 { 762 {
773 OnSignificantClientMovement(m_controllingClient); 763 OnSignificantClientMovement(m_controllingClient);
774 NotifyMyCoarseLocationChange(); 764 m_scene.NotifyMyCoarseLocationChange();
775 } 765 }
776 } 766 }
777 } 767 }
@@ -845,14 +835,13 @@ namespace OpenSim.Region.Environment.Scenes
845 m_physicsActor.Flying); 835 m_physicsActor.Flying);
846 if (res) 836 if (res)
847 { 837 {
848 //TODO: following line is hard coded to port 9000, really need to change this as soon as possible
849 AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); 838 AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo();
850 string capsPath = Util.GetCapsURL(m_controllingClient.AgentId); 839 string capsPath = Util.GetCapsURL(m_controllingClient.AgentId);
851 m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, 840 m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint,
852 capsPath); 841 capsPath);
853 MakeChildAgent(); 842 MakeChildAgent();
854 m_scene.SendKillObject(m_localId); 843 m_scene.SendKillObject(m_localId);
855 NotifyMyCoarseLocationChange(); 844 m_scene.NotifyMyCoarseLocationChange();
856 } 845 }
857 } 846 }
858 } 847 }