diff options
author | lbsa71 | 2007-09-21 06:00:34 +0000 |
---|---|---|
committer | lbsa71 | 2007-09-21 06:00:34 +0000 |
commit | 34043cd35143a25fb48412026b3a6ccb2c030255 (patch) | |
tree | 974eea2cab153dc6e3c8616292afa1a152aad38c /OpenSim/Region/Environment/Scenes/ScenePresence.cs | |
parent | * Yeah, I placed Close() in the wrong file. So sue me. (diff) | |
download | opensim-SC-34043cd35143a25fb48412026b3a6ccb2c030255.zip opensim-SC-34043cd35143a25fb48412026b3a6ccb2c030255.tar.gz opensim-SC-34043cd35143a25fb48412026b3a6ccb2c030255.tar.bz2 opensim-SC-34043cd35143a25fb48412026b3a6ccb2c030255.tar.xz |
* Slowly but surely working my way towards Regionality...
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 61 |
1 files changed, 25 insertions, 36 deletions
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 | } |