aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs53
1 files changed, 16 insertions, 37 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index f83a4d2..465e916 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -830,41 +830,15 @@ namespace OpenSim.Region.Framework.Scenes
830 pos.Y = crossedBorder.BorderLine.Z - 1; 830 pos.Y = crossedBorder.BorderLine.Z - 1;
831 } 831 }
832 832
833 833 if (pos.X < 0f || pos.Y < 0f || pos.Z < 0f)
834 if (pos.X < 0 || pos.Y < 0 || pos.Z < 0)
835 { 834 {
836 Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128);
837
838 if (pos.X < 0)
839 {
840 emergencyPos.X = (int)Constants.RegionSize + pos.X;
841 if (!(pos.Y < 0))
842 emergencyPos.Y = pos.Y;
843 if (!(pos.Z < 0))
844 emergencyPos.X = pos.X;
845 }
846 if (pos.Y < 0)
847 {
848 emergencyPos.Y = (int)Constants.RegionSize + pos.Y;
849 if (!(pos.X < 0))
850 emergencyPos.X = pos.X;
851 if (!(pos.Z < 0))
852 emergencyPos.Z = pos.Z;
853 }
854 if (pos.Z < 0)
855 {
856 if (!(pos.X < 0))
857 emergencyPos.X = pos.X;
858 if (!(pos.Y < 0))
859 emergencyPos.Y = pos.Y;
860 //Leave as 128
861 }
862
863 m_log.WarnFormat( 835 m_log.WarnFormat(
864 "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", 836 "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Clamping",
865 pos, Name, UUID, emergencyPos); 837 pos, Name, UUID);
866 838
867 pos = emergencyPos; 839 if (pos.X < 0f) pos.X = 0f;
840 if (pos.Y < 0f) pos.Y = 0f;
841 if (pos.Z < 0f) pos.Z = 0f;
868 } 842 }
869 843
870 float localAVHeight = 1.56f; 844 float localAVHeight = 1.56f;
@@ -875,7 +849,7 @@ namespace OpenSim.Region.Framework.Scenes
875 849
876 float posZLimit = 0; 850 float posZLimit = 0;
877 851
878 if (pos.X <Constants.RegionSize && pos.Y < Constants.RegionSize) 852 if (pos.X < Constants.RegionSize && pos.Y < Constants.RegionSize)
879 posZLimit = (float)m_scene.Heightmap[(int)pos.X, (int)pos.Y]; 853 posZLimit = (float)m_scene.Heightmap[(int)pos.X, (int)pos.Y];
880 854
881 float newPosZ = posZLimit + localAVHeight / 2; 855 float newPosZ = posZLimit + localAVHeight / 2;
@@ -2685,7 +2659,12 @@ namespace OpenSim.Region.Framework.Scenes
2685 /// </summary> 2659 /// </summary>
2686 protected void CheckForSignificantMovement() 2660 protected void CheckForSignificantMovement()
2687 { 2661 {
2688 if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > 0.5) 2662 // Movement updates for agents in neighboring regions are sent directly to clients.
2663 // This value only affects how often agent positions are sent to neighbor regions
2664 // for things such as distance-based update prioritization
2665 const float SIGNIFICANT_MOVEMENT = 2.0f;
2666
2667 if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > SIGNIFICANT_MOVEMENT)
2689 { 2668 {
2690 posLastSignificantMove = AbsolutePosition; 2669 posLastSignificantMove = AbsolutePosition;
2691 m_scene.EventManager.TriggerSignificantClientMovement(m_controllingClient); 2670 m_scene.EventManager.TriggerSignificantClientMovement(m_controllingClient);
@@ -2701,13 +2680,13 @@ namespace OpenSim.Region.Framework.Scenes
2701 cadu.AgentID = UUID.Guid; 2680 cadu.AgentID = UUID.Guid;
2702 cadu.alwaysrun = m_setAlwaysRun; 2681 cadu.alwaysrun = m_setAlwaysRun;
2703 cadu.AVHeight = m_avHeight; 2682 cadu.AVHeight = m_avHeight;
2704 sLLVector3 tempCameraCenter = new sLLVector3(new Vector3(m_CameraCenter.X, m_CameraCenter.Y, m_CameraCenter.Z)); 2683 Vector3 tempCameraCenter = m_CameraCenter;
2705 cadu.cameraPosition = tempCameraCenter; 2684 cadu.cameraPosition = tempCameraCenter;
2706 cadu.drawdistance = m_DrawDistance; 2685 cadu.drawdistance = m_DrawDistance;
2707 if (m_scene.Permissions.IsGod(new UUID(cadu.AgentID))) 2686 if (m_scene.Permissions.IsGod(new UUID(cadu.AgentID)))
2708 cadu.godlevel = m_godlevel; 2687 cadu.godlevel = m_godlevel;
2709 cadu.GroupAccess = 0; 2688 cadu.GroupAccess = 0;
2710 cadu.Position = new sLLVector3(AbsolutePosition); 2689 cadu.Position = AbsolutePosition;
2711 cadu.regionHandle = m_rootRegionHandle; 2690 cadu.regionHandle = m_rootRegionHandle;
2712 float multiplier = 1; 2691 float multiplier = 1;
2713 int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); 2692 int innacurateNeighbors = m_scene.GetInaccurateNeighborCount();
@@ -2722,7 +2701,7 @@ namespace OpenSim.Region.Framework.Scenes
2722 2701
2723 //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString()); 2702 //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString());
2724 cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier); 2703 cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier);
2725 cadu.Velocity = new sLLVector3(Velocity); 2704 cadu.Velocity = Velocity;
2726 2705
2727 AgentPosition agentpos = new AgentPosition(); 2706 AgentPosition agentpos = new AgentPosition();
2728 agentpos.CopyFrom(cadu); 2707 agentpos.CopyFrom(cadu);